Using string variables or booleans

So, I have set up several paths for my MC to follow.
However, now, I want to set up some variables to keep track of who the MC has met, currently.
Could I do something like:

*create met ""

If so, would I have to put all subsaquint mentions of the variable in “” as well?
So, something like:

*set met "${M_name}"

Also, when doing a *if tag, would I do something like:

 *if met "${M_name}
  goto label X

Would that work?

If you do it like that, you’re going to lose track once your MC meets another character and you set it to something different.

I would suggest using boolean variables (true/false) to track those characters, like;

*create met_m false

And when MC meets those character, you could set it true;

*set met_m true

So, you could put that *if statement like this;

*if (met_m)
  *goto label_x

That’s just my two cents.

3 Likes

I agree with @moonfungus about using true/false so it remembers all the characters met.

Regarding *if, you need to have an operator (=, !=, etc.) after the *if and first variable for string and numeric variables so it knows what to check/compare (*if met = “${M_name}”, for example).

2 Likes

More elaboration to Aronjo’s:

Say, you have multiple characters named T, M, and R. For every of them, create a boolean (a true/false flip switch) variable:

*create met_T false
*create met_M false
*create met_R false

And then, flip each of the switches to true when your characters meet them.

*set met_M true

As such, you would need to write each path for each character, depending on your branching.

*if met_M
   *goto abc
*if met_T
   *goto cba
*if met_R
  *goto somewhere
1 Like

Question resolved!