Page 2 of 2

Re: What's the best way to make a conditional that says, "if a day has passed since you visited this other node"?

Posted: Tue Jul 09, 2019 10:08 pm
by AoF
That fixes my issue in this case, but is there any way to check that a primitive is uninitialized?

Re: What's the best way to make a conditional that says, "if a day has passed since you visited this other node"?

Posted: Wed Jul 10, 2019 7:59 am
by Tony Li
Hi,

You can check DialogueLua.DoesVariableExist():

Code: Select all

var variableName = "day" + entry.Title;
var entryDay = DialogueLua.DoesVariableExist(variableName) ? DialogueLua.GetVariable(variableName).asInt : Int32.MaxValue;

Re: What's the best way to make a conditional that says, "if a day has passed since you visited this other node"?

Posted: Wed Jul 10, 2019 10:36 pm
by AoF
Tony Li wrote: Wed Jul 10, 2019 7:59 am Hi,

You can check DialogueLua.DoesVariableExist():

Code: Select all

var variableName = "day" + entry.Title;
var entryDay = DialogueLua.DoesVariableExist(variableName) ? DialogueLua.GetVariable(variableName).asInt : Int32.MaxValue;
Cool, thanks