Hi, I'm requesting a plug-in that would allow monsters to pass through each other while still affecting the player-character. I've heard it can't be done. 🙂
Thanks for responding!
Thanks for responding!
/*:
* @plugindesc Allows monsters to walk through each other
* @author Shaz
*
* @help This plugin does not provide plugin commands.
*
* Any event using a character sheet with "monster" in the name will be able to walk through
* any other event using a character sheet with "monster" in the name.
*/
(function() {
Game_CharacterBase.prototype.isCollidedWithEvents = function(x, y) {
var events = $gameMap.eventsXyNt(x, y);
return events.some(function(event) {
return event.isNormalPriority() && (!this.isMonster() || !event.isMonster());
}.bind(this));
};
Game_CharacterBase.prototype.isMonster = function() {
return this._isMonster;
};
var Game_CharacterBase_setImage = Game_CharacterBase.prototype.setImage;
Game_CharacterBase.prototype.setImage = function(characterName, characterIndex) {
Game_CharacterBase_setImage.call(this, characterName, characterIndex);
this._isMonster = /monster/i.exec(characterName);
};
})();
/*:
* @plugindesc Allows monsters to walk through each other
* @author Shaz
*
* @help This plugin does not provide plugin commands.
*
* Any event using a character sheet with "monster" in the name will be able to walk through
* any other event using a character sheet with "monster" in the name.
*/
(function() {
Game_CharacterBase.prototype.isMonster = function() {
return this._isMonster;
};
var Game_CharacterBase_setImage = Game_CharacterBase.prototype.setImage;
Game_CharacterBase.prototype.setImage = function(characterName, characterIndex) {
Game_CharacterBase_setImage.call(this, characterName, characterIndex);
this._isMonster = /monster/i.test(characterName);
};
Game_Event.prototype.isCollidedWithEvents = function(x, y) {
var events = $gameMap.eventsXyNt(x, y);
return events.some(function(event) {
return !event.isMonster() || !this.isMonster();
}.bind(this));
};
})();
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/make-monsters-pass-through-each-other-while-still-affecting-player-character.86399/