 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
mikej88 Guest
|
Posted: Sun Sep 26, 2010 1:28 pm Post subject: battle wait/active mode toggle in menu |
|
|
i'm creating a game that is an homage to old NES console RPGs, specifically Final Fantasy and Dragon Warrior, so i'm trying to create a menu system reminiscent of Dragon Warrior. there are multiple small menus that pop up over others.
this is how i have it set up so far:
Main Menu
_____________________
|Backpack |
|Magic |
|Status |
|Options -> |
|Back |
|_____________________|
selecting options opens up:
Options Menu
_____________________
|Volume |
|Battle Mode:Wait* |
|Battle Mode:Active* |
|Quit Game |
|Back |
|_____________________|
i have tags set up for the battle mode being set to wait and active. the items in the menu are set to appear if the corresponding tags are on, and they both also have both bitsets on: hide if disabled, close menu if selected. the idea is that when the battle mode is toggled, one item will disappear, and the other reappears. like this:
_____________________
|Volume |
|Battle Mode:Wait |
|Quit Game |
|Back |
|_____________________|
_____________________
|Volume |
|Battle Mode:Active |
|Quit Game |
|Back |
|_____________________|
however, the script makes it so that the battle mode doesnt toggle in-menu until the main menu is closed, no matter how many times the items are selected. this is what happens:
Main Menu
_____________________
|Backpack |
|Magic |
|Status |
|Options -> | (selects options)
|Back |
|_____________________|
\/this opens up below the Main Menu\/
_____________________
|Volume |
|Battle Mode:Wait -> | (selects battle mode)
|Quit Game |
|Back |
|_____________________|
...nothing happens! so we "back" out of the options, then the main menu.
then this little guy decides to pop out of nowhere!
_____________________
|Volume |
|Battle Mode:Active |
|Quit Game |
|Back |
|_____________________|
this is the script so far:
plotscript, battlemode toggle, begin
if (check tag(70) == off) then, begin
set tag (70,on)
set tag (69,off)
set battle wait mode (off)
open menu (1)
end, else, begin
set tag (70,off)
set tag (69,on)
set battle wait mode (on)
open menu (1)
end
end
i'm not too familiar with if/else/then scripts... at least not in hamsterspeak!
however, this script technically works... just not the way i would like it to.
so i'm calling upon my nerdy OHRRPGCEing brethren for help! this minor feature is very close to being complete, i can just feel it! |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Sep 27, 2010 6:30 am Post subject: |
|
|
Menus pause the game by default, and that includes preventing scripts from running. So when you select one of the two Battle Mode menu options, it'll only queue the script up to run when the game is unpaused.
I don't understand why the Options menu doesn't close when you select one of the Battle Mode options though. Are you sure they're set to close the menu?
You prevent a menu from pausing the game by turning on the "Allow gameplay & scripts" bit. You should also turn on "Suspend player even if gameplay allowed", otherwise they'll be able to walk around.
Your original script and setup should work. But there's a simpler way to create this kind of option, using just one tag and a very short script. Let's assume it's tag 70, and it's on if battle wait mode is on.
Code: | plotscript, battlemode toggle, begin
set battle wait mode (check tag(70))
end |
In your Options menu, set "Battle Mode:Wait" to appear if tag 70 is on, to toggle tag 70, and to run script battlemode toggle, but not to close the menu when selected. Set "Battle Mode:Active" to appear if tag 70 is off, to toggle tag 70, and to run script battlemode toggle, and to not close the menu.
Make sure the options menu doesn't pause the game.
Selecting one of the menu items will immediately toggle the tag, update the menu so that the other menu item appears, and run the script (with the new value of the tag). _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
mikej88 Guest
|
Posted: Tue Sep 28, 2010 4:46 am Post subject: |
|
|
well, now i feel dumb. it never occured to me that the menus pause the game. all i had to do was set those two bitsets, and now it works just fine.
and here i was thinking that it didnt work because the script wasnt complicated enough! i never had to change it! originally, it was just as simple as the one you suggested. oh well... it works now, and i thank you for all your help. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Sep 28, 2010 5:18 am Post subject: |
|
|
It's not intuitive at all, given that texboxes don't and that there are zillions of menu related commands. Probably would have been better to make the opposite the default. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Sep 28, 2010 9:15 am Post subject: |
|
|
The Mad Cacti wrote: | It's not intuitive at all, given that texboxes don't and that there are zillions of menu related commands. Probably would have been better to make the opposite the default. |
Maybe we should change the default for new menus? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Sep 29, 2010 2:53 am Post subject: |
|
|
If you think it should be done - I'm a bit cautious about changing defaults people have grown used to, but I guess that's a sad excuse for halting progress _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|
|
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
|