YED Sideview Battler using $gameActors.actor(id).battlerName() for filename

Hi there,

I'm using the YED Sideview Battler plugin and there is something I would like to do, but didn't found a way yet.

To have the plugin working properly, we have to call the filename in the actor's note <Sideview Battler: 'Filename'> but is it possible to have it use the actor's default battler image as name.

The point is that, some events are changing my actor appearance in the game and the battler's image was changed with it, but YED sideview battler plugin uses a fixed filename. If I have it use the default, the sprites doesn't react properly.

Do someone knows a way around this?

I've moved this thread to Javascript/Plugin Support. Thank you.

Hi,

Did you find any answer since you posted that ? I have the same request.

After a few tests, some things are encouraging. Here is the part of the code that I try to modify (not a script expert, just tried to read).
1. If I replace FILENAME: /<Sideview Battler:[ ]*(.*)>/i, by FILENAME: /<Sideview Battler Default>/i,
- so the script take the default MV Name.
2. If I change default Battler "in-game", the script reload the new Battler's name before battle (so that's good)
3. But when the script take Battler Default, it refuses to apply other operations like taking other notetags in count and apply 'resize', etc. I suppose there is a kind of 'if battler name is default then skip the script...' but I couldn't find it for now..

Anyone can help ?


JavaScript:
(function($SideviewBattler) {
... - here is just a part that seems interesting - ... 
/**
     * Enum for RegExp, used to notetags
     *
     * @readonly
     * @enum {RegExp}
     * @memberof YED.SideviewBattler
     */
    var Regexp = {
        /**
         * Filename for battler
         */
        FILENAME: /<Sideview Battler:[ ]*(.*)>/i,

        /**
         * Default type of set for battler
         */
        DEFAULT_TYPE: /<Sideview Battler Default>/i,

        /**
         * Default frames
         */
        FRAMES: /<Sideview Battler Frames:[ ]*(\d+)>/i,
        ... - etc ...


Here is another very interesting part :
JavaScript:
/**
     * Process notetag for object.
     *
     * @function _processNotetag
     * @memberof YED.SideviewBattler.Utils
     * @param  {Object} obj Data object
     * @param  {String} notetag Notetag
     * @private
     */
    Utils._processNotetag = function(obj, notetag, helpers) {
        var sideviewBattler = obj._sideviewBattler,
            match,
            motion;

        match = notetag.match(Regexp.FILENAME);
        if (match) {
            sideviewBattler.filename = String(match[1]);
        }

        match = notetag.match(Regexp.DEFAULT_TYPE);
        if (match) {
            sideviewBattler.default = true;
        }
By chance are you also using YEP animated SV enemies plugin? If so there is a compatibility issue between the two not displaying proper sprite. Link to the compatibility fix is here.

If that happens to not be the issue, my apologies. I've never used the YED Sideview battler plugin, so I can't offer any other help there.
Yes I already fixed this problem. But that's not what I'm looking for. Thank you anyway 😉 - maybe it's related cause it concerns the size too. I'm gonna keep trying.
YAHOU - I found a solution !

I'm no scripter so I can't garantee that it won't create other problems. But I run some tests and it seems fine :
- The YED plugin uses Battler Default Sprite for Actors
- The YED plugin uses your other notetag informations (size, frames, etc) - no problem if it's empty
- You can change Battler of an Actor IN-game and IN-Battle - by using regular commands of RPG MAKER MV
Attention :
the only limit to this is if you want to change your Battle Default Sprite, it must have the same dimensions, same frames, same frames-sizes, same moves, etc
Possibilities : thanks to this, you can change Battler whenever you want so if you want your actor to wear another outfit, carry another weapon, have another behavior or state (hurted, furious, undead, ...)

In the YED Sideview Battle plugin, LOOK FOR this part (lign 646 to 660 in the original script) :
Spoiler: YED Sideview Battle plugin - part to modify
JSON:
(function() {
    /**
     * Aliasing methods
     */
    var _Game_Actor_battlerName
        = Game_Actor.prototype.battlerName;

    Game_Actor.prototype.battlerName = function() {
        if (this.isSideviewBattler()) {
            return this.getSideviewFilename();
        }

        return _Game_Actor_battlerName.call(this);
    };
}());

AND REPLACE BY THIS
Spoiler: YED Sideview Battle plugin - modification
Code:
(function() {
    /**
     * Aliasing methods
     */
    var _Game_Actor_battlerName
        = Game_Actor.prototype.battlerName;

    Game_Actor.prototype.battlerName = function() {
        if (this.isSideviewBattler()) {
            return _Game_Actor_battlerName.call(this);
        }

        return _Game_Actor_battlerName.call(this);
    };
}());

---

Finally for ennemies sprite issues, i recommand this part of the code (not mine but I forgot the author) to copy just right above the part that I suggested to modify :
Spoiler: YED-YEP AnimatedEnnemies Compatibility custom change
Put this inside the plugin Yed Sideview Battle plugin, inside the function Game_Battler...etc (just after lign 643)
JSON:
var _Game_Battler_spriteWidth = Game_Battler.prototype.spriteWidth;
    Game_Battler.prototype.spriteWidth = function() {
    
        if (this.isSideviewBattler()) {
            if (Imported.YEP_X_AnimatedSVEnemies) {
                    var frameSizes = this.getSideviewSizes();
                    var cw = frameSizes[0];
                    return cw;
            }
        }
        return _Game_Battler_spriteWidth.call(this);
    };
 
    var _Game_Battler_spriteHeight = Game_Actor.prototype.spriteHeight;
    Game_Battler.prototype.spriteHeight = function() {
        if (this.isSideviewBattler()) {
            if (Imported.YEP_X_AnimatedSVEnemies) {
                    var frameSizes = this.getSideviewSizes();
                    var ch = frameSizes[1];
                    return ch;
            }
        }
        return _Game_Battler_spriteHeight.call(this);
    };

I hope it will be usefull to you !

Original thread: https://forums.rpgmakerweb.com/threads/yed-sideview-battler-using-gameactors-actor-id-battlername-for-filename.119791/