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.
Number variables and Boolean
Re: Number variables and Boolean
Hi,
If you want to do this in Lua (e.g., in a single dialogue entry Script field), you could use:
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.
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
Alternatively, you could increment the Points variable (Variable["Points"] = Variable["Points"] + 5) and in another node's Conditions field check if Variable["Points"] >= 20.