Jump to content


Photo

Event Extend: Page conditions


  • This topic is locked This topic is locked
3 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 26 May 2012 - 01:11 PM

This script is outdated.
You should use Custom Page Conditions

Event Extend
-Tsukihime

Overview

This script allows you to use conditional branches to act as an additional page condition.
It only supports one conditional branch, but it allows you to specify more things and gives you a script box as well.

Example

You have an event that should only appear if Eric is a Monk.
The easiest way would be to specify a page condition that checks whether Eric is a Monk, but unfortunately such a page condition doesn't exist.

You can solve this problem by cleverly using a set of parallel events to check Eric's class, and then remotely set self-switches to show the proper event page.

...or you can just specify a custom page condition using a conditional branch that checks "Eric is a Monk?"

Usage

If your page should have a custom page condition,

1: create a comment as the first command and write "page-condition"
2: create a conditional branch with the condition you want.

dMAud.jpg

The branches themselves are not important. I only check the condition and determine whether the page should be selected.

Download

Script: http://db.tt/5Jd3a133
Demo: http://db.tt/5e6hxd0o

Notes

An event is not refreshed automatically unless you explicitly tell it to refresh.
I've added refresh calls to a lot of different methods throughout the classes but there may be some I didn't catch. Just report them.

Edited by Galv, 26 March 2015 - 06:36 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#2 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 27 May 2012 - 02:36 PM

Night_Runner over at RRR decided to use a conditional branch to check for activation, which I think is a great idea.

I've updated the script to use conditional branches as well (and also the original "script: .." comment if it's easier for you).

Now all you have to do is do your typical conditional branch and the engine will correctly skip the page if the condition is not met (this allows you to run other pages).

The first conditional branch is used to check whether the page should be used.
It is still going to be checked when the interpreter actually executes the page commands.

Here is an example of why this is useful:
Suppose you have a chest

Posted Image

It doesn't do anything useful by default, but on the second page, you have

Posted Image

So the chest will suddenly turn into a dark chest and take your HP away if switch 1 is ON.

If switch 1 is not on, then the first page will be activated and you see your rest chest.
Once switch 1 is on, it will turn into the dark chest.

Technically, you don't need to put your commands inside the branch if you just want them to execute when the page is activated. You can still do it though; there is no issue.

Edited by Tsukihime, 27 May 2012 - 03:29 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#3 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 21 July 2012 - 03:01 PM

I've modified the script to make it more flexible
It changes how the page condition command is specified.

Your first command should be a comment that reads "page-condition"
The second command should be a conditional branch that will be used as the page condition.

Posted Image

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?


#4 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5,599 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 11 August 2013 - 08:33 PM

Locked at OP's request. This script is no longer supported and you should use the new one as stating in the first post.


gs-banner_zpsfc59b073.pngp7GQmH4.png 2hjKrWv.png





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users