Dev Log: Custom Page Conditions

Oct 24, 2015

In this post, I will discuss the design that goes behind a new plugin that I will be writing: Custom Page Conditions

What are Page Conditions?


In RPG Maker, events are grouped into a collection of pages. Each page comes with its own graphic, its own behaviors, and its own set of commands when you interact with it.



To determine which page should be shown, a set of conditions are used.


Our Default Page Conditions


Let's take a look at what our events offer us in terms of page conditions:

You have


- two switches

- a variable that only supports "at least" logic

- a self-switch

- when an item is in the inventory or not

- when an actor is in the party or not


Which is basically very limited. Even the conditional branch event command provides more options than that.


Example Problem


Let's say we have two actors - Hime and Chimg - and you wanted to create an event that will automatically activate when both actors are in the party.


An event page only supports conditioning on one actor, so you won't be able to do much with the page condition alone.


But let's get creative. What if we use the page condition to check for one actor, and then use a conditional branch to check for another?



Success!


Well, that sort of works. What happens if Hime was in the party first? Well, then we can follow the same approach, except check for the other actor in the event list:



Are we done?


We have now successfully handled the case where both party members need to be in the party for the event to run with a little creativity.


But now the question is, how do you actually "activate" the event automatically.


Because checking for actor in party is done as part of the event commands, you need the event to actually run before you can check it. This would require you to use an auto-run or a parallel process. Which may be acceptable, but you'll have to do this for the other event page as well to handle the "order" problem.


So OK, we can use a parallel process for this, and our problem has been resolved.


Checking for 5 actors?


Now let's say you wanted 5 different actors to be in the party before an event will automatically activate.


Now what are we supposed to do? Do we use the trick we used earlier, where a page condition is used to check for one actor, and then the event will check for the other 4?


But what about the order problem? You would need 5 different pages to accomplish this. And what happens if different combinations of actors do different things?


You're going to end up with a monster event with dozens of different conditional branches, which becomes a mess to handle.


Specifying Custom Page Conditions


What happens if we can simply convert all of those conditional branches into page conditions?


This way, the engine will do the work of checking whether the page condition has been met, and all you have to worry about is how the event will run once the page is activated.


Maybe something simple like this:



So you start by specifying all of the page conditions for this page, and then fill in what should happen when those conditions are met.


You could create any number of conditions that you need, including conditions that require formula because the conditional branch itself doesn't support it.


Using this approach, it should be much easier to create events that only run when certain custom conditions are met.


This functionality will be provided in a plugin called "Custom Page Conditions". If you are an RPG Maker VX Ace user, a version of this is already available: http://himeworks.com/2013/03/event-page-conditions/

By becoming a member, you'll instantly unlock access to 183 exclusive posts
111
Images
44
Writings
48
Videos
By becoming a member, you'll instantly unlock access to 183 exclusive posts
111
Images
44
Writings
48
Videos