Static Sideview Actor Image

Static Sideview Actor Image ver 1.0

by MechPen
​


Here is a small plugin that replaces sideview actor motions in favor of enemy-style blinks and flashes. The collapse effect traits even work!

Feature

- Load a single image into [SV] Battler:


Screenshots
handsome_ducks.png


How to Use

In the img\sv_actors folder, place your actor's battle image. it should be a single frame image much like sv_enemies. Select this image in the [SV] Battler: section. it will appear as a weird cut out rectangle in engine, but will look correct in game.


You can find the code On my github, but it has also been provided below just in case of bit rot. The license is MIT so do what you may.


Script
Spoiler: MechPen_StaticActor.js
JavaScript:
//=============================================================================
// MechPen_StaticActor.js
//=============================================================================
/*:
* @target MV
* @plugindesc v1.0 Static Actor Plugin
* @author MechPen
*
* @help MechPen_StaticActor.js
*
* This plugin removes the sideview actors' motions and replaces the sv_actor
* image frames with a single static image. You can even use the different
* collapse effects!
*
*-----------------------------------------------------------------------------
* How to use this plugin
*-----------------------------------------------------------------------------
* Install to your plugins folder and turn it on in the Plugin Manager.
* In the img\sv_actors folder, place your actor's battle image. it should be
* a single frame image much like sv_enemies.
* Select this image in the [SV] Battler: section. it will appear as a weird
* cut out rectangle in engine, but will look correct in game.
*
* Experiement with adding Collapse Effect Traits (under the Other tab). its fun!
*
*-----------------------------------------------------------------------------
* About the license of this plugin (License)
*-----------------------------------------------------------------------------
* This plugin is released under the MIT License.
*
*-----------------------------------------------------------------------------
* The released versions of this plugin (Change log)
*-----------------------------------------------------------------------------
* version 1.0
* - Basic functionality completed.
*/

(() => {

function Sprite_StaticActor() {
    this.initialize.apply(this, arguments);
}

Sprite_StaticActor.prototype = Object.create(Sprite_Enemy.prototype);
Sprite_StaticActor.prototype.constructor = Sprite_StaticActor;

Sprite_StaticActor.prototype.initialize = function(battler) {
    Sprite_Enemy.prototype.initialize.call(this, battler);
};

Sprite_StaticActor.prototype.initMembers = function() {
    Sprite_Enemy.prototype.initMembers.call(this);
    this.createStateSprite();
};

Sprite_StaticActor.prototype.createStateSprite = Sprite_Actor.prototype.createStateSprite;
Sprite_StaticActor.prototype.updateStateSprite = function() {}; // nothing.

Sprite_StaticActor.prototype.setActorHome = Sprite_Actor.prototype.setActorHome;

Sprite_StaticActor.prototype.setBattler = function(battler) {
    Sprite_Battler.prototype.setBattler.call(this, battler);
    var changed = (battler !== this._enemy);
    if (changed) {
        this._enemy = battler;
        if (battler) {
            this.setActorHome(battler.index());
        }
        this._stateSprite.setup(battler);
    }
};

Sprite_StaticActor.prototype.updateBitmap = function() {
    Sprite_Battler.prototype.updateBitmap.call(this);
    var name = this._enemy.battlerName();
    var hue = 0;
    if (this._battlerName !== name || this._battlerHue !== hue) {
        this._battlerName = name;
        this._battlerHue = hue;
        this.loadBitmap(name, hue);
        this.initVisibility();
    }
};

Sprite_StaticActor.prototype.initVisibility = function() {
    if (!$gameSystem.isSideView()) {
        this.opacity = 0;
    }
};

Sprite_StaticActor.prototype.loadBitmap = function(name, hue) {
    this.bitmap = ImageManager.loadSvActor(name, hue);
};

Spriteset_Battle.prototype.createActors = function() {
    this._actorSprites = [];
    for (var i = 0; i < $gameParty.maxBattleMembers(); i++) {
        this._actorSprites[i] = new Sprite_StaticActor();
        // if you want to flip your actor image, uncomment following line.
        //this._actorSprites[i].scale.x = -1;
        this._battleField.addChild(this._actorSprites[i]);
    }
};

var MechPen_Actor_performDamage = Game_Actor.prototype.performDamage;
Game_Actor.prototype.performDamage = function() {
    MechPen_Actor_performDamage.call(this);
    this.requestEffect('blink');
};

var MechPen_Actor_performActionStart = Game_Actor.prototype.performActionStart;
Game_Actor.prototype.performActionStart = function(action) {
    MechPen_Actor_performActionStart.call(this, action);
    this.requestEffect('whiten');
};

var MechPen_Actor_performCollapse = Game_Actor.prototype.performCollapse;
Game_Actor.prototype.performCollapse = function() {
    MechPen_Actor_performCollapse.call(this);
    if ($gameParty.inBattle()) {
        switch (this.collapseType()) {
        case 0:
            this.requestEffect('collapse');
            SoundManager.playEnemyCollapse();
            break;
        case 1:
            this.requestEffect('bossCollapse');
            SoundManager.playBossCollapse1();
            break;
        case 2:
            this.requestEffect('instantCollapse');
            break;
        }
    }
};

})();
// EOF

}
Thank you

But when I ran the new script, I got this error:

TypeError: sprite.refreshActorRow is not a function

at Spriteset_Battle.refreshRowPositions (YEP_RowFormation.js:2111:14)
at Spriteset_Battle.createLowerLayer (YEP_RowFormation.js:2103:10)
at Spriteset_Battle.Spriteset_Base.initialize (rpg_sprites.js:2128:10)
at Spriteset_Battle.initialize (rpg_sprites.js:2432:41)
at new Spriteset_Battle (rpg_sprites.js:2425:21)
at Scene_Battle.createSpriteset (rpg_scenes.js:2359:23)
at Scene_Battle.createSpriteset (YEP_RowFormation.js:2611:45)
at Scene_Battle.createDisplayObjects (rpg_scenes.js:2349:10)
at Scene_Battle.createDisplayObjects (YEP_RowFormation.js:2593:50)
at Scene_Battle.create (rpg_scenes.js:2240:10)

When I was testing the original plugin I turned off YEP_X_BattleSysSTB but kept YEP_RowFormation on. In that instance it seemed that YEP_X_BattleSysSTB was causing the issue since the original code does seem to work well with YEP_RowFormation, but now it seems that YEP_RowFormation is causing an issue of some sort.

Sorry about this, I wasn't trying to create more work for you. I was stoked you even responded to my original comment and am super grateful that you took the time to keep working on this.
Yeah Yanfly kind of changes a lot and doesn't much care about compatibility. What we can do is;

this plugin is complaining about refreshActorRow not existing. So let's try adding

Sprite_StaticActor.prototype.refreshActorRow = Sprite_Actor.prototype.refreshActorRow;

to the plugin. repeat until you stop getting "not a function" error and it either works or you get a different error.
I'm afraid I'm in a little over my head knowing where to add the line of code. I did try but kept getting the same error message.

Sorry about this; I'm still learning how to code.
ok. I'll see about adding yanfly compatibility.

I hit it with a big rock until it stopped crashing. Hopefully that gets you what you want. The edited script is below and not on Github because I'm not sure if I am going to support this or not.

Spoiler: The edited script
JavaScript:
//=============================================================================
// MechPen_StaticActor.js
//=============================================================================
/*:
* @target MV
* @plugindesc v1.1 Static Actor Plugin
* @author MechPen
*
* @help MechPen_StaticActor.js
*
* This plugin removes the sideview actors' motions and replaces the sv_actor
* image frames with a single static image. You can even use the different
* collapse effects!
*
*-----------------------------------------------------------------------------
* How to use this plugin
*-----------------------------------------------------------------------------
* Install to your plugins folder and turn it on in the Plugin Manager.
* In the img\sv_actors folder, place your actor's battle image. it should be
* a single frame image much like sv_enemies.
* Select this image in the [SV] Battler: section. it will appear as a weird
* cut out rectangle in engine, but will look correct in game.
*
* Experiement with adding Collapse Effect Traits (under the Other tab). its fun!
*
*-----------------------------------------------------------------------------
* About the license of this plugin (License)
*-----------------------------------------------------------------------------
* This plugin is released under the MIT License.
*
*-----------------------------------------------------------------------------
* The released versions of this plugin (Change log)
*-----------------------------------------------------------------------------
* version 1.1
* - a small amount of YEP compatibility.
* version 1.0
* - Basic functionality completed.
*/

(() => {

function Sprite_StaticActor() {
    this.initialize.apply(this, arguments);
}

Sprite_StaticActor.prototype = Object.create(Sprite_Enemy.prototype);
Sprite_StaticActor.prototype.constructor = Sprite_StaticActor;

Sprite_StaticActor.prototype.initialize = function(battler) {
    Sprite_Enemy.prototype.initialize.call(this, battler);
    this._actor = battler;
};

Sprite_StaticActor.prototype.initMembers = function() {
    Sprite_Enemy.prototype.initMembers.call(this);
    this.createStateSprite();
};

Sprite_StaticActor.prototype.createStateSprite = Sprite_Actor.prototype.createStateSprite;
Sprite_StaticActor.prototype.updateStateSprite = function() {}; // nothing.

Sprite_StaticActor.prototype.setActorHome = Sprite_Actor.prototype.setActorHome;

Sprite_StaticActor.prototype.setBattler = function(battler) {
    Sprite_Battler.prototype.setBattler.call(this, battler);
    var changed = (battler !== this._enemy);
    if (changed) {
        this._enemy = battler;
        this._actor = battler;
        if (battler) {
            this.setActorHome(battler.index());
        }
        this._stateSprite.setup(battler);
    }
};

Sprite_StaticActor.prototype.updateBitmap = function() {
    Sprite_Battler.prototype.updateBitmap.call(this);
    var name = this._enemy.battlerName();
    var hue = 0;
    if (this._battlerName !== name || this._battlerHue !== hue) {
        this._battlerName = name;
        this._battlerHue = hue;
        this.loadBitmap(name, hue);
        this.initVisibility();
    }
};

Sprite_StaticActor.prototype.initVisibility = function() {
    if (!$gameSystem.isSideView()) {
        this.opacity = 0;
    }
};

Sprite_StaticActor.prototype.loadBitmap = function(name, hue) {
    this.bitmap = ImageManager.loadSvActor(name, hue);
};

Spriteset_Battle.prototype.createActors = function() {
    this._actorSprites = [];
    for (var i = 0; i < $gameParty.maxBattleMembers(); i++) {
        this._actorSprites[i] = new Sprite_StaticActor();
        // if you want to flip your actor image, uncomment following line.
        //this._actorSprites[i].scale.x = -1;
        this._battleField.addChild(this._actorSprites[i]);
    }
};

var MechPen_Actor_performDamage = Game_Actor.prototype.performDamage;
Game_Actor.prototype.performDamage = function() {
    MechPen_Actor_performDamage.call(this);
    this.requestEffect('blink');
};

var MechPen_Actor_performActionStart = Game_Actor.prototype.performActionStart;
Game_Actor.prototype.performActionStart = function(action) {
    MechPen_Actor_performActionStart.call(this, action);
    this.requestEffect('whiten');
};

var MechPen_Actor_performCollapse = Game_Actor.prototype.performCollapse;
Game_Actor.prototype.performCollapse = function() {
    MechPen_Actor_performCollapse.call(this);
    if ($gameParty.inBattle()) {
        switch (this.collapseType()) {
        case 0:
            this.requestEffect('collapse');
            SoundManager.playEnemyCollapse();
            break;
        case 1:
            this.requestEffect('bossCollapse');
            SoundManager.playBossCollapse1();
            break;
        case 2:
            this.requestEffect('instantCollapse');
            break;
        }
    }
};

// YEP compatibiltiy.
if (Imported.YEP_RowFormation) {
    Sprite_StaticActor.prototype.refreshActorRow = Sprite_Actor.prototype.refreshActorRow;
    Sprite_StaticActor.prototype.alterActorHome = Sprite_Actor.prototype.alterActorHome;
    Sprite_StaticActor.prototype.moveToStartPosition = function() {}; // nothing.
    
    Sprite_Battler.prototype.setHome = function(x, y) {
        if (this._enemy && !this._actor) return this.setEnemyHome(this._enemy.index());
        this._homeX = x;
        this._homeY = y;
        this.updatePosition();
    };
}

})();
// EOF
Does this work on mz?
Never tried. can't hurt to try it out though. just remove it if it doesn't work.
I am however, overall not happy with the results. If I ever have more free time I hope to find a better way to do this.
when i try to get into a battle this error pops up and im not sure whats wrong or what to do..

Original thread: https://forums.rpgmakerweb.com/threads/static-sideview-actor-image.147954/