Announcements, support questions, and discussion for the Dialogue System.
hrohibil
Posts: 369 Joined: Thu Nov 04, 2021 12:50 pm
Post
by hrohibil » Tue Jul 09, 2024 1:16 pm
Hello Tony
I have a public bool called radioFound which starts out as false.
Then after it becomes TRUE, I want to use Lua to check in the node tree that if this condition is true then start this node, but it never evaluates to true..
In the node Condition box I use this to check " setHasRadio = true"
Code: Select all
public bool radioFound = false;
private void Awake()
{
Lua.RegisterFunction(nameof(setHasRadio), this, SymbolExtensions.GetMethodInfo(() => setHasRadio()));
}
bool setHasRadio() { return radioFound; }
Tony Li
Posts: 22093 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Tue Jul 09, 2024 1:56 pm
Hi,
In the Conditions box, use:
or just:
If that doesn't work, are you sure radioFound is true? Since it's a serialized public variable, you can watch its value in the inspector.
Are there any errors or warnings in the Console window?
You can test the variable by entering this at the bottom of the Dialogue Editor's Watches tab and clicking Run:
hrohibil
Posts: 369 Joined: Thu Nov 04, 2021 12:50 pm
Post
by hrohibil » Tue Jul 09, 2024 2:26 pm
Thank you Toni it worked.
But where exactly is the " bottom of the Dialogue Editor's Watches"??
Tony Li
Posts: 22093 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Tue Jul 09, 2024 3:04 pm
While playing in the Unity editor, go to the Dialogue Editor window's
Watches tab. There's a field at the bottom of the window to enter Lua commands.
hrohibil
Posts: 369 Joined: Thu Nov 04, 2021 12:50 pm
Post
by hrohibil » Wed Jul 10, 2024 6:11 am
Thank you Toni!!!