I am using custom menus to create a menu with another submenu. In order to have the 'cancel' button go back one menu, I have to have a "Close Menu" script that opens the previous menu. The last submenu has items that the player can select, and when these are called, I have to close the menu for their scripts to work correctly. However, when I close the menus in this fashion, it activates the "Close Menu" script, calling the previous submenu up.
I know various ridiculous methods of making this flow naturally, but I would love it if the engine supported a fix inherently. If "closing the menu" was different from "using an item on the menu" or if I could pass a value on menu closes, that would be awesome.
Any thoughts?
My website, the home of Motrya:
http://www.jshgaming.com
It's possible currently to set tags when a menu item is selected. I don't know what you're using to chain menus, but if you're doing it via textboxes then your solution is simple. If not, then do it via textboxes and your solution is simple anyway.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
I am opening submenus from the main menu. Why would I use text boxes?
My website, the home of Motrya:
http://www.jshgaming.com
My website, the home of Motrya:
http://www.jshgaming.com
msw188 wrote:
Isn't there a bitset for having menu selections close their current menu? I think this should be enough for what you're describing, but I have to admit that I'm pretty tired at the moment.
Yes and I'm using it, and it's the problem. When you make the selection the menu closes, double-triggering both the close script and the item's script.
My website, the home of Motrya:
http://www.jshgaming.com
Mogri wrote:
Make the close script check for the menu tag.
I actually have done this already, and it still didn't work. I also had to implement a lot of inefficient scripting to make sure the tag was off when it needed to be. At this point the only solution that seems like it would really work to me would be to make a completely separate menu system via scripting. I can do that, but for the future of the engine I suggest that menus should be more intuitive.
My website, the home of Motrya:
http://www.jshgaming.com
Do you happen to know why it didn't work? Were the tags not set at the time the script was called? If that's the case, then it's probably an engine error (and an easy fix, too).
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Oh, I see! We didn't have "close scripts" when I was doing Tales 2, so what I did (I'm pretty certain) was to not allow menues (besides the main menu) to be cancelled by ESC, and instead write a separate menu choice "cancel" for closing the menu and bringing back the main menu. Would you find this an acceptable/workable alternative?
I am Srime
I am Srime
msw188 wrote:
Oh, I see! We didn't have "close scripts" when I was doing Tales 2, so what I did (I'm pretty certain) was to not allow menues (besides the main menu) to be cancelled by ESC, and instead write a separate menu choice "cancel" for closing the menu and bringing back the main menu. Would you find this an acceptable/workable alternative?
This is what I'm doing now, but personally I hate that every other menu in the game can be canceled with the cancel key besides these. It looks really unprofessional and someone is bound to complain about it.
My website, the home of Motrya:
http://www.jshgaming.com
I think I get what you're saying here. I've traditionally used something like this:
Set the menu to not close on cancel and check afterward for menu tags (alternatively, you can put a "selected menu item" check inside the loop).
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Code:
menu id := open menu(1)
while (menu is open(menu id)) do (
if (pressed cancel key) then (close menu(menu id))
wait(1)
)
while (menu is open(menu id)) do (
if (pressed cancel key) then (close menu(menu id))
wait(1)
)
Set the menu to not close on cancel and check afterward for menu tags (alternatively, you can put a "selected menu item" check inside the loop).
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Mogri wrote:
I think I get what you're saying here. I've traditionally used something like this:
Set the menu to not close on cancel and check afterward for menu tags (alternatively, you can put a "selected menu item" check inside the loop).
Code:
menu id := open menu(1)
while (menu is open(menu id)) do (
if (pressed cancel key) then (close menu(menu id))
wait(1)
)
while (menu is open(menu id)) do (
if (pressed cancel key) then (close menu(menu id))
wait(1)
)
Set the menu to not close on cancel and check afterward for menu tags (alternatively, you can put a "selected menu item" check inside the loop).
Right, this was the workaround I was thinking about using (Well, mine wasn't quite as pretty), but I really think the engine should do something similar in the first place.
My website, the home of Motrya:
http://www.jshgaming.com
JSH357 wrote:
I am using custom menus to create a menu with another submenu. In order to have the 'cancel' button go back one menu, I have to have a "Close Menu" script that opens the previous menu. The last submenu has items that the player can select, and when these are called, I have to close the menu for their scripts to work correctly. However, when I close the menus in this fashion, it activates the "Close Menu" script, calling the previous submenu up.
How are you closing these menus?
When you close a menu using the "close menu" plotscripting command, it should NOT be running its "on close" trigger, and if it is, that sounds like a bug.
The script triggered on close should only happen when you close the menu with ESC or with a menu item that has the bitset for closing the menu...
that must be what you are using, right?
Sounds like I need to add a menu item bitset "don't run the on-close script"
James Paige wrote:
The script triggered on close should only happen when you close the menu with ESC or with a menu item that has the bitset for closing the menu...
that must be what you are using, right?
Sounds like I need to add a menu item bitset "don't run the on-close script"
The script triggered on close should only happen when you close the menu with ESC or with a menu item that has the bitset for closing the menu...
that must be what you are using, right?
Sounds like I need to add a menu item bitset "don't run the on-close script"
Yes, that's what I'm using. That bitset would work wonders!
Honestly, I think menus are trickier than slices as they are now, haha.
My website, the home of Motrya:
http://www.jshgaming.com
JSH357 wrote:
Yes, that's what I'm using. That bitset would work wonders!
Yes, that's what I'm using. That bitset would work wonders!
I just did it, and I am forcing an early nightly build so you can test it out for me. let me know how it works for you :)
EDIT: Haha! Even better, I added a new menu feature. Each menu has the option of specifying a menu which will automatically be opened when you press the close button.
So now you have two ways of doing this :)



