RSS

[Tutorial] 姫Hime’s Page Condition Script

04 Oct

Anyone who has played the Pokemon Crystal on GBA back then would probably remember that cave where we can find a Lapras every Friday. The question is, how can we create such event on RPGmaker easily without having to use (potentially complex) parallel processing, self switches, and/or some sort of variables/switches to check/keep track of certain condition(s)? One way to achieve this easily is to use this <page condition> script.

RPGmaker does not come with a built in clock/time system that helps keep track of minute, seconds, hour, days, etc. There is a timer to keep track of how long we have spent playing, but that’s not what we are looking for. I am pairing Hime’s Page Condition script with Vlue’s Advanced Time script in order to achieve what I am trying to demonstrate in this tutorial.

Table of Contents:

  • What is Hime’s Page Condition script?
  • How to install Hime’s Page Condition script?
  • How to use Hime’s Page Condition script in your own game?
  • Sample Code + demo included

Notes:

  • Hime’s scripts are free to use in non-commercial projects. Please contact Hime if you wish to use these scripts in a commercial projects. The Terms of Use can be found here, and you can contact Hime directly by clicking here.
  • Vlue’s scripts are free to use in non-commercial and commercial project. Credit is needed and donation is appreciated.


What is Hime’s Page Condition script?

The RPG maker VX Ace event page comes with limited amount of conditions that must be met in order for the event to spawn on the map. These conditions are limited to switch, variable, self switch, item and actor. What if we want to use a custom condition that comes with a script, or what if we want to check if the party has x amount of gold before the event will spawn? We will have to use additional event page that will be activated using a self-switch from a parallel process page. This can potentially be confusing for users.

Once we have Hime’s Page Condition script installed, we can convert conditional branch into event condition through the use of a comment.


How to install Hime’s Page Condition script?

Get the script from Hime’s website, open the script editor (F11) and insert it under the “▼ Materials section” and above the “▼ Main Process section”. It is the same as any other script. Remember to give the script the appropriate name so that you can find it easily when installing add-on to this script later. If you are also using Hime’s Negated Conditional Branch script, this script must be placed under it.


How to use Hime’s Page Condition script in your own game?

This script can be used in Event, Troops, and Common Event page.

To create a custom event condition, first we need to create a comment with the phrase

<page condition>

Then create a conditional branch event right after the comment. The conditional branch will be converted into a page condition required in order for the event to spawn. If you are unsure where to find “Comment” or “Conditional Branch” in the event creation page, please refer to the following image:

Event Page

Once you have added the <page condition> comment, create a conditional branch with the condition for the event to spawn.

In this example, the event will only spawn if player have received a Quest and if the player have not collected 5 quest item. Since the item the player have to interact with (a basket of apple) is added using an image from tileset, the event graphic is the default blue squares (transparent). This will create the illusion that the player can only collect items from the basket while the quest is active. Remember to change the priority to “Same as character” otherwise you wouldn’t be able to “reach” the quest item (see the area enclosed within the red rectangle). The default priority “Below the Character” means that you have to step on top of the apple basket before you can interact with it.

The following is the alternative solution to the same quest item that player have to interact with, except we are not using the Page Condition script

Not only that we need a second event page, we have to apply things like parallel process, and self switch, which can potentially becomes a little confusing for bigger events.

Troop Event page

This example is used together with Hime’s Enemy Reinforcement script. A rare slime only will spawn if Actor 1, Eric, job is Soldier, AND the player has 0 gold, AND Eric is equipped with a Gigantes Axe. Definitely one way to include a hidden rare spawn or something.

Common Event page

In this example, we are going to change the weather IF actor 1, Eric, is a soldier AND after the player receive a quest.

The Trigger must be changed to “Parallel Process” and we must create a dummy switch that is always on. I named mine “AlwaysOn” to make it easier to recognize. Don’t forget to create an event to turn the AlwaysOn switch on.


Sample Code

Remember the example I mentioned at the start about Pokemon Crystal and the Lapras cave?

The NPC at the starting zone is only used for changing the day to test out the script, and to reset the “Boss Tried?” switch.

Basically this Lamia boss will only appear every Monday (day_week == 1) and if player has not tried fighting the boss yet (“Boss Tried?” switch). If the player defeat the boss, or escaped the fight, the “Boss Tried?” switch will turn ON and the boss will disappear since one of the conditional branch is evaluated to be false. We will need to create another event to reset the “Boss Tried?” switch if you want the boss to appear every Mondays. For the sake of simplicity, I use the NPC at the cave entrance to reset the switch.

If you want to experience it first hand, I have included a demo for you to try it out yourself. Click here! To check what time it is in-game, use the shift key to turn the clock on/off.

Advertisements
 
Leave a comment

Posted by on October 4, 2015 in Scripts

 

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: