The Pyramid Bug is a bit complex, but it's possible to fix it and prevent the game from crashing at least until you get out of the dungeon.
Here is the complete, consolidated guide in English containing all the code and step-by-step instructions needed to fix and manage the party-switching mechanic in Final Fantasy Blackmoon Prophecy.
🛡️ Complete Guide: Fixing Dungeon Party-Switching Crashes (RPG Maker MV)
📌 Issue Summary
The dungeon's native event script injects null or undefined values into $gameParty._actors during group transitions. This causes the engine to throw fatal errors when checking for alive members (isAlive of null) or when YEP plugins attempt to render party status in menus (isBattleMember of null). Additionally, standard addActor commands caused party compositions to leak into one another.
🚀 Step-by-Step Fix Protocol
Step 1: Inject Patches & Group Manager
Whenever you start the game or load your save in the dungeon, press F12 to open the Developer Console, paste the entire script below into the console, and press Enter:
JavaScript
// =================================================================
// 1. DEFINING EXACT PARTY COMPOSITIONS
// =================================================================
window.membrosGrupo1 = [1, 3, 8, 6];
window.membrosGrupo2 = [5, 4, 10, 9];
// =================================================================
// 2. ISOLATED PARTY SWITCHER & SYNCHRONIZER
// =================================================================
window.carregarGrupo = function(numeroGrupo) {
var idsDesejados = (numeroGrupo === 1) ? window.membrosGrupo1 : window.membrosGrupo2;
// Set exact actor list for the target party
$gameParty._actors = [...idsDesejados];
// Heal and activate all members for battle
$gameParty._actors.forEach(id => {
var actor = $gameActors.actor(id);
if (actor) {
actor.recoverAll();
}
});
// Sanitize duplicate or null slots
$gameParty._actors = Array.from(new Set($gameParty._actors)).filter(id => id && $gameActors.actor(id));
// Refresh player sprite and map status
$gamePlayer.refresh();
if ($gameMap) $gameMap.requestRefresh();
console.log("⚔️ Party " + numeroGrupo + " successfully synchronized:", $gameParty._actors);
};
// =================================================================
// 3. ENGINE PROTECTIONS (RUNTIME MEMORY PATCHES)
// =================================================================
// Fix 1: Prevent 'isAlive of null' crash during party switch checks
Game_Unit.prototype.aliveMembers = function() {
return this.members().filter(function(member) {
return member && typeof member.isAlive === 'function' && member.isAlive();
});
};
// Fix 2: Prevent 'isBattleMember of null' crash when rendering the Menu (YEP_CoreEngine)
Window_MenuStatus.prototype.drawItemImage = function(index) {
var actor = $gameParty.members()[index];
if (actor) {
var rect = this.itemRect(index);
this.changePaintOpacity(actor.isBattleMember());
this.drawActorFace(actor, rect.x + 1, rect.y + 1, Window_Base._faceWidth, Window_Base._faceHeight);
this.changePaintOpacity(true);
}
};
console.log("⚙️ Runtime protection patches and Party Switcher initialized successfully!");
Step 2: How to Switch Parties in the Dungeon
Immediately after pressing the in-game switch button/trigger on the map:
- Open the Developer Console (F12).
- Execute the corresponding helper command based on the active group:
- If switching to Party 1: Run
carregarGrupo(1); - If switching to Party 2: Run
carregarGrupo(2);
- If switching to Party 1: Run
- Close the Developer Console (F12).
Step 3: Verification & Clean Save
- Press Esc or X to open the main menu.
- Confirm that all four members belonging to the active group appear with full health and valid graphics.
- Save your game in a new save slot.
🔍 Quick Debugging Command
If you ever want to verify whether your current party list is clean before pressing the menu button, paste this in the console (F12):
JavaScript
console.log("Current Party IDs:", $gameParty._actors);
- Party 1 should always show:
[1, 3, 8, 6] - Party 2 should always show:
[5, 4, 10, 9]
I've managed to go through the dungeon with the help of Gemini, and trying to figure a solution with the console. Obviously, these IDs are based on the characters I've set for both parties.