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,472
Reaction score
15,920
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,145
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 Posts

Latest Profile Posts

BCj
Got another eye surgery monday. Hope I'll recover quick and all's well. A bit tired of surgeries. On a happy note, working on the next chapter of Escalia so hope I can continue soon :)
Celebrating the arrival of autumn in the Northern Hemisphere :)
When doing a map or whatever, kind of wish you could round out some parts.
Glad to announce:
Released a plugin mod for MV: SelectMultipleTargets v3.0 (mod of original by Zevia)

port to MZ is following

Forum statistics

Threads
115,356
Messages
1,089,250
Members
150,047
Latest member
skarndever
Top