Sum of Global Variables

This forum is currently in read-only mode.
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • I'm trying to add together the value of three global variables, and see if they add up to more than 0. Right now, I have this:

    System - Compare:

    Value 1: 'GMoteForest1-1' + 'GMoteForest1-2' + 'GMoteForest1-3'

    Greater Than

    Value 2: 0

    Pressing "Finish" shows the window close normally as though Construct has understood and accepted the command, yet it never shows up in the event list. The event I'm trying to insert this condition into stays blank. Usually when there's an error with the code I've inserted it won't allow me to press "Finish", and pops up with an error message when I try to press it.

    Am I doing something wrong? Is there another way to calculate and compare the sum of those three variables?

    Many thanks for reading <img src="smileys/smiley12.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • From what I see, the names of the globals are causing the problem. You need to use the global-tag:

    global('GMoteForest1-1') + global('GMoteForest1-2'), etc.

    But there might also be a problem with the naming itself. Try to abandon the dash, use something like


    Hope it helps <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Thanks! The "global" part was exactly what I needed :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)