Forum rules - please read before posting.

Confused about the Manipulating Variables Tutorial

So, I am following this tutorial below, and am a little confused.

https://adventurecreator.org/tutorials/manipulating-variables-through-script


Do we replace the "_id" with the ID number? Or do we keep it, and add the ID at the end?

For example would be....

AC.GlobalVariables.GetBooleanValue (int 0);

or

AC.GlobalVariables.GetBooleanValue (int _0);

or

AC.GlobalVariables.GetBooleanValue (int _id 0);


Or do we not manipulate that line at all and add a new one below?

Do I need to add anything at the top of the script for the variables to work. Example "using AC"?

If anyone has an example of how one of these variables look in a script, that would also be helpful!

Thanks, everyone!

Comments

  • Please note that the tutorials are not intended as an introduction to scripting itself - just how to use scripting principles with AC.

    Yes - "_id" is the expected integer.  If you were getting the Boolean variable with an ID of 2, the code would be:

    AC.GlobalVariables.GetBooleanValue (2);

    AC uses the "AC" namespace, but the line above implies it.  You can do without "using AC;" at the top, but writing it then means you can write the code as:

    GlobalVariables.GetBooleanValue (2);
  • Ah gotcha! For some reason I thought you had to leave the "int" part.

    Thank you!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.