Tutorial: Creating keyitem-triggered events

In games like chrono cross, you can press a key to open a window with a list of key items currently in your inventory. In chrono cross, you can try arbitrary key items hoping that one of them will trigger an event.

RM also comes with a similar feature, except it is strictly through eventing, and you are unable to use a key item to trigger an event.

There are two issues with this:

1. Even if you wrote a script to open the key item selection window, you’d have to figure out a way to actually trigger an event

2. When you’ve triggered an event, how would you determine which item you are using, and how can you make it easy to set up the event? Parallel process with a conditional branch? What if you have a hundred NPC’s?

A solution is to use Event Trigger Labels.

This script comes with built-in functionality that allows you to setup an event to activate when a key item is used on an event.

Setting up the event is simple:

1: Create a label of the format

keyitem?(n)

Where `n` is the ID of the keyitem that you want the event to respond to.

2: Add event commands as usual under the label.

The following image shows a sample event, with multiple triggers (both buttons and key items), as well as an example result in-game. The key item “cute coins” is item ID 16

key_item_trigger3
With the script, you can bring up the key item menu anytime and select a key item to use
key_item_trigger1
When the appropriate item is selected, the event will respond according to the specific trigger.
key_item_trigger2

You may also like...

5 Responses

  1. Tsukihime says:

    I was looking at my code and noticed that I explicitly wrote “don’t put exit event processing before the first command” I guess 6 months ago my intentions were different from what I wrote up there! Anyways the script has been updated to not ignore the first command so it handles example 1 correctly.

  2. RogueDeus says:

    What prompted me to post that above was a test event I made for opening a treasure chest…

    I created an auto chest from the right-click menu, and then placed a keyitem label at the very top. When I ‘used’ it like normal it opened, and when I used the keyitem it opened. So I placed an Exit Event Processing command at the top, above the keyitem label, and it worked fine. Only opened when the item was used from the menu.

    It seems to be an issue only with the very first command space. If the label is the first line, it wont ignore the default trigger mechanism as intended. An initial Exit Event Processing command is necessary.

    However, my second example was unnecessary. 🙂

  3. RogueDeus says:

    The necessity of using Flow Control event commands, to compartmentalize potential effects of each possible keyitem trigger, is not obvious and may lead many newbies to pass up this otherwise great script. 🙂

    Example 1: If you want an event to be completely unresponsive to all interaction *EXCEPT* the keyitem trigger, you must start the event page with the [Exit Event Processing] command, and then follow up with each individual keyitem label, each followed by [Exit Event Processing]. Otherwise it will fall through each keyitem label like normal.

    Example 2: If you want a normal NPC, that has a normal conversation, to have a secret optional use if you say, flash a rebel seal, then the normal conversations need to be separated from the optionals, via the [Exit Event Processing] command, and the rebel seal option input after it.

    • Tsukihime says:

      Exit Event Processing commands are automatically inserted right before each trigger label. Or they should. If it is not happening then there’s a bug in the script.

      For example 1, the intended behavior is that if there is a trigger label, then the default C-key trigger behavior is overridden.

      For example 2, you will need to use a trigger label on C-key to separate the rebel seal from the normal conversation.

      That is how I intended it to be used; if it is not working that way let me know and I will look into it.

  1. February 27, 2015

    […] Keyitem Triggered Events […]

Leave a Reply

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