Tips & Tricks: Reoccuring event
Sir Legna's Plugin Generator » Devlog
Let's say you want the player to gain 1 gold every 10 seconds of gameplay, an extra prize for every 10th win of a battle, or simply a revamp of the random encounters with your own twist like maybe random encounter shops instead of battles.
Well, here how you can do that. I will show the example with 1 gold every 10 seconds of gameplay and explain the other methods. But do get creative. :)
- You are going to need the Delay Switches and Variable Plugin.
- On the map you want to start the loop on, you will need an initializing event. Like this crystal here.
◆Plugin Command:sirL_MP_All_Plugins, Set Switch Delay
:Plugin Command:Type of Delay = 5 :Plugin Command:Delay Amount = 10 :Plugin Command:Switch = 1 :Plugin Command:Operation = true
◆Erase Event
This example is using 10 Play Time Seconds to flip switch 1 to true. However, you can use Battle Count, Win Count, Escape Count, Save Count, Frame Count, Play Time Seconds, or Steps.
- Now you create the common event.
◆Control Switches:#0001 Every 10 seconds = OFF
◆Text:None, None, Window, Bottom :Text:You have earned 1 gold piece due to just existing\.\^
◆Change Gold:+ 1
◆Plugin Command:sirL_MP_All_Plugins, Set Switch Delay :Plugin Command:Type of Delay = 5 :Plugin Command:Delay Amount = 10 :Plugin Command:Switch = 1 :Plugin Command:Operation = true
As you can see the common event is on Parallel (this is to make it run faster than autorun as parallel don't need to wait for the next available time to run). But unlike just making an On switch do this, we are using the delay switch we made in the initial event. So by default, it will be off until the first 10 seconds hit, then it will be on. The first line turns off that switch so that there is no chance on multiple calls. Then the middle is rewarding the player with one 1 gold piece for existing for 10 seconds.
- But the real magic is at the end, by flipping that switch to true again after another 10 Play Time Seconds. With that, it will loop back again to this function only after those 10 seconds have passed.
Hopefully, this trick has given you some ideas.
Leave a comment on the Plugin Generator if you have any questions or concerns
Sir Legna's Plugin Generator
generator
Status | In development |
Category | Tool |
Author | Sirlegna |
Tags | mz, rmmz, RPG Maker, RPG Maker MZ, sirl |
Languages | English |
More posts
- Patch Notes for 21 of April 2024Apr 22, 2024
- Patch Notes for 21 of April 2024Apr 22, 2024
- Personal NoteDec 09, 2022
- Patch Notes for 19 of September 2022Sep 19, 2022
- Patch Notes for 4 of August 2022Aug 05, 2022
- Patch Notes for 5 of June 2022Jun 06, 2022
- Patch Notes for 23 of May 2022May 24, 2022
- Patch Notes for 16 of April 2022Apr 16, 2022
- Patch Notes for 14 of March 2022Mar 15, 2022
- Bug Fix! For Rewards For Escaping and Better Show Battle AnimationFeb 18, 2022