“Ah, we are finally here,” Mr. Slick announced as he finally stopped at the edge of the frozen lake, “The lake had been frozen solid and the ice should be strong and thick enough,”
He turned his attention back to Clementine.
“If this li’l ol’ fella may ask, have ya ever ice skated before?”
Clementine looked at the frozen lake with awe, admiring how the sun light bounced off the smooth surface, casting a sort of mirror-like look to it. While it was a beautiful sight to look at, she was also a little weary of it. There’s a reason why she’s never tried ice skating before.
Looking up, the rag doll gave a timid shake of her head, signaling that, no, she’s never been ice skating before.
Ariel covers her mouth with one hand as she gives a small laugh. “You are!”
She kneels down to get a better look. “Did you make that yourself? It looks very nice!”
“Thank you!” The little doll let out a giggle as well, still hopping in place as she performed a twirl, wanting Ariel to get a full look at her costume. Although, Clementine did stop moving just long enough to answer her question.
“Um...I glued these cute bows to my shoes!” The child announced as she pointed to her feet. In other words, no, Clementine didn’t make it herself. But just like the pumpkin dress, she did add a few elements to make it fit her style more. Like the matching bows that were added to her hair.
With that, The girl went back to bouncing on her toes, still excited over her new look. “I’m all ready to be scary for Halloween! What about you? What are you gonna be, Miss Ariel?”
His eyes widened in surprise at the sudden kiss on the cheek coming from the other, cheeks started flushing underneath his fur. He looked like he appreciated the kiss and could only let out a flustered laugh in response.
“What was that for?”
Clementine held a smile as she straightened up, prepared to give Puss the answer he asked for.
“I don’t know.”
She was being completely honest. The rag doll had no idea what the tradition was behind the mistletoe. All she could do was come up with her own explanation as she pointed towards the hanging ornament. “It’s just a thing people do when they’re under the kissing leaves.”
Confirmed All PC RPGMakers - (Examples From: RPGMaker MV)
Page order can be used to allow reuse of events and even make events that only occur once.
The key idea is that the larger the page number the more priority it has. If two pages quality to run at the same time the larger numbered page will always run.
To illustrate this we will be making a happy little chest.
Find a square on a map in your game that doesn't already have an event on it and either double click or select the square of the map and press enter.
I suggest naming it something that will have meaning to you later. Like, uh, “Chest”?
Step 2:
Add a new page -
Press the large button at the top of the event editor called “New Event Page”.
If you end up with more than two pages just make sure the page you want to delete is the number lit up and press the “Delete Event Page”. Having only 2 pages is important here.
While this can be done in any order this is the step we care the most about.
Step 3:
Set a condition to make this page not normally operate -
I set this page of the event to only operate under the condition that it’s Self Switch ‘A’ is active. New save files start with all their switches as false so requiring Self Switch ‘A’ to be active will not allow this page to run.
Note: Every event has four self switches. They can only be set by the event that owns them. This means you don’t have to worry about other events acidentally triggering this page. You have to be using RPGMaker XV and newer to have access to Self Switches. Older RPGMakers will require you to use a “Switch” or “Variable”.
I also added an open chest graphic to the event and changed it so it won’t change graphic if the player tries to talk to it from a direction other than above.
Note: The chest I used only looks open when it is facing up. By default, events try to face the player when activated. This would partially close the chest so I chose to lock the direction the chest is facing.
Sweet, 3 steps in one? I’m good at making tutorials.
Step 4:
Add something to the event page so the user knows something happened -
Add a message to the player. Let them know their actions did something.
Or you know, insult their intelligence.
Step 5:
Set the Image for page 1 -
Return to page 1 and give the event a closed chest image. I also lock the graphic here again so it won’t crack open depending on the player facing.
We don’t set any conditions because we want this to be what the chest does by default.
If you look real hard you’ll see an option I changed but didn’t mention here. I didn’t mention it because it can be set both ways and it won’t matter for our chest.
Step 6:
Make the chest give loot -
Give the player some loot and a sound or message to let them know.
Who really wants to count 1000 gold anyway, I did him a favor.
Step 7:
Tell the game to remember the chest has been looted -
We set Self Switch ‘A’ to be true. This will cause page 2 to be run if the player interacts with the chest again.
Switches, Variables and Self switches are all persistent. I chose to use Self Switch ‘A’ for three reasons. First, Self Switches belong to the event, another event can’t reset this events Self Switch. Second, using a Variable is a waste of resources. Third, ‘A’ was chosen because every time you try to do an operation on a Self Switch it defaults to ‘A’.
Whatever you choose to use, it needs to activate the condition for Page 2, see step 3.
You would want to use a standard switch in older RPGMakers. Just be careful not to use the same switch for more than one chest.
What happens:
While your game runs it loops and constantly checks your events. It looks at each event and starts with the largest page number, in this case 2, and checks to see if the conditions are right to run this page. If they are, the check is done and that’s the page that is loaded. If not it checks for the next largest page number and it continues checking the pages until it finds one or checks them all. If no page is found the event renders nothing and will continue to do nothing until a condition is met. Be aware that if you are using events to decorate your map one of the pages must be have its conditions met otherwise the event won’t appear on the map. (Don’t worry too much, by default pages start with no conditions to meet so they load by default.)
By default all switches are off, so before the chest in interacted with, page 2 won’t load. As page 1 has no conditions it will load.
The loaded page will decide a few things, like the look of the event’s sprite. This is why the chest looks closed until the switch is changed. (I have included a better animated chest in my example code for reference.) The loaded page will also decide if the player can pass through the object and what is additionally required to trigger the page’s condition.
Page 1 is the same layer as the hero, so the hero collides with it, and it’s “Action Button” triggered so the hero has to be facing it when the player hits the action key to active it.
Once page 1 is activated it’s code runs and it turns a switch on at the end of its process. This switch allows page 2 to be loaded.
As a result page 2 will be loaded from then on. This only allows the player to loot the chest once.
To further illustrate this I have included a map with 2 nearly identical example chests. The green chest is a more complete chest, whereas the red chest has the first and second pages swapped.
Note: In the case you have 2 pages and the page with the largest number is triggered by player interaction, say “Player Touch” or “Action Button”, and a page with a lower number had a trigger like “Parallel process” or “Auto Start” and the player isn’t presently interacting with the event, the event will still load the higher event page. This means the “Parallel process” or “Auto Start” page still won’t be able to run.
RECAP:
- Page order is important, if 2 pages have all their conditions met the page with the larger number will always be the one displayed and triggered.
- Self Switches are magic.
See my code:
The code I used for this tutorial can be downloaded at https://github.com/kylehoffmann/RPGMaker_Tutorials
You will need to download all of the files and the folder RPGMaker MV Tutorial Base as well as map001.json from Tutorial - Event Priority.
Take map001.json and replace the file of the same name in the folder “RPGMaker MV Tutorial\data” to see my code in your RPGMaker.