Lua and C#
Posted: Mon Sep 30, 2024 8:49 pm
Hey,
I'm trying setup a dialogue tree that checks an external C# class.
For example the players choice executes code. I want to check if the player has an item in my c# class but communicate this to the dialogue system's current conversation.
What would the syntax be for checking a c# class? I haven't used Lua before so I'm trying to understand the specifics.
The "Yes" branch would perform a check. Ex, my class is called "DialogueItems" and a func called "Check Items" returns a bool value. How would you reference my Instance of a class and access that function to get the boolean value or any other primitive data types (int/float/etc)?
Then how would the condition be written to branch between true/false? I just have "Variable["HasItem"] == true" and "Variable["HasItem"] == false" as the two conditions for branching.
I'm trying setup a dialogue tree that checks an external C# class.
For example the players choice executes code. I want to check if the player has an item in my c# class but communicate this to the dialogue system's current conversation.
What would the syntax be for checking a c# class? I haven't used Lua before so I'm trying to understand the specifics.
The "Yes" branch would perform a check. Ex, my class is called "DialogueItems" and a func called "Check Items" returns a bool value. How would you reference my Instance of a class and access that function to get the boolean value or any other primitive data types (int/float/etc)?
Then how would the condition be written to branch between true/false? I just have "Variable["HasItem"] == true" and "Variable["HasItem"] == false" as the two conditions for branching.