How to swap actor sprite with enemies?

Bowtirage

Villager
Member
Joined
May 12, 2016
Messages
22
Reaction score
1
First Language
English
Primarily Uses
I know that you can use an actor sprite as an enemy but what if for example you wanted to use a static image of an orge as your battler image during a fight instead of a sprite actor?
Is this possible?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
It's absolutely possible, though it would require some changes to the battler sprite classes.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
I don't have the time to do the whole thing for you, but a good place to start looking is rpg_sprites.js, around line 787 (the updateBitmap function of Sprite_Actor)
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
I came up with a quick plugin that should do what you need. You just need to copy/paste the monster image to the sv_actors folder and add a reference to its filename in the _url.match() part
PHP:
Sprite_Actor.prototype.updateFrame = function() {
   var monster = this._mainSprite.bitmap._url.match(/Behemoth|Fairy/) !== null; // add monster reference here
    Sprite_Battler.prototype.updateFrame.call(this);
    var bitmap = this._mainSprite.bitmap;
    if (bitmap) {
        var motionIndex = this._motion ? this._motion.index : 0;
        var pattern = this._pattern < 3 ? this._pattern : 1;
        var cw = monster ? bitmap.width : bitmap.width / 9;
        var ch = monster ? bitmap.height : bitmap.height / 6;
        var cx = monster ? 0 : Math.floor(motionIndex / 6) * 3 + pattern;
        var cy = monster ? 0 : motionIndex % 6;
        this._mainSprite.setFrame(cx * cw, cy * ch, cw, ch);
    }
};
For instance I'm using Behemoth.png and Fairy.png in my actors folder here.
 

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

Latest Threads

Latest Profile Posts

This is relevant so much I can't even!
Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect

Forum statistics

Threads
105,999
Messages
1,018,221
Members
137,778
Latest member
br11an
Top