Forum rules - please read before posting.

How to add together Global Variable Integer’s?

How to add together the value of multiple Global Variable Integer’s to create one overall Integer value?

I have various globals, counting and storing Integer’s values – and I have a new global to be used as a total checker… But how do I add up them into one value?

I feel like I should be doing something like ...

Action - Variable Set (my Total global) to 0...
... then ...
Action - Variable Set (my Total global) Increase By Value (from global A)
... followed by ...
Action - Variable Set (my Total global) Increase By Value (from global B).
... then I can check my total > 100 etc

But there isn’t an option to do something like that and I can't work out how to do it.

Comments

  • When dealing with Integer and Float variables, the Variable: Set Action's Method can be set to Formula, which lets you enter in an equation to calculate the new value, i.e.:

    2 + 3
    

    However, this box also supports the use of variable tokens, which you can insert to make use of other variable values at runtime:

    [var:4] + [var:5]
    

    A variable's replacement token can be found in its list of properties.

    Variables can also be updated through script - see the Manual's "Variable scripting" chapter details.

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.