Hello, I have a clock that is running in my game that I would like to keep track of in the PixleCrushers Variables tab. The way it works is it's basically a float. So 0.5 would just be half a day. So basically if the clock counter is 0.5, I would like my PixleCrushers var to update along side that. I'll have events happen at specific times so communicating with my Var database will be important.
So...I guess how do I get access to my vars from my script?
Updating PixleCrusher Vars threw C# script
Re: Updating PixleCrusher Vars threw C# script
Hi,
Use the DialogueLua class, in particular DialogueLua.GetVariable() and DialogueLua.SetVariable():
Use the DialogueLua class, in particular DialogueLua.GetVariable() and DialogueLua.SetVariable():
Code: Select all
float clock;
...
// Example: Advance by half a day:
float currentTimeOfDay = DialogueLua.GetVariable("Clock").asFloat;
DialogueLua.SetVariable("Clock", currentTimeOfDay + 0.5f);
Re: Updating PixleCrusher Vars threw C# script
Sweet. I'll give it a go thanks!