Event Trigger Labels

● ARCHIVED · READ-ONLY
Started by Tsukihime 9 posts View original ↗
  1. 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.
    key_item_trigger3.JPG


    eventtriggerlabels2.jpg


    Download


    Get it at Hime Works!
  2. 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.
  3. 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.

    key_item_trigger3.JPG

    Select an item (cute coins is item 16)

    key_item_trigger1.JPG

    Triggered!

    key_item_trigger2.JPG
  4. 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
  5. 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.
  6. 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.
  7. 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.
  8. A new type of label has been added: "trigger?"


    eventtriggerlabels2.jpg


    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)
  9. 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.