Event Trigger Labels

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

In RPG Maker, you have events on the map that can be triggered when the player is either standing on top of them or in front of them. When a player wishes to trigger an event, they press the “action” button, which by default is the Z or Enter key. When an event is triggered, they will execute the entire list of commands.

However, what happens if you want to allow a player to interact with an event in different ways? For example, if a player walks up to an event and talks to it normally, they might just have friendly conversation.

On the other hand, if a player walks up to an event and presses the A key, this might issue a challenge to the event to a mini-game, and the event will ask you if you’re sure you want to do this.

This plugin allows you to separate an event’s list of commands into different sections. Depending on how the event is triggered, a different section would run, allowing you to create unique behaviors when the player interacts with an event.

Download

Plugin: download here (right-click, save as)

This is for MV only. For the Ace version, click here.

Installation

Download ths plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_EventTriggerLabel plugin.

Once it is in your list of plugins, turn the plugin on.

Tutorials

If you prefer watching a video instead of reading the usage, you can take a look at Echo607’s tutorial

Usage

By default, all commands on the current event page are executed from top to
bottom when the event is run.

We can create sections of the page that will only be run when the trigger
label condition is met.

Button Trigger Labels

These trigger labels require certain buttons to be pressed.

For example, you might have a set of commands that only run when the “a” key is pressed, and another set of commands that are only run when the “b” key is pressed.

To create a button trigger label, create a “Label” event command and write

button_trigger BUTTON

Where the BUTTON is the name of a button that should be pressed.

Here is an example of an event that can be triggered with 4 different buttons.

eventTriggerLabels2

Depending on what plugins you’re using for buttons, it may be different. For example, if you’re not using any custom keyboard or input scripts, you don’t really have much choice beyond these buttons:

ok - Z key, Enter key
escape - X key, Esc key
control - left control, right contorl
shift - left shift, right shift
alt
pageup - Q key
pagedown - W key

These apply to Yanfly’s keyboard config plugin as well.

So for example, if you want the event in front of you to be triggered when you press the X key (which usually goes to the menu), you can write

button_trigger escape

Which would intercept the escape button press and trigger the event instead of opening the menu.

If you’re using a full keyboard plugin such as ZE – Key Mapper, you would then have access to the entire keyboard!

Please look at the instructions for your input plugin on what buttons are available. I have also provided a plugin parameter that allows you to show “debug” information, which displays the name of the button that’s being pressed. You will use this for your labels.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

8 Responses

  1. Seth-Rah says:

    Thanks a lot for this plugin, it’s going to be really useful for my experimentation phase in MV
    Although I would like to bring this up to your attention, I am not sure if this logic is intended or not.

    https://forums.rpgmakerweb.com/index.php?threads/conditional-branch-not-calling-else.86404/

    It seems that the labels are ignoring their placement in the logic. If I place a label inside an if for example, it won’t check if the conditions for the label existing are met or not.

    I don’t know if this is a problem with your logic, or RPG Maker MV’s logic on how it is handling labels or not, as I only just got started with RPG Maker.

    • Seth-Rah says:

      I just reread through your documentation and saw this.

      “By default, all commands on the current event page are executed from top to bottom when the event is run.”

      So it’s likely that this behavior is unintentional.

  2. Anonymous says:

    nice

  3. Kanax says:

    Could you possibly make a trigger for key items like you did for the Ace version?

  4. Kaelar says:

    Hi! This plugin seems to be exactly what I’m currently looking for however it seems that it doesn’t work with this plugin https://github.com/quasixi/RPG-Maker-MV/blob/master/Systems/QuasiMovement.js Do you have any idea if it is possible to fix that?

    I tried putting your plugin above and below this plugin but it doesn’t work. :(.

    Thanks in advance for your answer! Great work on those plugin by the way!

    • Hime says:

      Thanks for the report. I have looked at the issue and have confirmed that it is a compatibility issue.
      I will discuss with Quasi to see how a solution may be provided.

  5. Kloe says:

    Is it possible to detect when an event is run into instead of just walked up to?
    I know it would be possible to just detect for the run key, but that assumes the auto-dash option setting thingy is off instead of on!

    • Hime says:

      Hmm, when a character is dashing, there’s a flag to check for that. I guess it could be possible to create a trigger label that activates if the event is touched while player is dashing! Though I’ll have to look at touch triggers some more.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax