Page 1 of 1

Incrementing a Variable by script

Posted: Wed Jan 18, 2023 8:49 am
by JamesTFreaknKirk
Hello!

I was wondering what was the best way to increment a variable by C# script? And how do I reference the variable in that script?

say the variable is Fish.NumberCaught

Re: Incrementing a Variable by script

Posted: Wed Jan 18, 2023 9:22 am
by Tony Li
Hi,

Use the DialogueLua class. Example:

Code: Select all

DialogueLua.SetVariable("Fish.NumberCaught", DialogueLua.GetVariable("Fish.NumberCaught") + 1);