Hello! I was searching for a plugin that would allow me to do like the title says: a "Float" state effect that makes the target float in mid-air. During my research i found this plugin (https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/BattlerGraphicExtend.js) that permits me to do just that. Sadly, i the plugin description specifies that the floating effect works only on battlers, and not enemies. So i tried to add my own function in the plugin to implement this, but i admit to have no idea how to do this. Could someone help me out...
Hello! I was searching for a plugin that would allow me to do like the title says: a "Float" state effect that makes the target float in mid-air. During my research i found this plugin (
https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/BattlerGraphicExtend.js) that permits me to do just that. Sadly, i the plugin description specifies that the floating effect works only on battlers, and not enemies. So i tried to add my own function in the plugin to implement this, but i admit to have no idea how to do this.
Could someone help me out in this? Thanks in advance!
EDIT: I think i've found a solution! Place this at the bottom of the plugin, where the Sprite_Enemy functions are located:
Code:
var _Sprite_Enemy_updatePosition = Sprite_Enemy.prototype.hasOwnProperty('updatePosition') ?
Sprite_Enemy.prototype.updatePosition : null;
Sprite_Enemy.prototype.updatePosition = function() {
if (_Sprite_Enemy_updatePosition) {
_Sprite_Enemy_updatePosition.apply(this, arguments);
} else {
Sprite_Battler.prototype.updatePosition.call(this);
}
var altitude = this._battler.getAltitude();
this._offsetY = altitude;
};
Hope it helps ^^
EDIT2: Ok, now another problem arises. I noticed that when an actor is affected by a State, the state's icon won't follow the actor's new position while floating, remaining in the original place. So i tried to change the code for actor sprites:
Code:
var _Sprite_Actor_updatePosition = Sprite_Actor.prototype.hasOwnProperty('updatePosition') ?
Sprite_Actor.prototype.updatePosition : null;
Sprite_Actor.prototype.updatePosition = function() {
if (_Sprite_Actor_updatePosition) {
_Sprite_Actor_updatePosition.apply(this, arguments);
} else {
Sprite_Battler.prototype.updatePosition.call(this);
}
var altitude = this._battler.getAltitude();
this._mainSprite.y = altitude;
this._weaponSprite.y = altitude;
this._stateSprite.y = altitude;
this._stateIconSprite.y = altitude;
};
And i thought that i could simply add the altitude value to StateSprite and StateIconSprite. This, however, doesn't do anything, and even if their y parameter is changed, their position remains the same.