Is there a way to adjust the length of the HP/MP/TP bars when increasing the total number of battlers from 4 to 5?
MZ 5 battlers with Visustella Party System
Javascript/Plugin SupportThat seems like an odd thing for VisuStella to have overlooked. If I were you I'd double-check the plugin parameters for any settings related to this kind of thing (gauges, battle status, etc).
Otherwise: I haven't tested, but something like this might work?
Otherwise: I haven't tested, but something like this might work?
JavaScript:
/*:
* @target MZ
* @plugindesc Change gauge width based on battle party size.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/173883/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (() => {
"use strict";
/** `true` iff gauge width should only be adjusted in battle. @type {boolean} */
const IS_ONLY_BATTLE = true;
/** `true` iff default gauge width is the maximum width. @type {boolean} */
const IS_DFAULT_MAX = true;
/** Default member count (affects gauge scaling). @type {number} */
const DFAULT_COUNT = 4; // 4
/** @returns {number} Member count for gauge scaling purposes. */
const count = function() { return $gameParty.maxBattleMembers(); };
/**
* @param {number} w Original gauge width.
* @returns {number} Adjusted gauge width.
*/
const adjust = function(w) {
const m = count();
if (IS_DFAULT_MAX && DFAULT_COUNT >= m)
return w;
return Math.round(w * DFAULT_COUNT / m);
};
// Patch - adjust gauge width on init.
const alias = Sprite_Gauge.prototype.bitmapWidth;
Sprite_Gauge.prototype.bitmapWidth = IS_ONLY_BATTLE ? function() {
const w = alias.apply(this, arguments);
return SceneManager._scene instanceof Scene_Battle ? adjust(w) : w;
} : function() {
return adjust(alias.apply(this, arguments));
};
})();
Original thread: https://forums.rpgmakerweb.com/threads/5-battlers-with-visustella-party-system.173883/