Variable Reading as 'nil'
Variable Reading as 'nil'
I'm trying to have a variable that decrements by one when a player clicks on certain objects. However, the triggers weren't working so I put a print statement in the Lua code, and apparently it's being read as 'nil' even though I put an initial value in the Dialogue System. Any help would be appreciated!
Re: Variable Reading as 'nil'
Thank you! I'm still new to Lua, sorry.
Re: Variable Reading as 'nil'
No problem! Your original code was perfectly valid Lua. It's just that the Dialogue System stores all of its dialogue database variables in a Lua array named Variable[]. So to access a dialogue database variable, you need to specify the Variable[] array.
Re: Variable Reading as 'nil'
That makes sense. I'll have to remember that for the future.