Event Trigger Labels

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
This script allows you to divide an event list into multiple sections using labels.


An event with multiple sections will only execute the section that was triggered.


This allows you to create different behaviors for the same event depending on how the event was triggered. There are many different ways to divide an event list

  • Pushing a button, for example the C button or the X button.
  • Using a key item.
  • Touching an event
For example, one button might allow you to talk to an NPC, while using a keyitem on the NPC allows you to trigger a special set of commands.






Download


Get it at Hime Works!
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
Script has been updated to support keys whose symbols are greater than 1 character (eg: F5, CTRL, ...)

If you are using cidiomar's Full Input script, it is automatically supported.

You will need to use the correct keys, but there is no actual work involved.

I will not be changing the design to use comments instead of labels just because there's not enough space. Labels provide built-in "jump to" functionality, while comments would require extra parsing just to accomplish. Just shorten the text if you need to.

I have tested it with the full input script on F1 F2 and they work fine. Even obscure keys like :HOME and :CTRL work. Basically every key is fair game as long as it's bound to the engine.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
I have updated the script to support key item trigger labels. Think chrono cross.

You can now use a key item to trigger an event.

1: choose a "key item variable" in the configuration. This is only important if you are going to use the event command "select key item" to force players to choose a key item. Otherwise this is not very relevant (and by default you can see I use an arbitrary variable...)

2: choose a "key item button", which is the key you press in order to open up the key item selection window.

3: setup your event trigger labels for your key items.

Use the label



Code:
keyitem?(x)
Where x is the ID of the key item you want to trigger this event.



Select an item (cute coins is item 16)



Triggered!

 
Last edited by a moderator:

Selchar

Veteran
Veteran
Joined
Dec 28, 2012
Messages
299
Reaction score
82
First Language
English
Primarily Uses
I've found 2 problems with this script, wondering if there's a way to fix it at least the 1st one.

1: When you're standing on an event that activates in front of you(same priority as you with through on for instance), the trigger labels don't seem to work all the time(more like 25% of the time or less)

2: You can't seem to use trigger labels to activate events that have "Erase Event" at some point after said label.

You get the error "line 191: NoMethodError", undefined method 'list' for nil:NilClass
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
I have updated the script to address the second bug.


I don't know about the first.

When you're standing on an event that activates in front of you(same priority as you with through on for instance), the trigger labels don't seem to work all the time(more like 25% of the time or less)
I'm more surprised you're actually able to activate an event in front of you when you're standing on it.


It should work 0% of the time because you can't trigger events if you're standing on them.

You can't seem to use trigger labels to activate events that have "Erase Event" at some point after said label.


You get the error "line 191: NoMethodError", undefined method 'list' for nil:NilClass
This bug is not due to not being able to activate events after erasing the event.


The bug is being able to activate the event after it has been erased. You should not be able to activate an erased event after all.
 

Selchar

Veteran
Veteran
Joined
Dec 28, 2012
Messages
299
Reaction score
82
First Language
English
Primarily Uses
Eh, I'm persistent.  Normally when you're standing on top of an event, you can activate it if it's priority is below you.  That works both with the normal action button and your script.  But if the event below you can't be activated, but the one in front of you can, then the action button works 100% of the time, but your scripts labels for some reason don't.  The only reason it sometimes works is probably because I keep trying and sometimes move from on top of one event to another.

This scenario can normally only happen if the event you're standing on is the same priority as you, but with through on(you tipped me off to that in another thread).  Or it can come about regardless of priority if you completely disable action button event triggers at your XY position(small changes in "start_map_event" and "check_action_event" can accomplish this)

I have looked through your script, but am not sure why it doesn't want to work, or why it works sometimes if I move around while trying.  It's a bit of a mystery.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
I didn't consider priority. Yes you're right, now that I think about it, the default scripts first checks the player location for any events, and then checks in front if no event started.

I will look at how the event checking is performed to see where the inconsistencies are coming from.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
A new type of label has been added: "trigger?"





These are available if your event trigger is "player touch" or "event touch".


If you touch an event, then the event will run the "player touch" section.


If an event touches the player, then the event will run the "event touch" section.


If you trigger the event using a button or key item, the appropriate section will run (same as action trigger)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,851
First Language
English
Saw a post in the suggestions thread and remembered that I never mentioned this.

Button trigger labels support direction input as well using the following labels:

Code:
button?(:UP)button?(:DOWN)button?(:LEFT)button?(:RIGHT)
You need to define the behavior for each direction separately.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
First steps on an interior castle map
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?
I've been having a rough couple of months and as such let down some friends of mine in the RPG Maker community. I still need time to get back to my normal self, but it's nice to be back, to read articles, and to design again (albeit at a slow pace). Hope to give updates on Kid Crescent soon.

Forum statistics

Threads
107,735
Messages
1,031,742
Members
139,870
Latest member
Berserk94
Top