Page 1 of 1

Number variables and Boolean

Posted: Wed Apr 09, 2025 4:19 pm
by Mastodon
Hello! I'm curious on how I would set a Boolean from to true or false based on a number value. Basically, keeping score. For example, if

Variable["Points"] = Variable["Points"] + 5

If the player does not meet the required X number of points, then they do not pass and cannot move on.

Re: Number variables and Boolean

Posted: Wed Apr 09, 2025 4:39 pm
by Tony Li
Hi,

If you want to do this in Lua (e.g., in a single dialogue entry Script field), you could use:

Code: Select all

Variable["Points"] = Variable["Points"] + 5
Variable["MyBoolean"] = Variable["Points"] >= 20
This will increment the Points variable by 5. Then it will set MyBoolean to true if Points is 20 or higher, otherwise false.

Alternatively, you could increment the Points variable (Variable["Points"] = Variable["Points"] + 5) and in another node's Conditions field check if Variable["Points"] >= 20.