how to upgrade once at a time
I've got a table full of upgrades in a game with 4 columns:
Price Gold (integer) , Price Food (integer) , Price Wood (integer) and Unlocked (boolean).
In the actor controlling the upgrades I have a self attribute of 'current level' which goes up by one each time the next tier is unlocked. I'm pulling all the info from the tables and then changing it when the player has greater than or equal to the price in each currency, taking away the cost from the amount the player has.
The problem I'm having is that when the player has more than enough in each currency to buy, say 3 consecutive upgrades, with one press it will upgrade it to the highest level affordable, which is annoying because it completely drains the currencies and doesn't allow the player to spread the upgrades between different things.
Any ideas of how to limit it to one tier upgrade per tap?
Thanks in advance
Comments
Can you show your rule for this?
If you use something like this, it should work fine even with tableCellValues:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ok, here they are. I have the same rule for each lvl (for lvl 2, for lvl 3 etc.)
For some reason I'm not seeing your images.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah I don't think those pics uploaded properly... Weird, will try again
this should work
rule for lvl 3 etc is the same except for the self.Current level being greater and the table values being different
So you're not using a When Touch is Pressed rule? Do players have to click/tap or do you want upgrades to happen automatically (which seems to be the problem you described)?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
No I have got a when touch pressed. All the conditions are for the same rule. When touch is pressed is the second condition down
so when all
self.current lvl = 1
touch is pressed
gold = price required
bread = price required
wood = price required
then change the attributes
Is there also a Touch is Pressed condition in the second rule you posted?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
it's all one rule, I posted it in 3 pics because not all the conditions would fit in a single shot
Oh, sorry, I misunderstood. I think the reason that the rule is firing more than once is because you're increasing the level... I'm guessing you also have a separate rule for when game.Current lvl is 2? You might try changing it to When Touch is Released to see if that makes a difference.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
thats okay haha. Hmm yeah I think that might be what it is. Yes I do. Tried changing to when released but no difference
I´m also on basicly the same problem, have you figgured out how to fix it yet?
@Zenithax @kikkan I think this will help. The trick is to use the Otherwise section. Let me know if you have any questions.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks Tatiang I appreciate it