I'm trying to replicate that and it has been challenging. The reason why I'm doing this is I am creating a menu system that doesn't use the drop down list style that OHR uses.
Basically instead of selecting slots in a menu this highlights windows that will open actual custom.exe menus. It runs on scripts. Two specifically, and one other function but that's not relevant.
1. Runs script that opens and edits a custom.exe menu
2. Populates the custom.exe menu list based on how many of X you have
3. Sets each item to open a script that allows editing of X
4. Said script opens a custom slice menu
5. An option in the slice menu is to go back to the previous custom.exe menu that also runs the 1st step script
Step five is where I'm stuck.
A few things I've tested and tried
Add a new argument to the first script
So for the script in step 1, I'll just add an argument that is used
to remember the last selected item when getting to step five.
I did that. I used a global so the value is always constant in game.exe's memory. However! If I did this...
Code: Select all
plotscript, custom menu, remember, begin
#stuff
end
script, my custom slice menu, begin
#stuff
#option to close slice menu and return to custom menu
custom menu (last selected slot)
end
At least that's what I observed in the script debugger. I didn't find anything in the dictionary that would let the script continue after a new one is called.
In conclusion, this did work but not in any way that I want it to. It's due to the fact that the player can leave many scripts hanging, potentially causing numerous errors with global variables or cause a lot of memory to be tied up. Plus it's an ugly solution.
My second attempt was to create a dummy menu with the bit "Allow gameplay and scripts" and have it run (custom menu) on close then insert that menu into (my custom slice menu) and close it on there.
Code: Select all
plotscript, custom menu, remember, begin
#stuff
end
script, my custom slice menu, begin
#stuff
#option to close slice menu and return to custom menu
dummy menu := open menu (2, false)
close menu (dummy menu)
end
Anyway, I'm taking a break from this but if anyone feels likes helping or throwing an obvious solution I missed at my head be my guest.