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

Joined
Mar 2, 2020
Messages
2
Reaction score
0
First Language
French
Primarily Uses
RMMV
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?
 
Last edited:

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,423
Reaction score
4,480
First Language
English
Primarily Uses
RMMV

I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Garund

Warper
Member
Joined
Jul 15, 2020
Messages
4
Reaction score
0
First Language
French
Primarily Uses
RMMV
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;
        }
 

Attachments

Last edited:

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,113
Reaction score
517
First Language
English
Primarily Uses
RMMV
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.
 

Garund

Warper
Member
Joined
Jul 15, 2020
Messages
4
Reaction score
0
First Language
French
Primarily Uses
RMMV
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.
 

Garund

Warper
Member
Joined
Jul 15, 2020
Messages
4
Reaction score
0
First Language
French
Primarily Uses
RMMV
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) :
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
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 :
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 !
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,611
Messages
977,827
Members
132,227
Latest member
YourBaka
Top