Hi there!
I'm loving this tool, but I want a way to be able to use conditions from the scene rather than just the Lua variables. I tried placing gameobjects that kept updating a lua variable whenever something was true, but that is very complicated. Is there a way to directly check a variable from another script?
For example, I want to check if a player has X amount of health and that is in another script called PlayerInfo.cs. How do I check its value directly from the dialogue and change conversations based on that?
Thank you
How to check for another script variable?
Re: How to check for another script variable?
Hi,
Write a method that returns the health. Example:
Then register that method with Lua so you can use it in Conditions and Script fields (and wherever else you use Lua expressions).
Write a method that returns the health. Example:
Code: Select all
public int health;
public int GetHealth() { return health; }
Re: How to check for another script variable?
Thank you! This is helpful
Re: How to check for another script variable?
Happy to help!