Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

More on Menu Slices

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
alphawolf




Joined: 17 Aug 2012
Posts: 33
Location: South Carolina, America

PostPosted: Sat May 18, 2013 4:00 pm    Post subject: More on Menu Slices Reply with quote

Can entire Menus (Edited in custom.exe) be placed onto the screen with slices? If so, will they function properly?
_________________
#AlphaWolf#

http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.

##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios##
Back to top
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sun May 19, 2013 2:05 am    Post subject: Reply with quote

Yes, but menus aren't currently aren't slice-based. To open a menu created in Custom, use the 'open menu' command. You can even create menus entirely by script, creating an empty menu with 'create menu' and then adding menu items to it one at a time. There are lots of commands to manipulate every aspect of a menu.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
alphawolf




Joined: 17 Aug 2012
Posts: 33
Location: South Carolina, America

PostPosted: Sun May 19, 2013 4:18 am    Post subject: Reply with quote

Thanks, I guess now I should delve into the plotscripting dictionary Oookay...
_________________
#AlphaWolf#

http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.

##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios##
Back to top
View user's profile Send private message Visit poster's website
alphawolf




Joined: 17 Aug 2012
Posts: 33
Location: South Carolina, America

PostPosted: Sun May 19, 2013 5:07 am    Post subject: Reply with quote

Now, if I want both a slice and a menu up at the same time, which wait command should I try? I've tried "waitforkey", "waitformenu", "waitforslice", and "waitforall", but no matter what wait command I use, the menu and the slice I want up both display at separate times and close at separate times.

Here's my code:

if (keyispressed (key:esc), or, keyispressed (key:alt)) then(
variable(pOne), pOne := createrect(200, 100, 0)
putslice(pOne, 0, 0)
wait(1)
openmenu(0)

#I've tested with each of these wait commands.
#waitforkey(menuKey)
#waitforall
#waitforslice(pOne)
#waitformenu(0)

free slice(pOne)
)
_________________
#AlphaWolf#

http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.

##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios##
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sun May 19, 2013 9:16 am    Post subject: Reply with quote

It does not look like you want any kind of wait at all. Just leave it out.

You should split this task into several scripts.

The first script just puts the slices on the screen, and opens the menu, and then leaves them there.

After that script is run, the user will have control of the menu. You can write another script for when the menu is closed which also removes the slices.

Code:

global variable(0, menu slices)

plotscript, on key press handler, begin
  if (keyispressed (key:esc), or, keyispressed (key:alt)) then(
    open menu with slices
  )
end

script, open menu with slices, begin
  menu slices := createrect(200, 100, 0)
  putslice(menu slices, 0, 0)
  openmenu(0)
end

script, on menu close, begin
  free slice(menu slices)
end
Back to top
View user's profile Send private message Send e-mail Visit poster's website
alphawolf




Joined: 17 Aug 2012
Posts: 33
Location: South Carolina, America

PostPosted: Mon May 20, 2013 12:54 pm    Post subject: Reply with quote

Thanks! Happy Now one more question (mostly on your example, James), your example binded the variable menuslices before declaring it; You don't have to declare a variable first in hspeak?
_________________
#AlphaWolf#

http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.

##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios##
Back to top
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon May 20, 2013 5:45 pm    Post subject: Reply with quote

"menu slices" has been declared. It was declared as a global variable. That makes it accessible from all scripts.

Also, in HamsterSpeak order of declarations doesn't matter. "global variable" can be placed after a script that uses that variable, and likewise "variable" can appear after that variable's use. Ditto for scripts which call each other, and for constants.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
alphawolf




Joined: 17 Aug 2012
Posts: 33
Location: South Carolina, America

PostPosted: Mon May 20, 2013 5:51 pm    Post subject: Reply with quote

Oh jeez I'm blind Really confused I didn't see the Global declare, sorry about that.
_________________
#AlphaWolf#

http://societyofdreamers.webs.com/ <-- poetry forum, visit if you'd like, it's almost as dead as this forum (hehe) but it's just started.

##Contact at cckisby-SPAM@gmail.com#
#Remove the -SPAM above to prove you're# #not a spambot :/##
##AlphaWolf Studios##
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group