Custom Event Triggers

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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"





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.
 
Last edited by a moderator:

light487

Parrot Keeper
Veteran
Joined
Mar 26, 2013
Messages
852
Reaction score
26
First Language
English
Primarily Uses
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?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
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.
 

JANK

Music Composer
Veteran
Joined
Oct 5, 2012
Messages
76
Reaction score
4
First Language
English
Primarily Uses
The event to event touching trigger is just what I need.  I'll keep my eye out for that.  Great work as usual.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
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?
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
will wait for the event touch event trigger :D . it will make eventing much more easier. :D .
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.

 

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.
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
nice feature hime :D . gonna download the script now and do some eventing :D .
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.



Currently, all events are run. I am not sure if it would be better to only run events that are near the screen.
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
For the enter and exit region conditionals, how many events would you say is too many?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Doesn't sound like it should be an issue, but you should test and see how it actually turns out.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
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/
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
@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.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
No, it only checks whether a player enters or leaves a region.


Events entering/leaving is on the queue.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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.





Note the use of two triggers: the parallel process trigger, and the custom page trigger.
 
Last edited by a moderator:

JANK

Music Composer
Veteran
Joined
Oct 5, 2012
Messages
76
Reaction score
4
First Language
English
Primarily Uses
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).
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top