HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
99
Reaction score
37
First Language
English
Primarily Uses
RMMV
Looking for a plugin that allows tagged events to pass through each other, but not through untagged events. For example, let's say you have 2 events, and each of them has the comment <passable>, then those two events would pass through each other as if they had Through turned on, but they wouldn't pass through events that didn't have that comment, or through impassable tiles (or regions if you're using Region Restrictions).

Of course there are other ways to do it, that's just an example. I've played several games where the guards just pass through each other as they patrol back and forth, but of course they have to go around buildings and objects. It would be great for something like that. Hoping someone knows of a plugin that does this. Thank you.

EDIT: Or, alternatively, a plugin that makes certain regions impassable to events that have "Through" on. That would also work.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,238
Reaction score
1,201
First Language
English
Primarily Uses
RMMV
Code:
Game_Event.prototype.isCollidedWithEvents = function(x, y) {
    var events = $gameMap.eventsXyNt(x, y);
    return $dataMap.events[this._eventId].meta["passable"] && events.length>0 ?  !events.some(event => $dataMap.events[event._eventId].meta["passable"]) : events.length>0;
};
The events will be able to pass through each other IFF both have the <passable> notetag.
 

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
99
Reaction score
37
First Language
English
Primarily Uses
RMMV
@ATT_Turan Wow, thank you!!! Seems to work perfectly, and totally solves my problem. I really appreciate it. And I'm surprised it's so short.
 

Latest Threads

Latest Posts

Latest Profile Posts

About the Deer, I had to cut some piece of video due the *swearing* Youtube copyrights issues...
A caveman pokes his head in...
I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.

Forum statistics

Threads
116,002
Messages
1,094,770
Members
151,302
Latest member
jabajav01
Top