View previous topic :: View next topic |
Author |
Message |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sun May 02, 2010 11:24 am Post subject: main menu and suspend player |
|
|
I need to let the player access the main menu while "suspend player" is in effect.
How do you do this?
I've got a keypress script, and it looks like this:
Code: | IF (KEY IS PRESSED: ESC) THEN(
IF (TOP MENU == 0) then(
OPEN MENU(0) # this is the main menu
)
ELSE
CLOSE MENU(TOP MENU)
)
END #IF esc is pressed |
But ... this only half works because TOP MENU seems to be returning false even if the main menu is open :-(
Is there a command that closes menus using an ID rather than a handle?
Is there a way of getting the Main Menu's handle?
me <- Frustrated Angry Face _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun May 02, 2010 11:35 am Post subject: |
|
|
Is your main menu configured to allow gameplay and scripts? |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sun May 02, 2010 11:47 am Post subject: |
|
|
No, the bitset is off.
What does it do?
Hm ... on second examination, I might be manufacturing my own problems here ...
Here's the full story ... I've got a script that looks like this:
Code: | SUSPEND PLAYER
WHILE (1) DO(
... keypress stuff ....
IF (KEY IS PRESSED: ESC) THEN(
IF (TOP MENU == 0) then(
OPEN MENU(0) # this is the main menu
)
ELSE
CLOSE MENU(TOP MENU)
)
END #IF esc is pressed
wait(1)
END |
What happens is when I hit esc, the main menu opens, then, if I hit esc when the menu is open, I think it closes, and reopens again.
So ... by hitting esc to close the main menu, am I re-triggering it to open? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun May 02, 2010 4:09 pm Post subject: |
|
|
If a menu has the "Allow Gameplay and Scripts" bitset OFF then the menu completely freezes the script until you exit the menu. Then the script continues right after the "open menu" command.
If a menu has the "Allow Gameplay and Scripts" bitset ON then the script continues running while you use the menu. This more is required for most menu manipulation commands to work at all. |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Tue May 04, 2010 1:27 pm Post subject: |
|
|
Does "suspend player" prevent the player from closing the main menu if it's already open? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue May 04, 2010 8:28 pm Post subject: |
|
|
Suspend player just stops you from opening the menu. It has no other impact on munu contols. |
|
Back to top |
|
 |
|