Event Trigger Labels

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,848
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,848
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,848
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
81
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,848
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
81
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,848
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,848
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,848
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,456
Members
137,821
Latest member
Capterson
Top