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,460
Reaction score
15,911
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 Posts

Latest Profile Posts

So far, this is how the wall tileset its looking in-editor. :kaoswt2:
1631863283853.png
Still thinking on details to add.
Added a plugin to RMMV Plugin Releases with all relevant info but it looks like the topic wasn't approved for whatever reason. Cool.
Working in the IT industry:
- "How long does it take?".
- "It takes 1 month".
- "What if we add more people to the project?".
- "It would take 2 months".
Doing RPG Maker News for 16th September 2021

cant figure out how to change my pfp
ig im stuck as the question mark

Forum statistics

Threads
115,126
Messages
1,087,405
Members
149,615
Latest member
eugenevisions
Top