Page 1 of 1
How to change the value of a variable?
Posted: Tue May 30, 2023 1:09 am
by swang
I want to change the value of a variable in a sequence. But it doesn't run.
![image](
https://github.com/kaYeonTan/Sort/asset ... 825dd271f0)
Re: How to change the value of a variable?
Posted: Tue May 30, 2023 8:35 am
by Tony Li
Hi,
Are there any errors or warnings in the Console window?
Alternatively, try changing the variable value in the Script field instead:
Code: Select all
Variable["CharacterProfileSprite"] = false
Re: How to change the value of a variable?
Posted: Wed May 31, 2023 7:37 am
by swang
Re: How to change the value of a variable?
Posted: Wed May 31, 2023 7:48 am
by Tony Li
Hi,
Code: Select all
db.GetVariable("CharacterProfileSprite").InitialBoolValue
will return the
initial value, not the current value. To get the current value, use:
Code: Select all
isSprite = DialogueLua.GetVariable("CharacterProfileSprite").asBool;
Re: How to change the value of a variable?
Posted: Wed May 31, 2023 8:40 pm
by swang
Thank you very much!!
Re: How to change the value of a variable?
Posted: Wed May 31, 2023 9:37 pm
by Tony Li
Glad to help!