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

Announcements, support questions, and discussion for the Dialogue System.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

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

Post by AoF »

That fixes my issue in this case, but is there any way to check that a primitive is uninitialized?
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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;
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

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

Post 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
Post Reply