Different ways to interact with one event

I have several events where I want one thing to happen if you step on it, and a different thing to happen if you stand next to it, face it, and press the "ok" key.

Unfortunately, as far as I know, the first requires setting priority to "below characters", while the second requires setting priority to "same as characters". Those can't both be true.

Is there any solution for this? Either a plugin or something event-based would be fine.

Here is a screenshot of the event, just in case it helps.

temp2.png


That represents how I'd like it to work, but of course the conditional branch never triggers the first version – the event is just never called in this case.
you could fake the "same as characters" priority by surrounding the event with other below characters events that do what the main event should have done when interacted with from the tile over
That is a possibility, though it at least triples* the number of events (and thus the effort of making changes to them or copy-pasting them to additional locations). But if no simpler idea comes up, I guess that's what I'll do.

That also means I can't use self switches to control them, so if there are any that are using self switches they'd need to be changed to normal switches. (The example one I screenshotted already uses normal switches; I don't remember if they all do.)

*They are mostly placed up against walls, so there are generally at most two sides you can interact with them from.

EDIT: Another small downside to that is that mouse control would be a bit weird – if you click beside the hole, it'll ask you to remove the rope. Though, I'm not sure how you could make it work better than that with the mouse anyway…
That also means I can't use self switches to control them, so if there are any that are using self switches they'd need to be changed to normal switches.
You can manipulate self switches via script call.

$gameSelfSwitches.setValue([mapId, eventId, self switch], value)
I know you can, but I make a point to avoid that sort of thing – self switches are great for making an event self-contained, but if something else is setting their self switches, it's not really self-contained anymore.
I use an effect like that, as I made one with the help of CT_Bolt,
the one you want can be easily be made, but require a plugin.

HIME_EventTriggerLabels is one of it.
the one one is made, as I made a small plugin for it, as it's quite
complicated to copy paste, so I make it more bullet proof.

I can show you how its done soon though.

EDIT:
this is how you set it up, once in front, you trigger the true, if on it, it fails, so you
can do whatever happens than.
LabelTrigger.png


I was planning to put the code into my base as its not that big, but require
HIME_EventLabelTrigger, as the plugin has no helpfile, the event page tells how it works,
so its super easy to set up.
I'll try it soon, but… I'm not sure I quite understand what this is doing. I looked at the documentation for the HIME plugin, which as far as I can tell is intended to provide multiple-button interaction for an event that's set to "Same as Characters" (or one that's set to "Below Characters" but doesn't activate on "Player Touch"). I also took a look at that LabelTriggerMoveRoute that you posted; I can see the goal is to set Self Switch D to true when the OK key is pressed, but I don't quite get what causes the event to actually start once the key is down.

Maybe it'll all make sense once I actually try it. I'm not sure. If I have more questions after trying it, I'll get back you you then.
I didn't test it on player touch though, but it work with interactions nicely.
if need, I can test around later, and guide you through, but the way I have it
is a mechanic to loot in front, so yo can do many different things.

player touch can be nice, so I look into that, can be fun 🙂
I know you can, but I make a point to avoid that sort of thing – self switches are great for making an event self-contained, but if something else is setting their self switches, it's not really self-contained anymore.
Sometimes you need that extra control. I use it to manipulate chests that may possibly be opened at different occasions, making sure the player can't get the reward twice.
You could do a conditional statement:
1756678011202.png


And then change this code with a plugin (meta.allowTrigger):
1756678063974.png

JavaScript:
Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) {
    if (!$gameMap.isEventRunning()) {
        $gameMap.eventsXy(x, y).forEach(function(event) {
            if (event.isTriggerIn(triggers) && (event.isNormalPriority() === normal ||
                event.event().meta.allowTrigger)) {
                event.start();
            }
        });
    }
};
Spoiler
s1.png

s2.png
Sometimes you need that extra control. I use it to manipulate chests that may possibly be opened at different occasions, making sure the player can't get the reward twice.
I'm not really sure what you mean. Is that something that can't be done with a normal switch instead of a self switch?
I'm not really sure what you mean. Is that something that can't be done with a normal switch instead of a self switch?
But why would I waste a switch when I can manipulate the self switch? Leaves a normal switch open for whatever else, while keeping the chest a contained event.
Is there actually a limit on the number of switches in a project? I suppose it could make sense if there is. (I've never hit a limit, but I'd say that's because I haven't worked on a big enough project.)
Is there actually a limit on the number of switches in a project? I suppose it could make sense if there is. (I've never hit a limit, but I'd say that's because I haven't worked on a big enough project.)
I don't immediately remember, but I'd rather not waste a normal switch for really small things like this.
You could do a conditional statement:


And then change this code with a plugin (meta.allowTrigger):

JavaScript:
Game_Player.prototype.startMapEvent = function(x, y, triggers, normal) {
    if (!$gameMap.isEventRunning()) {
        $gameMap.eventsXy(x, y).forEach(function(event) {
            if (event.isTriggerIn(triggers) && (event.isNormalPriority() === normal ||
                event.event().meta.allowTrigger)) {
                event.start();
            }
        });
    }
};

I do have function to trigger both Event Touch and Player Touch,
so wont it be better to do this inside the Game_Event TriggerIn?

or seperate that does Event touch and Action Trigger?
it can work along the EventLabelTriggers as this is my code for
the player/event touch.
JavaScript:
    //=> Trigger EventTouch AND PlayerTouch (it was either EventTouch OR PlayerTouch)
    SDJB_Base._checkEventTriggerTouch = Game_Event.prototype.checkEventTriggerTouch;
        Game_Event.prototype.checkEventTriggerTouch = function(x, y) {
            SDJB_Base._checkEventTriggerTouch.call(this, x, y);
                if (this.hasTriggerBothTag() && !this.isStarting() && !$gameMap.isEventRunning() &&
                    $gamePlayer.pos(x, y) && !this.isJumping() && this.isNormalPriority()) {
                    this.start();
                }
            };

    Game_Event.prototype.hasTriggerBothTag = function() {
        if (this.event().meta["TriggerBoth"]) return true; //=> check note tag
        if (!this.page()) return false; //=> check comment
        let list = this.list();
        for (let i = 0; i < list.length; i++) {
            let cmd = list[i];
            if ([108, 408].includes(cmd.code)) {
                if (cmd.parameters[0].match(/<TriggerBoth>/i)) {
                    return true;
                }
            }
        }
        return false;
    };

so if I make a new hasActionPlayer Touch or all 3, you can use all 3 correct?
so the event automatically trigger either in front, automatically on it without
extra conditions?
I do have function to trigger both Event Touch and Player Touch,
so wont it be better to do this inside the Game_Event TriggerIn?

or seperate that does Event touch and Action Trigger?
it can work along the EventLabelTriggers as this is my code for
the player/event touch.
JavaScript:
    //=> Trigger EventTouch AND PlayerTouch (it was either EventTouch OR PlayerTouch)
    SDJB_Base._checkEventTriggerTouch = Game_Event.prototype.checkEventTriggerTouch;
        Game_Event.prototype.checkEventTriggerTouch = function(x, y) {
            SDJB_Base._checkEventTriggerTouch.call(this, x, y);
                if (this.hasTriggerBothTag() && !this.isStarting() && !$gameMap.isEventRunning() &&
                    $gamePlayer.pos(x, y) && !this.isJumping() && this.isNormalPriority()) {
                    this.start();
                }
            };

    Game_Event.prototype.hasTriggerBothTag = function() {
        if (this.event().meta["TriggerBoth"]) return true; //=> check note tag
        if (!this.page()) return false; //=> check comment
        let list = this.list();
        for (let i = 0; i < list.length; i++) {
            let cmd = list[i];
            if ([108, 408].includes(cmd.code)) {
                if (cmd.parameters[0].match(/<TriggerBoth>/i)) {
                    return true;
                }
            }
        }
        return false;
    };

so if I make a new hasActionPlayer Touch or all 3, you can use all 3 correct?
so the event automatically trigger either in front, automatically on it without
extra conditions?
This should work, yes.

What you have is more extensive because it also picks up comments insde the pages as well.

With my code, You can still trigger the event if you are next to it by pressing the OK button (player touch/event touch can still be activated by thr action button since it also runs the "check event there" code.

OP was looking to trigger the event next to the player even if it was set to below character so I was only giving a specific solution.
I try to understand your code, how it exactly trigger on action button,
how player touch works out as you target "Game_Player".

I though it was more event related to set player touch, but maybe also
action trigger other wise.

so its a cool idea if your code work, maybe I can extend my code to all all 3 🙂
as there ca be many nice mechanics by tags.
@bass2yang's code works perfectly for my use-case and is simpler, so I think I'll go with that for now. How should I credit you?
@bass2yang's code works perfectly for my use-case and is simpler, so I think I'll go with that for now. How should I credit you?
No credit needed. I'm glad to help!

Just pay it forward as always on here or any where RPG Maker is.

Thanks!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/different-ways-to-interact-with-one-event.179874/