Construct 2 version 242 global variables

0 favourites
  • 7 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hi

    I am using Construct 2 version 242 (beta) and when I have created global number variables , it appears to be setting these as static is this normal because I do not seem to be able to increment these variables now.

    When I look inside of the capx file and then view the event sheet xml , they are set as static="0" but when I look at their settings within the event sheet and double click on one of them, the static box is ticked.

  • It is normal for a global variable to be static by default.

    Static means that the value it contains is stored and stays the same between an execution tick to another (which is what you do want from a global variable, for the value it contains to be stored and not reset each tick).

    What prevents from modifying the value is the fact that the variable is Constant (its value cannot be modified at runtime).

  • It is normal for a global variable to be static by default.

    Static means that the value it contains is stored and stays the same between an execution tick to another (which is what you do want from a global variable, for the value it contains to be stored and not reset each tick).

    What prevents from modifying the value is the fact that the variable is Constant (its value cannot be modified at runtime).

    Hi Kyatric

    Thanks for your reply, I had looked at what it was set to but it is not constant so I am really perplexed to why it will not increment in value

  • Show a screenshot or a capx. Is the event that increments the variable running? Could you have another similarly named variable that you're accidentally incrementing instead?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Got this worked out, it seems that either using the touch or mouse click event on a button object for some reason is not working, however adding a sprite and clicking on that does action the commands that I need it to do .

    I am sure I have used the button object before with similar set ups and not had the problem

  • The button object has its own "on clicked" condition. Maybe that's what you used before?

  • The button object has its own "on clicked" condition. Maybe that's what you used before?

    Yes you are right and again egg on face , this is what happens when the brain is tired

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