How do I....create an item that changes into something else after a certain amount of time?

Joined
Jul 12, 2020
Messages
192
Reaction score
41
First Language
English
Primarily Uses
RMMV
Basic premise:

The player can find an egg, and you can't do anything with the egg when it's in your inventory.
I want to make it to where, after obtaining the egg, and waiting about 10 minutes in real life, no matter what you were doing in-game, the egg hatches into a baby chick.


I'd like to think it runs off of a parallel switch in common events, and after waiting that time, the item deletes itself and adds in the baby chick.... But I'm not sure if waiting 36,000 frames (10 minutes converted) is...the best way to do that. Plus, won't changing maps reset that frame start? I could be wrong about this...


Maybe there is another way to do this?
 

Neareyn

Villager
Member
Joined
Apr 21, 2021
Messages
19
Reaction score
3
First Language
German
Primarily Uses
RMMZ
Instead of waiting 36000 frames, you can create a loop which adds up a variable after a certain time (+1 after every 60 frames) and after a certain value, it removes the egg and adds a baby chicken.
the variable won't reset after changing the map.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,699
Reaction score
2,800
First Language
English
Primarily Uses
RMMZ
Have the event where you get the egg turn on a switch and set a timer variable to 36000. Make a parallel process common event with its activation condition set to the switch you turned on, with a Change Variables command which subtracts 1 from the timer variable. Then have a conditional branch checking for the variable value being 0, and inside that branch remove the egg, add the baby chicken, and turn the switch off so that the event will stop running.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
680
Reaction score
320
First Language
PT-BR
Primarily Uses
RM2k3
The ideal would be to do it with a variable:
Code:
◆If:Party has #0001 Egg
  ◆Wait:60 frames
  ◆Control Variables:#0001 Egg CountTime += 1
  ◆If:#0001 CountTime ≥ 600
    ◆Change Items:#0002 Bird + 1
    ◆Change Items:#0001 Egg - 1
    ◆
  :End
  ◆
:Else
  ◆Control Variables:#0001 CountTime = 0
  ◆
:End

60 seconds -> 1 minute
60*10 = 600 seconds -> 10 minutes

Edited:
@PoptartPresident works with only one item at a time.
If you have two "eggs" in your inventory at the same time you may have a problem.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

SA51K_SHADER_IDLE.gifZombie is not the only thing people turned into in this town. There is also something else here. Something has many different names in history, the plague, the black oil, the purity, the filth. And now, it's called the shade.
(Maybe too much X-File reference. :kaojoy:)
Thanks, google for putting together a random pixel art Olympics game in your logo that puts everything I've ever done to shame in pretty much every aspect. ;)
Chizuru
chizuru.png


anyway, i just recovered from Covid.
Work's been delayed for a month but now i'm back drawing again.
Ah yes i learned how to make name boxes Im now profeshonal
The snowy mountains in my game are finally done... what a crazy journey.

Forum statistics

Threads
113,610
Messages
1,076,211
Members
147,618
Latest member
Ohzaru
Top