Incrementing a Variable by script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
JamesTFreaknKirk
Posts: 13
Joined: Mon Jan 16, 2023 9:44 am

Incrementing a Variable by script

Post 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
User avatar
Tony Li
Posts: 22137
Joined: Thu Jul 18, 2013 1:27 pm

Re: Incrementing a Variable by script

Post by Tony Li »

Hi,

Use the DialogueLua class. Example:

Code: Select all

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