Fix my ducking upgrade system


When I buy upgrade 1, both 2 and 3 are unlocked when only 2 should be, and it’s PISSING me off.
How the duck fix this?

Most likely, your events are doing exactly what they “should be” doing, and you just constructed them in a way that leads to this result.

Need to see your events to determine the issue

What @magicsofa said - there will be a flaw in your logic. We can help if you provide a screen snip of the events.


The objects have variables that are the following:
ID - The Upgrade’s ID
Got - When you bought or own that upgrade
Need - That upgrade be locked until the needed upgrade is bought
Target
↳ Change_to - Change the target’s number
↳ Location - Target a Global Variable to change
Money - How many that upgrade costs
Item_number - The item’s name from the inventory
Item_name - What kind of item is needed to buy the upgrade


When I pause, it updates the upgrade list based on the stored array.


Shows the upgrade’s info.
“Info” stores the texts.


Change the object’s looks.


Buy the upgrade.

This doesn’t make sense - item name suggests it’s text, but it’s defined as a number.


No, this iterates over each Upgrade_icon object. It’s only updates it based on the array and should do this only once at the very start of the scene.

btw, this is poor coding - the upgrade icons are iterated over every game frame, but nothing done to them. You should have an event with the “Beginning of scene” as the condition, and as a subevent have the “Repeat for each Upgrade_icon” event.


But those things won’t resolve your issue.

I assume that when you buy an upgrade, all the upgrade icons change to the “got” animation? If this is so, it’d suggest that the Got variable of each Upgrade_icon object is set to true.

How do you create each Upgrade_icon, and where do you set its ID?

My bad.
Item_number - The number of items needed to buy the upgrade

The 4 animations of the Upgrade_icon are…
Locked - when you don’t have the required upgrade to unlock that upgrade
Not - unlocked, but you don’t have the price to buy it
Can - you can buy the upgrade
Got - you already bought the upgrade

ID is for the upgrade’s ID

When I buy a upgrade (1) that is linked to an another upgrade (2), it’s linked upgrade (3) is also being unlocked when it shouldn’t.

There is no single proper upgrade system I can use, so I have to build my own.