Proper way to increment a game attributes? set game attribute doesn't work

TomSmaj

  • Posts: 9
I have a game attribute that's a number and I simply want to increment it by 1, but it doesn't seem like I'm able to set a game attribute to anything.  "set game attribute with name : ___ to ___" doesn't do anything and I'm unable to put a game attribute into the first space of the "increment number by __" block. Suggestions?


« Last Edit: October 06, 2015, 10:05:13 pm by TomSmaj »

LIBERADO

  • *
  • Posts: 2659
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

doczal

  • Posts: 44
The solution LIBERADO provided works, and is what most people use I think.

However, the block you're using should work as well. Instead of putting in the game attribute "num" inside the first empty field, try typing in "num" instead.

jsblack

  • *
  • Posts: 117
I have a game attribute that's a number and I simply want to increment it by 1, but it doesn't seem like I'm able to set a game attribute to anything.  "set game attribute with name : ___ to ___" doesn't do anything and I'm unable to put a game attribute into the first space of the "increment number by __" block. Suggestions?



That doesn't work because you are trying to tell it to find a variable with the name of the value of "num", not the name "num" itself.

TomSmaj

  • Posts: 9
The "set num to __" block wasn't there before. After making a new game attribute, I think you have to close and reopen stencyl before those set blocks become visible.

letmethink

  • *
  • Posts: 2547
What build are you using?
~Letmethink

Donni11

  • *
  • Posts: 2182
@letmethink, I think he's using a build 8670  or up , I also started having a problem with this. Its a bug in Stencyl ( see here   ) but based on this post   there are certain ways to get around the bug.
Peace

letmethink

  • *
  • Posts: 2547
Donni that is a completely unrelated issue to the one he is having.
~Letmethink

TomSmaj

  • Posts: 9
I'm using build 8678.