Hello!
I am currently using modern algebra's Extra Movement Frames Plugin which works perfectly except due to me using a larger spritesheet, the save files look kinda wonky. How do I make sure that only one sprite appears here? Thank you in advance!
EDIT: I meddled with the code and figured it out so problem solved! Thank you!
Code fix adapted from Galv's Character Frames plugin, full credit to him!!!! I only used this plugin instead because it had a function I needed
😅
I am currently using modern algebra's Extra Movement Frames Plugin which works perfectly except due to me using a larger spritesheet, the save files look kinda wonky. How do I make sure that only one sprite appears here? Thank you in advance!
EDIT: I meddled with the code and figured it out so problem solved! Thank you!
Code fix adapted from Galv's Character Frames plugin, full credit to him!!!! I only used this plugin instead because it had a function I needed
😅
Code:
// Draw Char in menus
ModernAlgebra.EMF.ModernAlgebra_Window_Base_drawCharacter = Window_Base.prototype.drawCharacter;
Window_Base.prototype.drawCharacter = function(characterName, characterIndex, x, y) {
var setFrame = characterName.match(/\%\((.*)\)/i);
if (setFrame) {
this._cframes = Number(setFrame[1]);
var f = this._cframes;
var bitmap = ImageManager.loadCharacter(characterName);
var big = ImageManager.isBigCharacter(characterName);
var pw = bitmap.width / (big ? f : f * 4);
var ph = bitmap.height / (big ? 4 : 8);
var n = characterIndex;
var sx = (n % 4 * 3 + 1) * pw;
var sy = (Math.floor(n / 4) * 4) * ph;
// Adjust sx to show the first frame
sx = 0;
this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph);
} else {
ModernAlgebra.EMF.ModernAlgebra_Window_Base_drawCharacter.call(this,characterName,characterIndex,x,y);
};
};
ModernAlgebra.EMF.SpriteCharacter_setCharacterBitmap = Sprite_Character.prototype.setCharacterBitmap;
Sprite_Character.prototype.setCharacterBitmap = function() {
var setFrame = this._characterName.match(/\%\((.*)\)/i);
if (setFrame) {
this._cframes = Number(setFrame[1]);
this._character._spattern = 0;
var f = this._cframes;
this._character._patSpd = eval(ModernAlgebra.EMF.y);
} else {
this._cframes = 3;
this._character._spattern = 1;
this._character._patSpd = 0;
};
this._character._cframes = this._cframes;
ModernAlgebra.EMF.SpriteCharacter_setCharacterBitmap.call(this);
};