This script allows you to assign multiple action triggers to an event. Every page can have its own set of action triggers.
The action button, by default, is the C button (on keyboards, it is by default the Z key, Enter, or Space). So when you press the action button when you’re standing beside an event, you will execute its action trigger and the event will begin running.
Multiple action triggers allow you to set up your event to run different sets of commands depending on which button you pressed. For example, you can press the C button to interact with the event normally, or you can press the X button (default A key) to initiate a mini-game.
Script: download here
- Key Item Trigger Labels – use key items to trigger events!
Tutorials and Examples
Place this script below Materials and above Main
Instead of treating your page as one list of commands, you should instead treat it as different sections of commands. Each section will have its own label, specified in a specific format.
For example, to create a section that will be executed when you press the C button, add a Label command and then write
This means that any commands under this label will be executed when you press that button (remember that the C button is the Z key on your keyboard).
You can create as many sections as you want, each with their own buttons. Press F1 in-game and then go to the keyboard tab to see which buttons are available.
See the tutorial, which provides an example on how this script is used.
Hi! First at all sorry for reopen…
I have a little issue, the script works perfectly with keyboard but doesn´t works with my gamepad. Tested also on a clean project.
Thanks a lot!
In line 194, remove the
&& Input.any_key_pressed?part. This was an optimization but evidently it assumes you’re using a keyboard.
Thank you so much! Problem solved, it works perfect, and, sorry for double posting error…
You may notice some performance issues since now the script is basically checking for event triggers every frame…I’m not actually sure how to handle gamepads properly.
I’m using this script in my game, but I can’t figure out how to make an even automatically show text after you use a key item. When I use a key item, I have to click the action button again which makes the game play a bit less smooth.
is there a fix to this? I read through the scripts and couldn’t figure it out…I’m new to all this RPG maker stuff 😛
Are you using the Key Item Trigger Labels script?
I had the same problem (having to press the action button again) and solved it by moving your scripts to very the bottom.
I don’t know for sure but I’m guessing maybe Mog’s anti-lag script or animation anti-lag script was the one that might have been interfering.
I take that back. If I use Keyitem(any) and Keyitem(ID) in the same event it works but I have to hit the action button an extra time. If I just use one or the other that doesn’t happen.
Will experiment in a fresh game with no other scripts for testing later.
I had experiences that problem before but thought I fixed it already. Let me know.
Been having a bit of an issue when using this script (and by proxy the Key Item Trigger Label script) in conjunction with Falcao’s ABS Liquid V3.
There’s a strange glitch that occurs after destroying an enemy event (for me, it’s destroying the “grass” enemy object with a sword, mapped to the F button); If you walk over the event after destroying the enemy, you get a NoMethodError. (undefined method ‘button_labels’ for Nil:NilClass)
Is there any way to fix this? I’d much prefer to use this script for using key items.
I added some checks but I don’t know if that solves the problem.
Well those checks seemed to have worked for the event trigger labels script, but now this same error seems to have carried onto the Key Item Trigger Labels script. (line 162, undefined method ‘key_item_labels’ for nil:NilClass)
Sorry, I’m obviously not the best with Ruby, but this seems like an easy fix.
You’re right, the same check was needed for the event as well.
the link to the script download seems to be broken. is there any way you could repair it? this script is just what i'm looking for. thanks!
I've fixed the link.
uninitialized constant object game character
How did you install the script?
Hey Tsukihime, I was wondering if there is a way to get this script working with Lone Wolf's Gamepad extender. I've tried using it, but it treats the event as if it has no labels for the script at all.
I have 2 different labels in there:
Lone Wolf's Game Pad Extender:
You should use the game keys, not the script names. Usage should be no different from keyboard controls.
The problem is that the buttons are stored in methods so that if there's no controller plugged in it will default back to the natural buttons. For example:
WolfPad.plugged_in? ? :L2 : :L
While plugged in, the button becomes L2 instead of L
If it can't be done, that's OK. I'll find a way to just make my events work through some workaround. If you think it can be done, please let me know!
I don't have a gamepad to test on so anything I write would just be throwing things out there.
Found the issue and resolved it. Should work when you get the latest version of the script.
Many thanks. Can I download the script now?
I would also like you to accept my praise as a God among men for the creation of the Preserve Data script and offer my body for practical and/or sexual labor.
Yes the link has been updated.
I’m sorry for the delay. It seems it didn’t have anything to do with player touch or self-switch. I created a test map and tried to replicate the problem. It turns out that I get the error when I step on ANY event that requires a switch that’s currently OFF. I don’t think I deal with a compatibility issue, since I don’t use any other scripts that deal with events and the older version of Event Trigger Labels does not display the issue.
I get the following error: undefined method ’empty?’ for nil:NilClass
It happens when I trigger some events by player touch and activate a self switch.
I am unable to reproduce the issue. I created an event with player touch trigger, that simply activate a self-switch.
“Trigger” Labels have been added. You can now use a “:player_touch” or an “:event_touch” label to provide more control over how an event will respond depending on whether you trigger it with a button, or through contact.
Thanks for the quick turn around!
But alas, I am confused…
The expected functionality, that I mentioned was non-functional above, works now without the need for the new trigger label at all.
To make sure, I re-placed the old non-functional event, without any changes for the updated script, and the keyitem? label worked. Now the door tells the PC its locked when touched, (as though walking through a default quick placed door transition), and also opens when the keyitem is used. This is great!
But it leaves me wondering if I fully understand the need for the new ‘trigger?’ labels.
Also, I think some of the debugging is still in the code, as the console is spammed by ‘’ any time the script processes.
I made it so that player touch and event touch events also follow the labeled sections. Previously it didn’t, which is why it probably didn’t work. Actually it really doesn’t make much of a difference what the event’s trigger type is now that I think about it.
You can PROBABLY get away with not using the player_touch label, but if you wanted both player_touch and event_touch labels, then you’d have to use one (or both) of them. It’s also there if you want to keep things organized when you look at your event again in 2 months and wondering how it works.
And yes I removed the debug code in my project but didn’t copy it over.
Is there a specific reason that you’ve limited the functionality to ‘Action Trigger’ events? I recently realized the limit existed when trying to apply it to a ‘Player Touch’ event, then came here to make sure it wasn’t a bug.
“Action Trigger” is the only built in event trigger that actually involves pressing a button and will perform button checks. I didn’t consider checking whether you pressed any buttons when you come into contact with something.
I see. I was actually attempting to apply the action to an event that talks to the player on contact, requiring the player to use an item to open it. Like a door that automatically says, “I am locked” when the PC attempts to walk into it. Requiring the PC to use a key to open it.
Thanks for the feedback!
Hmm, a possible solution (on my end) is to provide a label for “player touch”, which will allow you to create a “player touch” label that will activate when you touch an event. Note that player touch events can be activated by button press as well, so this would not be too much of a stretch from the default behavior. I’ll place that on the top of my priority list since it sounds very useful.