max integer (item 999).
![powkie](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi, so I've been stuck for a while and need some support
. I have an item that can stack up to 999. The thing is i can't seem to get the integer to be max 999 and not go further. Been trying stuff like constrain attribute game.item min(0),max(999) and similar but the it get stuck at either 0 or 999.
Anyone have a nice solution for this? To get the integer to understand that 999 is max so it won't go over 999. Same for 0, that 0 is the lowest number.
Thanks in advance!
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
Anyone have a nice solution for this? To get the integer to understand that 999 is max so it won't go over 999. Same for 0, that 0 is the lowest number.
Thanks in advance!
Answers
Rule:
Actor receives event - touch - pressed
Attribute game.howmanyitems is 1 or greater then 1.
Change attribute to:
game.howmanyitems to: game.howmanyitems-1
Change attribute game.useitem to 1
New rule:
Attribute game.howmanyitems is 0
Change attribute self.color.alpha to: 0.3
Otherwise 1.
I tried to add your line in:
game.howmanyitems to: max(0,min(game.howmanyitems+1,999)) but it did not work, let me know if i did anything wrong
Thanks!