Forum rules - please read before posting.

Better way to check multiple variables at once?

Sometimes I want to check multiple variables at once:  If X = true AND Y = true, but Z= false THEN Execute.

But the only way I can see to do this is by chaining multiple nodes on an action list, which can become especially cumbersome.

Is there a better way to do this?

Comments

  • You could write a custom Action that checks for multiple variables at once - the code to read variable values is given on the front page of the scripting guide.

    Outside of resorting to scripting you can also place the Actions in a parameterised ActionList asset.  Parameters are covered in this tutorial.

    If you want to check for the same variables each time, but vary the outcome (i.e. run a Cutscene), you could create a new ActionList asset with a single GameObject parameter (named e.g. "Cutscene to run").  Then after the three Variable: Set Actions, have them run a new ActionList: Run Action that runs "Cutscene to run" if they all pass.  You can then run this asset file (using another ActionList: Run) and set the Cutscene you want to run if successful each time.

    If you wanted to check for different variables each time, you could even parameterise the variables themselves by creating three Global Variable parameters.
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.