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
1,483
Reaction score
986
First Language
English
Primarily Uses
It's absolutely possible, though it would require some changes to the battler sprite classes.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
1,483
Reaction score
986
First Language
English
Primarily Uses
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
876
Reaction score
581
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 Posts

Latest Profile Posts

"stats" in game term is short for "statistic", yet people keep referring it as "status".... =_=
i watched the sonic movie it was pretty good i hope they make a sequel
tomorrow I'ma go on a cruise for the first time ever... lets hope I'll survive the experience!
Omg! 8 years in this forum :o
Ksi
Streaming the last of the RMN Valentiny event games so feel free to drop on by and watch me cry (whether that's from laughter, rage or sheer pain, who knows?)

Forum statistics

Threads
94,322
Messages
919,896
Members
124,068
Latest member
MistaCG
Top