Event Trigger Labels

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.

Download

Script: download here

Addons

Tutorials and Examples

Installation

Place this script below Materials and above Main

Usage

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

button?(:C)

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.

You may also like...

41 Responses

  1. KaiSSeR_SK says:

    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!

    • Hime says:

      In line 194, remove the && Input.any_key_pressed? part. This was an optimization but evidently it assumes you’re using a keyboard.

      • KaiSSeR_SK says:

        Thank you so much! Problem solved, it works perfect, and, sorry for double posting error…

        • Hime says:

          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.

  2. Sheryl says:

    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 😛

    • Hime says:

      Are you using the Key Item Trigger Labels script?

      • Lost Dragon says:

        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.

        • Lost Dragon says:

          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.

  3. tirkaroKujo says:

    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.

    • Hime says:

      I added some checks but I don’t know if that solves the problem.

      • tirkaroKujo says:

        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.

  4. poundcake says:

    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!

  5. Anonymous says:

    uninitialized constant object game character

  6. Yinyamina says:

    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:
    button?(PadConfig.pick)
    and
    button?(PadConfig.ok)

    Lone Wolf's Game Pad Extender:
    http://forums.rpgmakerweb.com/index.php?/topic/1284-gamepad-extender/

    • Hime says:

      You should use the game keys, not the script names. Usage should be no different from keyboard controls.

      • Yinyamina says:

        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:

        def self.pageup
        WolfPad.plugged_in? ? :L2 : :L
        end

        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!

  7. Hime says:

    Found the issue and resolved it. Should work when you get the latest version of the script.

  8. 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.

  9. I get the following error: undefined method ’empty?’ for nil:NilClass
    Any ideas?

  10. Hime says:

    “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.

    • RogueDeus says:

      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.

      • Hime says:

        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.

  11. RogueDeus says:

    Question?
    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.

    • Hime says:

      “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.

      • RogueDeus says:

        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!

        • Hime says:

          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.

  1. March 3, 2024

    … [Trackback]

    […] Read More Information here on that Topic: himeworks.com/2012/10/event-trigger-labels/ […]

  2. March 3, 2024

    … [Trackback]

    […] Read More here to that Topic: himeworks.com/2012/10/event-trigger-labels/ […]

  3. March 5, 2024

    … [Trackback]

    […] Find More on on that Topic: himeworks.com/2012/10/event-trigger-labels/ […]

  4. March 11, 2024

    … [Trackback]

    […] Info on that Topic: himeworks.com/2012/10/event-trigger-labels/ […]

  5. March 11, 2024

    … [Trackback]

    […] Find More Info here on that Topic: himeworks.com/2012/10/event-trigger-labels/ […]

  6. March 22, 2024

    … [Trackback]

    […] Find More here to that Topic: himeworks.com/2012/10/event-trigger-labels/ […]

Leave a Reply to Hime Cancel reply

Your email address will not be published. Required fields are marked *