Checking an int during conversation
Posted: Thu Sep 29, 2022 12:49 am
Hey and thanks again for the Dialogue System, it is a truly inspiring asset.
I was hoping for some advice, if possible.
I have an int called moonCount which i have registered to Lua as a double (the script is attached to the player gameObject)
I have a simple conversation that asks the player their moon count.
I want to check the moonCount of the player and if it is less than a certain number it will say "Not Enough Moons" and if its greater or equal to that number it will say "You have enough moons". (The number would depend on the scene the player is in)
Basically i'm having trouble putting this logic into the conversation, I think I have to make a bool? But I'm struggling with the Lua part of it, any advice would be greatly appreciated!
I was hoping for some advice, if possible.
I have an int called moonCount which i have registered to Lua as a double (the script is attached to the player gameObject)
Code: Select all
public double CurrentMoonsForDialogueSystem()
{
return moonCount;
}
private void OnEnable()
{
Lua.RegisterFunction(nameof(CurrentMoonsForDialogueSystem), this, SymbolExtensions.GetMethodInfo(() => CurrentMoonsForDialogueSystem()));
}
I have a simple conversation that asks the player their moon count.
I want to check the moonCount of the player and if it is less than a certain number it will say "Not Enough Moons" and if its greater or equal to that number it will say "You have enough moons". (The number would depend on the scene the player is in)
Basically i'm having trouble putting this logic into the conversation, I think I have to make a bool? But I'm struggling with the Lua part of it, any advice would be greatly appreciated!