Eventing Trouble

I'm having some trouble sorting out how to event the following situation in a way that works.


The player has the ability to equip different accessories that adds special skills. When these skills are used a common event is ran which adds +1 to a variable for that item. When that item reaches a certain number of uses it is forced unequipped, removed from game-play, and replaced with a broken version. These broken versions can be taken to a shop where they have a 1/4 chance of creating 1/4 different accessories in that class. However, you cannot EVER have more than 1 of the same accessory. Only 1 of each is allowed.


Currently I am trying to setup the shop where you can have the broken accessory turned into a working one, but no matter what I do the eventing is just become more and more confusing to follow.


Example:


Accessory: Red Ring


Red Ring adds skill Red Pulse to the player. 


Red Pulse is used. Red Ring Variable +1


When Red Ring Variable =10, Red Ring is removed from game-play and replaced with Red Stone


Red Stone, when taken to a shop, has a 1/4 chance of becoming any of the following: Red Ring, Red Necklace, Red Broach, Red Tiara.


Only 1 of each (Red Ring/Neck/etc) can exist at a time, both between the players inventory and the players equipped items. So if a Red Ring exist in the inventory or equipped, they CANNOT receive a Red Ring from the Red Stone's 1/4 chance. How would I go about making it so that if the player owns it, they cannot receive it again, but still keep the randomness of the other items? And when the player has, say 3/4 Red items and they use the Red Stone, how can I make sure they only receive the Red items they don't already have? Adding into that, if the player was to open a chest that contained a Red Ring, but they already owned a Red Ring, how would I event it so they only received the Red item they didn't already own, and if they owned all 4 they receive something else?
you'll have to check and reroll each case, which means either loops or labels to go back to the start.


1) roll randomness


2) check if the result is in inventory with conditional branch


2a yes, go to 1 and reroll


2b no, continue


WARNING: Doing it this way can result in an eternal loop (game freeze) if the player already has all 4 options - if that is a possibility, then you need to check how many red items the player has on 0) before entering the loop and abort it.


For more help, please post screenshots of what you have done so far.
I've never used a loop before, I'm not really sure how to set one up.
then use a label, those are easier and are enough for this case.


Place a label command at the beginning (before the control variable for random number) and place a go to label command in all conditional branches where the item is found.


Make sure that the name of the label is spelled identical everywhere.


If that doesn't help, look for some advanced eventing tutorials on labels - you can't do this without labels or loops
I guess I'll try reading up on some tutorials then for loops and labels.


I've never used either one of them, and until you mentioned it had actually forgot they existed.
It should be possible to make the obtention of any Item, whether by Repair or Chest or whatever, dependant on a Switch such as 'Already has Red Ring'. Only if the Switch is 'Off' would the Red Ring be offered; the acceptance of the Red Ring would turn the Switch to On, otherwise a message such as 'No space for another Red Ring.' Once the Red Ring is used up and replaced with the Worn-out Red Ring, the 'Already has Red Ring' Switch would be set to Off again. I use a similar system for consumable Items, such as a Pickaxe, which becomes a Broken Pickaxe when too many strokes have been used, or a Key, which becomes a Bent Key after a certain number of Chests have been opened. The Weapon Shop, or a Handiman, are needed for the repair, in exchange for a certain sum and some minerals.


Hope this helps.

Original thread: https://forums.rpgmakerweb.com/threads/eventing-trouble.66778/