I dont think theres much more to say its prettty straight forward i think but if theres a plugin i can do this with or a plugin that does exactly this then please tell me cause i really need this :kaosigh:
Heres an example:
/*:
* @target MV MZ
* @plugindesc Mirror actor battlers who are in the right-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/106255/
* @help Free to use and/or modify for any project, no credit required.
*/
void (function(alias) {
Sprite_Actor.prototype.updateMain = function() {
alias.apply(this, arguments);
if (this._homeX > Graphics.boxWidth / 2 && this.scale.x > 0)
this.scale.x *= -1;
};
})(Sprite_Actor.prototype.updateMain);/*:
* @target MV MZ
* @plugindesc v2 - mirror actor battlers when they are in the right-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @help Free to use and/or modify for any project, no credit required.
*/
void (function(alias) {
'use strict';
Sprite_Actor.prototype.updateMain = function() {
alias.apply(this, arguments);
const isOnRight = this._homeX > Graphics.boxWidth / 2;
if (isOnRight === !this._flippedX) {
this.scale.x *= -1;
this._flippedX = !this._flippedX;
}
};
})(Sprite_Actor.prototype.updateMain);/*:
* @target MV MZ
* @plugindesc v2 - mirror actor battlers when they are in the right-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @help Free to use and/or modify for any project, no credit required.
*/
void (function(alias) {
'use strict';
Sprite_Actor.prototype.updateMain = function() {
alias.apply(this, arguments);
const isOnRight = this._homeX > Graphics.boxWidth / 2;
if (isOnRight === !this._flippedX) {
this.scale.x *= -1;
this._flippedX = !this._flippedX;
}
};
})(Sprite_Actor.prototype.updateMain);/*:
* @target MV MZ
* @plugindesc v3 - mirror actor battlers when they are in the left-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @help Free to use and/or modify for any project, no credit required.
*/
void (function(alias) {
'use strict';
Sprite_Actor.prototype.updateMain = function() {
alias.apply(this, arguments);
const isOnLeft = this._homeX < Graphics.boxWidth / 2;
if (isOnLeft === !this._flippedX) {
this.scale.x *= -1;
this._flippedX = !this._flippedX;
}
};
})(Sprite_Actor.prototype.updateMain);[408, 100, 600, 100, 600][index]Graphics.boxWidth / 2 + 96 * (index + 0.5 - $gameParty.battleMembers().length / 2)spriteFaceForward/spriteFaceBackward methods. This might work?/*:
* @target MV MZ
* @plugindesc v4 - mirror actor battlers when they are in the left-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @orderAfter YEP_BattleEngineCore
* @help If using YEP_BattleEngineCore, load this plugin after Yanfly's.
*
* Free to use and/or modify for any project, no credit required.
*/
void (function() {
'use strict';
/**
* @param {Sprite_Actor} sprite reference actor sprite.
* @returns {boolean} `true` iff this plugin should flip `sprite`.
*/
const shouldActorBeFlipped = function(sprite) {
const faceFront = !sprite._faceBack;
const isOnLeft = sprite._homeX < Graphics.boxWidth / 2;
return faceFront === isOnLeft;
};
// Flip sprites when appropriate.
void (function() {
const alias = Sprite_Actor.prototype.updateMain;
Sprite_Actor.prototype.updateMain = function() {
alias.apply(this, arguments);
if (shouldActorBeFlipped(this) === !this._flippedX) {
this.scale.x *= -1;
this._flippedX = !this._flippedX;
}
};
})();
// YEP Battle Engine Core compatibility.
void (function() { if (!Imported.YEP_BattleEngineCore) return;
const alias_f = Game_Battler.prototype.spriteFaceForward;
Game_Battler.prototype.spriteFaceForward = function() {
alias_f.apply(this, arguments);
delete this.battler()._faceBack;
};
const alias_b = Game_Battler.prototype.spriteFaceBackward;
Game_Battler.prototype.spriteFaceBackward = function() {
alias_b.apply(this, arguments);
this.battler()._faceBack = true;
};
})();
})();spriteFaceForward/spriteFaceBackward methods. This might work?/*:
* @target MV MZ
* @plugindesc v4 - mirror actor battlers when they are in the left-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @orderAfter YEP_BattleEngineCore
* @help If using YEP_BattleEngineCore, load this plugin after Yanfly's.
*
* Free to use and/or modify for any project, no credit required.
*/
void (function() {
'use strict';
/**
* @param {Sprite_Actor} sprite reference actor sprite.
* @returns {boolean} `true` iff this plugin should flip `sprite`.
*/
const shouldActorBeFlipped = function(sprite) {
const faceFront = !sprite._faceBack;
const isOnLeft = sprite._homeX < Graphics.boxWidth / 2;
return faceFront === isOnLeft;
};
// Flip sprites when appropriate.
void (function() {
const alias = Sprite_Actor.prototype.updateMain;
Sprite_Actor.prototype.updateMain = function() {
alias.apply(this, arguments);
if (shouldActorBeFlipped(this) === !this._flippedX) {
this.scale.x *= -1;
this._flippedX = !this._flippedX;
}
};
})();
// YEP Battle Engine Core compatibility.
void (function() { if (!Imported.YEP_BattleEngineCore) return;
const alias_f = Game_Battler.prototype.spriteFaceForward;
Game_Battler.prototype.spriteFaceForward = function() {
alias_f.apply(this, arguments);
delete this.battler()._faceBack;
};
const alias_b = Game_Battler.prototype.spriteFaceBackward;
Game_Battler.prototype.spriteFaceBackward = function() {
alias_b.apply(this, arguments);
this.battler()._faceBack = true;
};
})();
})();/*:
* @target MV MZ
* @plugindesc v5 - mirror actor battlers when they are in the left-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @orderAfter YEP_BattleEngineCore
* @help Should be loaded after YEP_BattleEngineCore.
*
* Free to use and/or modify for any project, no credit required.
*/
void (function() {
'use strict';
// Require YEP Battle Engine Core.
if (!Imported.YEP_BattleEngineCore)
throw new Error(
"This plugin should be loaded after YEP_BattleEngineCore.\nPress F12 for details."
);
// Anti-mirror when on left.
void (function() {
const alias = Game_Battler.prototype.setMirror;
Game_Actor.prototype.setMirror = function(value) {
alias.call(this, value !== this.battler()._homeX < Graphics.boxWidth / 2);
};
})();
// Face "forward" on battle start.
void (function() {
const alias = Game_Battler.prototype.onBattleStart;
Game_Actor.prototype.onBattleStart = function() {
this.spriteFaceForward();
alias.apply(this, arguments);
};
})();
})();/*:
* @target MV MZ
* @plugindesc v5 - mirror actor battlers when they are in the left-hand half of the screen.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/156765/
* @orderAfter YEP_BattleEngineCore
* @help Should be loaded after YEP_BattleEngineCore.
*
* Free to use and/or modify for any project, no credit required.
*/
void (function() {
'use strict';
// Require YEP Battle Engine Core.
if (!Imported.YEP_BattleEngineCore)
throw new Error(
"This plugin should be loaded after YEP_BattleEngineCore.\nPress F12 for details."
);
// Anti-mirror when on left.
void (function() {
const alias = Game_Battler.prototype.setMirror;
Game_Actor.prototype.setMirror = function(value) {
alias.call(this, value !== this.battler()._homeX < Graphics.boxWidth / 2);
};
})();
// Face "forward" on battle start.
void (function() {
const alias = Game_Battler.prototype.onBattleStart;
Game_Actor.prototype.onBattleStart = function() {
this.spriteFaceForward();
alias.apply(this, arguments);
};
})();
})();