Custom Event Triggers

This script provides additional event triggers.


The built-in event triggers include

  • Action Trigger
  • Player Touch
  • Event Touch
  • Autorun
  • Parallel Process
This script provides additional triggers.



Download


Get it at Hime Works!


Installation


Place this below Materials and above Main


Usage


To specify a custom page trigger, create a comment of the form

<page trigger: trigger_name>Where `trigger_name` is one of the available custom event triggers. The reference section lists all of the available custom triggers.
Extended Trigger Data


This script adds "extended data" to the trigger.


Certain triggers may use this data to determine how to run.


The general format for extended trigger data is

<page trigger: trigger_name ext_data>   
Where ext_data is any string. Check the reference to see what kinds of


extended data may be required for each trigger.


Parallel Triggers


A custom trigger can be used as a condition for starting a parallel process. If the activation condition is met, then the event will begin running as a parallel process. This will not stop until the page changes.





Reference


Here is a list of available triggers and a description about them.


Player_Leave


Triggered when the player steps off an event. Note that this means the


event must have below-character priority.





Timer Expire


Triggered when the game timer counts down to zero. Can be anywhere on the map.


Event_to_Event


Triggered when an event touches another event. You can use extended data to specify which events should be able to trigger an event. If no extended data is specified then any event can trigger an event. Use -1 as the ID for the player.


You should think of it as "which events trigger me" instead of "which events do I trigger"


event_customtriggers2.jpg



Region_Enter


Triggered when the player enters a region. This is not checked if you are already in the region. It takes a list of region ID’s as extended data.





Region_Leave


Triggered when the player leaves a region. It takes a list of region ID’s as extended data.
So I am assuming you will be adding to the list of additional triggers, such as "Player Arrive", "Event Leave", "Event Arrive" and so on?
Player arrive is the same as player touch.


I will be adding event-related triggers (event-to-event touch, event-leave, etc) in the future when I have figured out a good way to do it.


For now, player leave was the easiest thing to do.
Very impressive, I cannot wait for future iterations of this script. Really interested in the possibility of an event to event touch. Hopefully it will be compatible at the most basic level with pixel movement scripts.

Might I suggest an extra event trigger:
Event Touch when event is above player (or possibly with Through on)
As it is currently, event touch with through or above player, is the same as player touch only.
The event to event touching trigger is just what I need.  I'll keep my eye out for that.  Great work as usual.
good script, especially the timer trigger will be useful. I assume that is the timer set by the control timer command?

One question however:

Is that timer event-specific or is it a general timer?

If I have several events setting the timer to different times, will they react to each their own time or will every event react to the last setting of the timer?
will wait for the event touch event trigger 😀 . it will make eventing much more easier. 😀 .
I have implemented a new trigger called "event_to_event".

If you don't like the name you can change the symbol in the trigger table.

This trigger uses extended trigger data, which is just extra data that a trigger may use.

The basic use is your standard page trigger comment. Suppose event 1 was tagged with

<page trigger: event_to_event>This means that any event that touches event 1 will trigger event 1.

However, what if we only want certain events to trigger event 1? We can use extended data.

<page trigger: event_to_event -1 2 3 8 6>This means that events -1, 2, 3, 6, and 8 can trigger the event.

Order doesn't matter, as demonstrated.

-1 means the player (to be consistent with the rest of the interpreter).

For anyone that's wondering why I didn't just use the "event touch" trigger: that means the player will always trigger it as well.

event_customtriggers2.jpg
 

One question however:

Is that timer event-specific or is it a general timer?

If I have several events setting the timer to different times, will they react to each their own time or will every event react to the last setting of the timer?
It is the general timer since by default events do not have timers of their own.
nice feature hime 😀 . gonna download the script now and do some eventing 😀 .
Two new triggers:

region_enter

region_leave

These are checked whenever the player enters or leaves a region (if moving within the a region, does not check)

These are computationally expensive since it checks every event on the map, so if you have many events these might not be a good idea.

event_customtriggers31.jpg


Currently, all events are run. I am not sure if it would be better to only run events that are near the screen.
For the enter and exit region conditionals, how many events would you say is too many?
That depends on how many are going to run.

If it's just a check, then you can have hundreds and it is still pretty good.

However if you've got a bunch of them running, remember that events are executed in sequence.

Which gives me another idea: parallel triggers vs non-parallel triggers. Basically, should one of these triggers execute the same way that a parallel process event would trigger, or should they execute like an action trigger.

Will see how that will work out.
My plan was a sort of minigame, when a torch is lit then certain npcs will run away from the torch when it is near it (in this case, if torch on, and if in region)

Else command would have the npcs move toward player
I can probably have this on a parallel process with a few wait frames.

If I were to have this on say, 5 to 10 npcs at a time, would that be too taxing?

Also, great idea on parallel/non-parallel triggers.
Doesn't sound like it should be an issue, but you should test and see how it actually turns out.
My plan was a sort of minigame, when a torch is lit then certain npcs will run away from the torch when it is near it (in this case, if torch on, and if in region)

Else command would have the npcs move toward player

I can probably have this on a parallel process with a few wait frames.

If I were to have this on say, 5 to 10 npcs at a time, would that be too taxing?

Also, great idea on parallel/non-parallel triggers.
instead of checking "in region" (which would need a lot of checking), you might use Yanfly's Move Restrict Region to just stop the events at the border of the region from leaving.

http://yanflychannel.wordpress.com/rmvxa/field-scripts/move-restrict-region/
@Andar thanks for the help, but I'm planning to have the torches toggle-able, so the npcs would be able to move close to and away from them when necessary.
Sorry for the double post. I may have jumped the gun with the latest trigger release. I suppose it's not possible/implemented yet whether the trigger can check if an event enters and leaves a region? I couldn't find any syntax in the instructions to suggest that it's possible.
No, it only checks whether a player enters or leaves a region.


Events entering/leaving is on the queue.
You can now set all events using custom page triggers to run as parallel processes when the trigger condition is met.


The page trigger itself serves as an extra page condition (sort of), and once you trigger the event, the parallel process will start running as usual until you change the page.


event_customtriggers41.jpg



Note the use of two triggers: the parallel process trigger, and the custom page trigger.
Is there a way to have the new custom page trigger also be the page condition?  I don't want the page with the custom trigger to be active at all unless the trigger is set.

Basically I'm using this for my hunting mini-game and I want the animals to be able to leave the screen and dissappear when they reach the edge of the map, just like a player would transfer back to the world map (Breath of Fire 2).

The problem is that the page with the event-to-event trigger always takes priority because I don't have any other page conditions.  I only want that page to activate when the event touches the "transfer player" event (and the animal will just dissappear).

Original thread: https://forums.rpgmakerweb.com/threads/custom-event-triggers.11327/