AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
I won't be linking both plugins because the issue is actually with a part of Yanfly's Row Formation not accounting for battler sprites that don't follow the default format.

Yanfly's Row Formation:
http://yanfly.moe/2016/01/02/yep-54-row-formation/

Look at the attached image, the first actor has a sprite sheet made to work with YED's Sideview Battler plugin, but is displaying incorrectly in the Row scene. I looked at the code inside of Yanfly's plugin and found this section here:
Code:
//=============================================================================
// Window_Base
//=============================================================================

Window_Base.prototype.drawSvActor = function(actor, x, y) {
    var filename = actor.battlerName();
    var bitmap = ImageManager.loadSvActor(filename);
    var pw = bitmap.width / 9;
    var ph = bitmap.height / 6;
    var sx = 0;
    var sy = 0;
    this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph);
};

The issue is that the first Actor's sheet doesn't follow the "width / 9, height / 6" format. I had an idea for a workaround which would be easier to implement than having to account for any kind of size. Would anyone know how to modify it so that instead of displaying the Actor's battler sprite in the Row change scene it would display their face instead?
 

Attachments

  • untitled.PNG
    untitled.PNG
    439.9 KB · Views: 77

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,464
Reaction score
15,913
First Language
Filipino
Primarily Uses
RMMZ
Code:
var filename = actor.battlerName();
var bitmap = ImageManager.loadSvActor(filename);

You need to change it so it checks the filename of the faceset and load the ImageManager for faceset instead :kaohi:
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Something like this?
Code:
Window_BattleStatus.prototype.drawFace = function(fn, fi, x, y, width, height) {
    width = width || Window_Base._faceWidth;
    height = height || Window_Base._faceHeight;
    var bitmap = ImageManager.loadFace(fn);
    var pw = Window_Base._faceWidth;
    var ph = Window_Base._faceHeight;
    var sw = Math.min(width, pw);
    var sh = Math.min(height, ph);
    var dx = Math.floor(x + Math.max(width - pw, 0) / 2);
    var dy = Math.floor(y + Math.max(height - ph, 0) / 2);
    var sx = fi % 4 * pw + (pw - sw) / 2;
    var sy = Math.floor(fi / 4) * ph + (ph - sh) / 2;
    this._faceContents.bitmap.blt(bitmap, sx, sy, sw, sh, dx, dy);
};
Taken from the Battle Status Window addon for Yanfly's Battle System.

Edit: I don't really code so I don't know exactly how to edit it.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,143
First Language
English
Primarily Uses
RMMV
Should be good to go with this, let me know if there are any issues.

2018-03-25 20_23_07-Test Project.png


Code:
//=============================================================================
// Yanfly Engine Plugins - Row Formation
// Patch to add an option to show the actor face in the row setup window.
// YEP_RowFormation_Patch_ActorFace.js
//=============================================================================


//=============================================================================
/*:
* @plugindesc Patch to YEP_RowFormation to give an option to show the actor
* face in the Row Formation setup window.
* @author Aloe Guvner, Yanfly Engine Plugins
*
* @param showFace
* @text Show Actor's Face?
* @type boolean
* @default false
* @desc Show the actor's face in the row setup window?
*
* @param cropFace
* @text Crop Face?
* @type boolean
* @desc Crop the Face Image to the size of the rectangle?
* @default false
*/
//=============================================================================

(function() {
   var params = PluginManager.parameters("YEP_RowFormation_Patch_ActorFace");
   var showFace = params["showFace"] === "true";
   var cropFace = params["cropFace"] === "true";

   var alias_Window_RowFormation_getImage = Window_RowFormation.prototype.getImage;
   Window_RowFormation.prototype.getImage = function(actor) {
      if (showFace) {
         return ImageManager.loadFace(actor.faceName());
      } else {
         return alias_Window_RowFormation_getImage.call(this, actor);
      }
   };

   var alias_Window_RowFormation_drawActorRowPosition = Window_RowFormation.prototype.drawActorRowPosition;

   Window_RowFormation.prototype.drawActorRowPosition = function(actor, index) {
      if (showFace) {
         var img = this.getImage(actor);
         var rect = this.rowRect(index, actor.row());
         var wx = Math.floor(rect.x);
         var wy = Math.floor(rect.y);
         if (cropFace) {
            this.drawActorFace(actor, wx, wy, rect.width, rect.height);
         } else {
            this.drawActorFace(actor, wx, wy);
         }
      } else {
         alias_Window_RowFormation_drawActorRowPosition.call(this, actor, index);
      }
   };

})();
 

Attachments

  • YEP_RowFormation_Patch_ActorFace.js
    2.2 KB · Views: 36

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Everything's good! I'll let you know if any issues arise. Thanks man!
 

dustyb13@gmx.com

Villager
Member
Joined
Mar 26, 2016
Messages
26
Reaction score
8
First Language
English
Primarily Uses
Is there any way to get this to work with SRD Character Creator?
When used together the characters show up bald and nude.
This patch plug in for faces works great just wondering if it
can be modified to show SV-Battlers with equipment like
it does the faces?
 
Last edited:

Latest Threads

Latest Profile Posts

Holy cow, I have made Row Formation work again with OTB!

Now, my devious machinations can finally be born...
finished the second chapter of deltarune today, I gotta say that the 3 years wait was worth it lol
Happy Friday, y'all! I just got home from work and am sitting down with a nice cider, and I'm ready to chill and enjoy myself. Not sure if I'm gonna dive into any of my game-related projects or not tonight.... we'll see how I feel after unwinding for a bit I guess!

Forum statistics

Threads
115,145
Messages
1,087,618
Members
149,670
Latest member
andreuuv
Top