MV How to create a dynamic party portrait from equipped "warriors" (custom equipment system)

Hi everyone,

I'm working on a unique mechanic in my game and need help with the visual side. I hope someone can point me in the right direction.

Core mechanic:
Instead of traditional weapons/armor, I use YEP_EquipCore to let a single actor (the "party") equip warriors (berserker, archer, giant, etc.) into 8 equipment slots. All warriors are created as armor with the same equipment type ID (e.g., ID 2). This works fine: stats sum up, and I can equip/unequip them.

What I need:
I want the player to see their party visually:

  1. Portrait in menus and battle: Replace the actor's standard face with a single composite portrait dynamically generated from small icons representing the warriors currently equipped in the 8 slots.
  2. Positioning: Icons should be arranged in a grid (e.g., 2 rows × 4 columns). Empty slots show nothing.
  3. Updating: The portrait should update whenever the party composition changes (e.g., after closing the equip menu).
What I've tried:

  • I tried using the "Control Variables → Game Data" event command, but I couldn't find an option that returns the ID of an equipped item (only inventory counts).
  • I attempted scripts like $gameActors.actor(1).equips()[0].object.id to store IDs in variables. It works on the map, but in battle events or common events called from the menu, the variables remain 0 even though items are equipped . I suspect I'm missing something about execution context.
  • The main roadblock: I can't reliably get the IDs of equipped warriors into variables (1–8) to then use conditional branches to show different pictures.
My questions:

  1. What is the proper, stable way to retrieve the item IDs from all 8 equipment slots into variables (e.g., variables 1–8)? I need an event or script that runs when closing the equip menu and before battle starts.
  2. Is there a plugin or approach you'd recommend for dynamically composing a single portrait from these variables? I've heard about layered graphics plugins (like SAN_ActorGraphicsReactor), but I'm not sure they can combine 8 independent pieces.
  3. Alternatively, would it be simpler to just show the warrior icons as separate pictures on the battle screen via "Show Picture" commands and update them through a common event? If so, what's the best way to ensure these pictures update correctly when switching actors in battle?
Any advice, plugin names, or script snippets would be greatly appreciated. I can provide more details if needed.

Thanks in advance!
Isnt't the script just $gameActors.actor(1).equips()[0].id (put it in conditional where you first check that the index returns something, before checking id). What you wrote shouldn't give anything, I think.

I think you can just edit the draw methods to draw your images instead of the face graphic, like
Window_MenuStatus.prototype.drawActorFace and then I guess you're using Yanfly BattleStatusWindow, so the draw methods there. Put the faces on your icon sheet and then use the blt stuff to draw them on the window depending on your actor 1 equips.
  • Getting all of the actor's equips is just $gameActors.actor(1).equips() and then append [0].id, [1].id etc as needed.
  • drawActorFace is in Window_Base, so you could override it just once and it'll work in every window that draws a face.
Cool, yeah I meant isn't the script like that compared to what they wrote. Sure they need the different indexes. And true with the drawActorFace. I was thinking more of that drawFace that has the actual draw codes and which would mess with your message window faces if you edited it for everything, I think.
I think the way I'd do this is to just have drawActorFace draw 3 different "face" graphics – the actual face, the clothing, and the headgear. In other words, it calls drawFace 3 times.
Hmmm, did you mix this thread with something else? They wanted to represent the dudes.
Something like this should work (though you might want to change x and y and sizes):

Window_MenuStatus.prototype.drawFace = function() {
var equips = $gameActors.actor(1).equips();
var bitmap = ImageManager.loadSystem('IconSet');
var pw = Window_Base._iconWidth;
var ph = Window_Base._iconHeight;
var dx = 0;
var dy = 0;
equips.forEach ((equip, index) => {
if (equip) {
var sx = $gameActors.actor(1).equips()[index].id % 16 * pw;
var sy = Math.floor($gameActors.actor(1).equips()[index].id / 16) * ph;
this.contents.blt(bitmap, sx, sy, pw, ph, dx, dy, pw, ph);
}
dx += pw;
if (index === 3) dx = 0;
if (index === 3) dy = ph;
});
};
I made squad icons appear in the portrait menu and battle portrait based on equipped equipment and variables.
When the menu is closed, a plugin event is triggered. It would be preferable to have them change immediately as soon as units are equipped, rather than after the menu is closed, or at least after the equipment is closed.

/*:
* @plugindesc Calls a general event when the equipment scene is closed.
* @param equipEventId
* @desc Common event ID
* @Default 2
*/
(function() {
var param = PluginManager.parameters('CallCommonEventOnClose');
var eventId = Number(param['equipEventId'] || 2);
var _Scene_Equip_terminate = Scene_Equip.prototype.terminate;
Scene_Equip.prototype.terminate = function() {
_Scene_Equip_terminate.call(this);
$gameTemp.reserveCommonEvent(eventId);
};
})();

Now a plugin for the battle portrait and menu.

/*:
* @plugindesc Displays unit sprites for party members (indices 0–3). Bottom-aligned. * @Help
* Sprites: img/pictures/1.png, 2.png, etc. (by unit ID).
* For the first party member (index 0), variables 1–8 are used.
* Index 1 → variables 11–18
* Index 2 → 21–28
* Index 3 → 31–38
* Adjust the parameters to suit your interface.
*/

(function() {
// General settings
var startY = 0; // Vertical offset (adjust)
var overlapFactor = 0.33; // Overlap ~2/3
var baseVars = [1, 11, 21, 31]; // Base for each party index
var slotsPerActor = 8;

// Separate settings for menu and battle
var menuSettings = {
startX: 0, // <-- CHANGED: no longer offset to the left
bottomOffset: 2 // Offset from the bottom edge of the face area
};
var battleSettings = {
startX: -180, // Leave as is for battle
bottomOffset: 2
};

function getItemId(actorIndex, slot) {
return $gameVariables.value(baseVars[actorIndex] + slot);
}

function drawPartySprites(win, actor, x, y, width, height, settings) {
var actorIndex = actor.index();
if (actorIndex < 0 || actorIndex >= baseVars.length) return;
win.contents.clearRect(x, y, width, height);
var dx = x + settings.startX;
var bottomY = y + height - settings.bottomOffset;

for (var i = 0; i < slotsPerActor; i++) {
var itemId = getItemId(actorIndex, i);
if (itemId > 0) {
var bitmap = ImageManager.loadPicture(String(itemId));
if (bitmap && bitmap.isReady()) {
var drawY = bottomY - bitmap.height;
win.contents.blt(bitmap, 0, 0, bitmap.width, bitmap.height, dx, drawY, bitmap.width, bitmap.height);
dx += bitmap.width * overlapFactor;
} else {
// If the image is not loaded, schedule a window repaint
if (!win._pendingRefresh) {
win._pendingRefresh = setTimeout(function() {
win.refresh();
win._pendingRefresh = null;
}, 200);
}
dx += 30; // fallback offset
}
}
}
}

// Override face drawing in the menu status window
var _Window_MenuStatus_drawActorFace = Window_MenuStatus.prototype.drawActorFace;
Window_MenuStatus.prototype.drawActorFace = function(actor, x, y, width, height) {
if (actor && actor.index() >= 0 && actor.index() < baseVars.length) {
drawPartySprites(this, actor, x, y, width, height, menuSettings);
} else {
_Window_MenuStatus_drawActorFace.call(this, actor, x, y, width, height);
}
};

// Same for the status window in battle
var _Window_BattleStatus_drawActorFace = Window_BattleStatus.prototype.drawActorFace;
Window_BattleStatus.prototype.drawActorFace = function(actor, x, y, width, height) {
if (actor && actor.index() >= 0 && actor.index() < baseVars.length) {
drawPartySprites(this, actor, x, y, width, height, battleSettings);
} else {
_Window_BattleStatus_drawActorFace.call(this, actor, x, y, width, height);
}
};
})();

And a general event script for checking equipped equipment

// Update variables for the current party composition
var party = $gameParty.allMembers();
var baseVars = [1, 11, 21, 31];
for (var i = 0; i < party.length; i++) {
var actor = party;
for (var slot = 0; slot < 8; slot++) {
var item = actor.equips()[slot];
var varId = baseVars + slot;
$gameVariables.setValue(varId, item ? item.id : 0);
}
}

Now we need to make the same units appear in battle, but each small unit also needs a 3-frame animation.

I was considering using the VPlayer plugin, but it might slow down due to the large number of web files.

How it looks in the game:
Halloa, any ideas?
I think the way I'd do this is to just have drawActorFace draw 3 different "face" graphics – the actual face, the clothing, and the headgear. In other words, it calls drawFace 3 times.
Any ideas?
Hmmm, did you mix this thread with something else? They wanted to represent the dudes.
Something like this should work (though you might want to change x and y and sizes):

Window_MenuStatus.prototype.drawFace = function() {
var equips = $gameActors.actor(1).equips();
var bitmap = ImageManager.loadSystem('IconSet');
var pw = Window_Base._iconWidth;
var ph = Window_Base._iconHeight;
var dx = 0;
var dy = 0;
equips.forEach ((equip, index) => {
if (equip) {
var sx = $gameActors.actor(1).equips()[index].id % 16 * pw;
var sy = Math.floor($gameActors.actor(1).equips()[index].id / 16) * ph;
this.contents.blt(bitmap, sx, sy, pw, ph, dx, dy, pw, ph);
}
dx += pw;
if (index === 3) dx = 0;
if (index === 3) dy = ph;
});
};
Any ideas?

Original thread: https://forums.rpgmakerweb.com/threads/how-to-create-a-dynamic-party-portrait-from-equipped-warriors-custom-equipment-system.182556/