Need assistance with a SHOP in my game

hello , theres been a request for an upgrade menue and usage for the xp collected in the game.

i have an upgrade menu that spawns the upgrades when opened and i want it to detect how much xp the player has and if he has enough then he is able to purchase the upgrade. the upgrades cost

50 xp

100 xp

150 xp

but i have been trying for almost a week now with different stratagies and i am stumped ! its really holding me back and i thought i had it but when i purchase 100xp worth and get 35 0r -25 for example as my outcome it still lets me purchase a 50 xp upgrade which doesnt make sense , can someone help ? maybe a screenshot or something. i have tried using others examples ive found on the games page but i have trouble fitting it into my game

3 Likes

Where is the shop in the game?

As well, here is my shop example if it helps:
Flowlab Game Creator - Shop example

4 Likes

the shop is in the UI , click the shield on the left side of inventory display at the top of the screen and it will open up. when opened it will spawn 3 upgrade selections with red circles

i tried to use yours a couple times but i think i was doing it wrong.

Set the save to 1 for obtaining the powerups only after purchasing them, as well I suggest using a save for your currency/XP. Use an Always with the XP save to always have the updated currency when purchasing.

Its looks to me your confusing the on what the buttons do and what the player does.
I either suggest subtracting your XP after purchasing in the player or in the button.

yea i have a save Always readiing in the power ups and it does only save when purchased , the problem was for example if i have 120 xp and i puchase a 100 power up it equals 20 right, but it still let me purchase a 50 xp the math isnt right and i tried using an on and off and with a filter but when it detected that i didnt have enough it shut the 50 off but the xp still filtered through letting me spend -50 which didnt make sense

i deleted the filters and switches as well as the messages for a clean slate idk if you saw it was pretty blank cuase i was frustrated lol i use a test lvl for this with a rset so it mimics the first lvl of the game

1 Like

or are you saying dont use the " save 1 " in the player nehavior only use in the power up them selves , when purchased i do want it to save and not be used again

2 Likes

I wasn’t sure if the upgrades were re-purchasable or one time.
But if thats the case, you need a filter to use a powerup if you own > 0.
And as well to stop purchasing more if >19.

One thing is that its important to get the math correct with making a currency system (or XP system for this) so you can update the currency after the purchase.

From what I see the Buttons are only triggers, and the player handles the puchase. As well you sending several messages to the player when you could indicate the single message, try to just use “Buy Evade” to the player.

Let me try to show an example:

Its best if you download the image…
Let me know if it purchases several times for some reason,
If that happens, we can use a switch to be used like a once for the purchase action.

3 Likes

i noticed a -19 in the filter up top which let the player purchase it too early starting with zero xp, evade cost 100 xp and it does let me purchase it more than once

when purchased it doesnt let the player use it i guess it isnt sending the data after

i put SHOW XP in the evade upgrade its self too , id like ‘evade’ and ‘slash & dash’ to be one time purchases and locked after

1 Like

If you notice, the purchase doesnt pass the “greater than -1” filter to update the xp.
So something else is updating the XP to be in the negatives.

But also because its not passing the filter its not giving the player the powerup.
You need to find where else is updating the xp (I think its that -100 message that I said you dont need).

Also I would put the purchase sound affect after that filter in the player as well.

1 Like

ohhhhh yea probably because its saving it as -100 when sent probably, alright ill work on it and ill update you how it goes, thanks !

2 Likes

(I see you swapped the filters, I dont recommend that because that > -1 is allowing purchases if the purchase doesnt result your xp to be in the negatives)

On another note, I want to re-suggest on how to show/hide the buttons:

As well, I updated the player for this too:

PS: Check the bottom filter to add the fail output to the switches (I forgot),

and change the filter in the button that unlocks the switch to buy to be > 99.

1 Like