HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
101
Reaction score
38
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,272
Reaction score
1,228
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
101
Reaction score
38
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 Profile Posts

Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead
I'm so annoyed with myself...I can't get this code to work so it looks like I'm going the plugin route for a problem I should be able to do myself :kaolivid:Great. Now I get to murder save file compatibility. Again.
Can't believe my code from four years ago is still working! Did some expansions, and...
1635194553179.png
In related news, I may have an update for my old Extra status window plugin ready. That is, once I manage to sit down and update the documentation... and the demo project... :kaoswt:

Forum statistics

Threads
116,079
Messages
1,095,574
Members
151,450
Latest member
Dankim633
Top