Changing 99 of normal item into 1 golden item

Joined
Aug 8, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Throughout my game, the player has a chance to find 99 Keys. By doing so they are able to unlock a "bonus room" that will basically be an in-depth credit scene (instead of scrolling text it's a room where they can interact with all the assets and read who made them). My goal is to automatically change the 99 Keys into a Golden Key once the player is transferred into a room after beating the final boss. I'm having trouble making this work.
I'm using a control variable for it to check for the 99 Keys and a conditional branch if the player doesn't have it. The event is giving me the Golden Key regardless if I have the 99 Keys or none.
Maybe I'm just not understanding how variables work? Or is there an easier way to do this?

This is how my event is currently set up:

Test.png
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,327
Reaction score
8,521
First Language
English
Primarily Uses
RMMV
You are setting the variable to 99, so it will always work. What you want to do is each time you find a key, have the variable add 1. In this event you should not be setting the variable.

For testing purpose, you can set the variable to a random value, I'd do probably 97-99, so it sometimes has a chance of working.
 

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
89
Reaction score
32
First Language
Portuguese
Primarily Uses
RMMV
I would do it differently, but it's harder for testing purposes, I guess. You can make it in a way the variable will store the amount of an item you have. I'd do this and then check if it's = 99. (I used Beer and Map because that's what I had lol)

1599519938237.png
 
Joined
Aug 8, 2019
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
This is my first game so I didn't even know that was an option.
It fixed my problem. Thank you so much!
 

Triangle45

Veteran
Veteran
Joined
Aug 26, 2020
Messages
86
Reaction score
24
First Language
Spanish
Primarily Uses
RMMV
I found your problem.
I ran it on my RPG Maker and it worked perfectly. Check this out.
Cat gives me 97 Regular Keys
my inventory has 97 keys now No GoldKey
Mr Dog gives me 1 Regular Key
my inventory has 98 keys now No GoldKey
Mr Dog gives me another Regular Key
my inventory has now 1 GoldKey, no Regular keys.
Mr Chicken is the control parallel process, it should be invisible but I just left it there to see how it behaves. The moment 99 keys are substracted and 1 goldkey is given to me, The Chicken transforms into the Dark Knight to show me that I have successfully broken the conditional loop into an empty event.

You were forgetting to substract from the variable -99 keys so it stops activating the conditional. Substracting 99 keys is not enough, you must also substract 99 from the "keys" variable and set the self switch of the parallel process inside the conditional
 

Attachments

Triangle45

Veteran
Veteran
Joined
Aug 26, 2020
Messages
86
Reaction score
24
First Language
Spanish
Primarily Uses
RMMV
And here it is in action:


Please notice how Mr Chicken becomes a DarkKnight the moment MrDog gives me the final key and thus me obtaining the golden key and the conditional loop breaking forever
Hope I could help a little
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:
Microsoft: Hey, let's waste money advertising the Xbox Series X when nobody has any in stock, we don't seem to be making more, we aren't taking preorders and you can't get on a waiting list. BEST. IDEA. EVER.
So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.

Forum statistics

Threads
105,633
Messages
1,015,133
Members
137,292
Latest member
inkdrips
Top