Sequential, successive Scripts?
Vollkrasser
04 Feb 2015, 17:18Hi,
is there a (simple) way to create sequential Scripts, so the 2nd script is triggered only when the 1st script has finished?
My problem especially for sequences of events in a row (for example several textblocks with, several wait inputs...) is, that Quest processes all the scripts simultaneous. So a "block" or "list" of scripts in the UI is not processed like a computer program with one command/line after the other, rather all commands are begun at the same time.
This is fine for some tasks, but bad for others.
I also have found no way in the UI to add another "block" of scripts that follows the previous, meaning that is only started when the previous block of scripts is done.
Is there a way to tell Quest to process Script one and "add successive script(s)" after it?
Or can it maybe be done with any syntax/logic like...
---
StartScriptA
(here parallel script commands as usual "aaa")
EndScriptA
StartScriptB
(here parallel script commands as usual "bbb")
EndScriptB
---
So the result would be that Quest processes first "aaa" in Step 1 and afterwards processes "bbb".
is there a (simple) way to create sequential Scripts, so the 2nd script is triggered only when the 1st script has finished?
My problem especially for sequences of events in a row (for example several textblocks with, several wait inputs...) is, that Quest processes all the scripts simultaneous. So a "block" or "list" of scripts in the UI is not processed like a computer program with one command/line after the other, rather all commands are begun at the same time.
This is fine for some tasks, but bad for others.
I also have found no way in the UI to add another "block" of scripts that follows the previous, meaning that is only started when the previous block of scripts is done.
Is there a way to tell Quest to process Script one and "add successive script(s)" after it?
Or can it maybe be done with any syntax/logic like...
---
StartScriptA
(here parallel script commands as usual "aaa")
EndScriptA
StartScriptB
(here parallel script commands as usual "bbb")
EndScriptB
---
So the result would be that Quest processes first "aaa" in Step 1 and afterwards processes "bbb".
Silver
04 Feb 2015, 17:21If I understand what you're saying (and this solution might not work for what you want) when I have a few scripts that I want to separate out I create rooms for those scripts to operate in. I can then add either a timer or a command that simply moves the player object to the next room to trigger the next script.
Silver
04 Feb 2015, 17:29You can make Quest behave more like Twine by using rooms accessed only by scripts and commands. These aren't rooms accessible in any other way. They're just objects for running scripts in.
Silver
04 Feb 2015, 17:43And I don't bother with the press any key script. I just set up a command that will check where the player is (hence making it useless elsewhere) and tell the command to move the player object somewhere. Then display it with the text processor. So I disable the parser with:
If I recall correctly then put my own next button in with the text processor reflecting the command I set up:
request (Hide, "Command")If I recall correctly then put my own next button in with the text processor reflecting the command I set up:
{command:whatever:click next to continue}HegemonKhan
04 Feb 2015, 18:30use (add) Functions:
(see this thread too: viewtopic.php?f=10&t=5018&p=34407#p34401 )
a Function holds scripts: think of a Function as a basket~grouping (or if you're familiar with some basic programming: Functions = Batches = Macros), which can hold just a single script or many scripts.
Also, another great benefit of using Functions, you can loop them (individual Functions) on themselves, while also continuing your chain of scripting too:
(in code, sorry, but it's fast~easy for me to do it this way, lol)
In the GUI~Editor: Add Function and to 'goto' different Functions, you add in the 'call function ~ call upon function' Script, and just type in the Function's name into the text box, that you want to goto, you can ignore adding in parameters, as this is a bit more advanced, unless you already understand their usage, then go ahead and do so as you might need to.
unfortunately, I am still a bit confused about the 'order of operations' with scripting, so the way that works best is this:
Function1
on ready { // you'll have to code this in, as I'm not sure if and or where it is in the GUI~Editor
-> Function2
-> on ready {
->-> Function3
->-> on ready {
->->-> Function4
->-> }
-> }
}
unfortunately, if you got script layers within the Functions, it's more difficult to get it to work:
Function1A
-> Script1A
-> wait { // or 'get input' or 'show menu'
->-> Script2A
->-> wait {
->->-> Script3A
->-> }
-> }
on ready {
-> Function2B
->-> Script1B
->-> wait {
->->-> Script2B
->-> }
}
// ERROR
// you're going to have multiple scripts and the 'wait' Scripts running at the same time, which they can't do... thus the ERROR.
thus, the best way is again (still not easy to get it to be set up like this... sighs):
Function1A
-> Script1A
-> wait { // or 'get input' or 'show menu'
->-> Script2A
->-> wait {
->->-> Script3A
->->-> on ready {
->->->-> Function2B
->->->->-> Script1B
->->->->-> wait {
->->->->->-> Script2B
->->->->-> }
->->-> }
->-> }
-> }
in code:
(this will, err I hope should lol, work)
(see this thread too: viewtopic.php?f=10&t=5018&p=34407#p34401 )
a Function holds scripts: think of a Function as a basket~grouping (or if you're familiar with some basic programming: Functions = Batches = Macros), which can hold just a single script or many scripts.
Also, another great benefit of using Functions, you can loop them (individual Functions) on themselves, while also continuing your chain of scripting too:
(in code, sorry, but it's fast~easy for me to do it this way, lol)
<function name="character_creation_function">
age_function
</function>
<function name="age_function"><
Silver
05 Feb 2015, 20:42My first room has taught me pretty much all I need to know about Quest for my needs. I've still got to implement the CSS so there isn't resolution problems and I'm doing ultra polish, which is what unearthed the container bug I think I found. If I can't reproduce it in a demo game then it's something I've done so back to the manual then polish again.
jaynabonne
05 Feb 2015, 21:15I had meant to say, from what I saw, your game looked amazing.
Silver
05 Feb 2015, 21:40Aw, cheers man. It's still in the experimental stage ... I'm not confident enough yet to rip through the plot but it is sort of story boarded in my head. 