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

closing menu items

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




Joined: 09 Jun 2008
Posts: 12

PostPosted: Sat Jul 05, 2008 3:38 pm    Post subject: closing menu items Reply with quote

I need suggestions as to the most efficient way to do this...

Currently, when I script open up a custom menu, along with all the tiny custom menus that open along with it...in order to close them, I have to backspace all of the tiny components closed.

Code:
variable(pickedhero)
pickedhero:=pick hero

herobody := getherostat(pickedhero, stat:body, currentstat)
heromind := getherostat(pickedhero, stat:mind, currentstat)
herosoul := getherostat(pickedhero, stat:soul, currentstat)

close menu (1)

open menu (12)
open menu (6)
open menu (3)
open menu (9)
open menu (5)

if(key is pressed(14))
then(
Close menu (12)
Close menu (6)
Close menu (3)
Close menu (9)
Close menu (5)
open menu (1)
)


I thought this code would close all the menus if they press back space, but it does not because of suspended gameplay.

Is there an easier way to close out numerous menus or am I going to have to script a "back" menu item within each menu in order to do so?
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Sun Jul 06, 2008 11:09 am    Post subject: Reply with quote

If you want to do any type of scripting with your menus, you almost certainly don't want the "Allow Gameplay" bitset turned off

Instead, leave "Allow Gameplay" on, and just make sure to do:

Code:
suspend player
suspend NPCs


before your menus open up, and after your menus close, do:

Code:
resume player
resume NPCs


In the next release, "Allow Gameplay" is being renamed to "Allow Gameplay & Scripts" to make it clearer how it actually works.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon Jul 07, 2008 5:37 pm    Post subject: Reply with quote

Just like "bring menu forward" and nearly any other command, "close menu" expects a menu handle, not a menu id number!

To close all open menus, you can do this:
Code:
while (top menu) do (
  close menu (top menu)
)

_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
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