Hi Tony,
please help - I'd like to increment an INT with the sequencer but cannot figure out the right syntax.
Based on the documentation and forum I already tried:
SetVariable("mGuessCounter",GetVariable("mGuessCounter")+1);
SetVariable("mGuessCounter",GetVariable("mGuessCounter").AsInt+1);
SetVariable("mGuessCounter",[var.mGuessCounter]+1);
SetVariable("mGuessCounter",[var=mGuessCounter]+1);
SetVariable("mGuessCounter",mGuessCounter+1);
SetVariable("mGuessCounter","mGuessCounter"+1);
How can I achieve this?
Thanks, Michael
(Sidenote, the Variables View in the DSFU editor does not reflect changes during Runtime so it's a bit hard to debug whether the value is not increased properly or the syntax for checking the value is wrong; is there a reason why the Variables View is not updated during Runtime?)
Sequencer Increment Variable
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Sequencer Increment Variable
Hi, I managed to work around it with a custom Lua script that does the incrementation (via DialogueLua.GetVariable), but I think its more complicate than necessary. So if there is still a simpler way with SetVariable in Sequencer, please let me know.
Re: Sequencer Increment Variable
Hi Michael,
Or type it directly like this if you don't want to use the point-and-click dropdowns:
The Conversation Conditions Tutorial covers this in more detail.
The SetVariable() sequencer command is just a convenience for writers who are writing a sequence and want to quickly set a simple variable value. But the Conditions and Script fields are the main ways to work with DS Variables.
In general, use the Script field to increment DS variables. Click the "..." button and use the dropdowns to set up the expression. For example (screenshot taken from tutorial):michaelheiml wrote: ↑Fri Dec 10, 2021 3:57 amplease help - I'd like to increment an INT with the sequencer but cannot figure out the right syntax.
Or type it directly like this if you don't want to use the point-and-click dropdowns:
Code: Select all
Variable["mGuessCounter"] = Variable["mGuessCounter"] + 1
The SetVariable() sequencer command is just a convenience for writers who are writing a sequence and want to quickly set a simple variable value. But the Conditions and Script fields are the main ways to work with DS Variables.
The Variables section shows the Initial Value of variables. To see runtime values, use the Watches section. You can set watches on variables, quest states, and any Lua expression you want.michaelheiml wrote: ↑Fri Dec 10, 2021 3:57 am(Sidenote, the Variables View in the DSFU editor does not reflect changes during Runtime so it's a bit hard to debug whether the value is not increased properly or the syntax for checking the value is wrong; is there a reason why the Variables View is not updated during Runtime?)
-
- Posts: 46
- Joined: Thu Nov 08, 2018 5:47 am
Re: Sequencer Increment Variable
Great - works -thanks!
Re: Sequencer Increment Variable
Happy to help!