Note:
I'm still really confused by scripting 'order of operations' and all the 'rules' of scripting, so take this as a grain of salt, as probably a lot of it is incorrect and~or incorrectly explained by me.
and XanMag may be right... there might be some weird bug in quest, which his solution fixes.
--------------------
you can't have multiple 'get input', 'show menu', 'wait', and etc activating~executing~running at the same time for obvious reasons.
thus, this makes scripting very difficult, especially as you make it more complex (try to keep your scripting as non-complex as you can, if you're a code noob like me, lol).
the 'wait' explained:
it stops the scripting (so, if you got any other scripts trying to activate~run~execute, this will likely cause an error), displays the 'continue' hyperlink, and upon pressing any keyboard key or (left) mouse click, causes whatever scripts you got nested inside of the 'wait' to execute~run~activate.
wait { // this stops the scripting and the 'continue' hyperlink is displayed
// upon keyboard key press and~or (left) mouse click, these nested script~s here, run~execute~activate (and the scripting as a whole, obviously is no longer stopped as well):
// script~s // these scripts run~execute~activate upon a keyboard key press or (left) mouse click
}
because you can only have one 'wait' running~executing~activated, let's look at the 'order of operations' of scripting:
script1
|...\
|....\
|.....script2
|
script3
if script1 and script3 are 'waits' (at the same 'nested'~indenting~column~horizontal layer~level~placement), then you got an error, as the script1 'wait' is considered 'finished' running~activating~executing upon its displayment of 'continue' by script3, even though the script1 'wait' is not fully finished as it is awaiting for that keyboard key press or left mouse click (ie in 'suspended-waiting for input' mode), thus script3 'wait' begins too, and thus the error.
also, if you got any other script (non-input script) for script 1, and your script2 and script3 are 'waits', then they're activating~executing~running at the same time, and thus an error.
and it gets even more messy~convoluted~complicated~complex as it becomes bigger (more same branching as fractal sub-branching):
script1
|...\
|....\
|.....script2
|.......|...\
|.......|....script3
|.......|
|.......script4
|
script5
|...\
|....\
|.....script6
|.......|...\
|.......|....script7
|.......|
|.......script8
|
script9
and further messy with looping and~or jumping around, and~or multple functions~scripts calls (especially functions that return values) ....
-----------
the simplest structure of scripting is this:
script1
-> script2
->-> script3
->->-> script4
->->->-> script5
as it is a straight line of consecutive and non-interfering operations:
\
.\
..\
...\
....\
.....\
as each operation (script~scripting), is at its own 'nesting' (indenting) level~layer
and thus you'll have no errors with using multiple 'waits~get inputs~show menus~etc', as can be seen:
(the 'msgs' are at the same nesting~indenting layers, but its the 'waits~get inputs~show menus' which matter in terms of having them at the different nesting~indenting layers~levels, as it is they that can't be running the same time as another 'wait~get input~show menu', but msgs and other non-input scripts can do so with mostly no problems)
msg ("0")
wait {
msg ("1")
wait {
msg ("2")
wait {
msg ("3")
wait {
msg ("4")
}
}
}
}
or get input:
msg ("0")
get input {
x1 = result
msg ("1")
get input {
x2 = result
msg ("2")
get input {
x3 = result
msg ("3")
get input {
x4 = result
msg ("4")
}
}
}
}
or 'show menus' :
msg ("0")
show menu (xxx) {
x1 = result
msg ("1")
show menu (xxx) {
x2 = result
msg ("2")
show menu (xxx) {
x3 = result
msg ("3")
show menu (xxx) {
x4 = result
msg ("4")
}
}
}
}
----------------------
if any good coders want to try to explain the rules and order of operations with scripting, I'd be so appreciative! I think Jay tried to do so for me in the past, but obviously I haven't been able to understand very well (and~or forgotten) about all the rules and order of operations with scripting, sighs.