Have player walk through events, but disable those events from walking through player?

Would it be possible to have the player character walk through an event, almost like they have through enable just for said event, but have it so the event can't walk through the player?

I would have the player just set to through, but that would also mean the player wouldn't collide with anything at all.
So you could just turn through on for player then once the player walks through said event turn Through off for the player?
So you could just turn through on for player then once the player walks through said event turn Through off for the player?
Well, the events would be NPCs that freely roam in an open space, so there wouldn't be a specific moment where I could turn through on and then off again.
Well the only time the player need to turn through on is when they walk into the object.
So when the player touches the event, player turns through ON, step forward and then turn through OFF. It looks as if the player step forward one step normally.

1736783159917.png
Well the only time the player need to turn through on is when they walk into the object.
So when the player touches the event, player turns through ON, step forward and then turn through OFF. It looks as if the player step forward one step normally.
If the event is set to 'player touch', then I wouldn't be able to also use the 'action button' trigger as well to show dialogue, unfortunately.

Would there be a way around that?
If the event is set to 'player touch', then I wouldn't be able to also use the 'action button' trigger as well to show dialogue, unfortunately.

Would there be a way around that?
1736783631772.png

You can do it like this.

Edit*
But the idea has a problem. If you want to talk to the npc who is on the right side of the player, the player has to turn toward him and so walks through him.
My suggestion is you add a timer so if the player keep pressing forward, say, 10 frames, he will walk through the event. Although that would be harder to do.

Edit*2
It would be like this. You can make the else part a common event.

◆If:Button [OK] is pressed down
◆Text:People2(6), Window, Bottom
: :HEY!! YOU!!
◆
:Else
◆Script:var e = $gameMap.event(this.eventId());
: :e.throughTimer = e.throughTimer||0;
: :e.throughTimer++;
◆If:Script:$gameMap.event(this.eventId()).throughTimer>10
◆Script:var e = $gameMap.event(this.eventId());
: :e.throughTimer = 0;
◆Set Movement Route:Player (Wait)
: :◇Through ON
: :◇1 Step Forward
: :◇Through OFF
◆
:End
◆
:End
View attachment 328812
You can do it like this.

Edit*
But the idea has a problem. If you want to talk to the npc who is on the right side of the player, the player has to turn toward him and so walks through him.
My suggestion is you add a timer so if the player keep pressing forward, say, 10 frames, he will walk through the event. Although that would be harder to do.
Mhm, there are some caveats to this....would there instead be a parallel event I could use to check if they're in the same place? And if so, the player is set to through until they're no longer in the same place?
Hmm you can try my new method from that updated post.
It works well enough to me.
I don't think paralell event is easier especially for multiple events.
Gotcha, makes sense!

And your method works well for me, I appreciate the help.
By the way you can also let the npc walk toward the player to make them switch position so they don't overlap. There can be minor problem for the followers you just need to try which method is better.
So if I'm understanding this right, you mean events as NPC's in a village, that you want the player to walk through but not the NPC's to be able to walk over everything?

Yeah when you said event it could have been anything.

So I recommend this.


So set the NPC's to below character so the player should be able to walk over them and the plugin would stop them from moving out of bounds.
If you don't mind using <walkThrough> in the Note field at the top of your event, you can try this as a plugin:
JavaScript:
// Overwrite event and player function to allow for player to walk through event
// without having the event walk through the player.

Game_Event.prototype.isCollidedWithPlayerCharacters = function(x, y) {
    if (this.event().meta.walkThrough) return $gamePlayer.isCollided(x, y);
    return this.isNormalPriority() && $gamePlayer.isCollided(x, y);
};

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.walkThrough)) {
                event.start();
            }
        });
    }
};

Set the event priority to "below characters" and the player will be able to walk through the event, but the event will not be able to walk through the player.

The other function allows the event to be triggered if it has the <walkThrough> meta tag in its Note field without having to be directly on the event to trigger it, just as if it were a normal, same-as-character priority event.

Original thread: https://forums.rpgmakerweb.com/threads/have-player-walk-through-events-but-disable-those-events-from-walking-through-player.174662/