MZ SRPG Gear MZ – Forced “Assist” Units Appear in Battle but Never Execute Their Action

Hi, I’m working in RPG Maker MZ using SRPG Gear and I’m implementing a custom Assist / Support Fire system. The assist units correctly spawn and appear in the battle scene, the assist trigger fires, and the action is successfully queued (confirmed via console logs), but the assist unit never actually performs its attack. It looks like the assist battler doesn’t get processed by the battle flow unless it naturally enters the turn order. I’ve already tried calling subject.forceAction(), BattleManager.forceAction(subject), and BattleManager.processForcedAction() at different timing points (including inside BattleManager.endAction), and I’ve confirmed the battler is alive, visible, has a valid skill and target, and isn’t flagged with NoAction. Is there a required way in SRPG Gear or MZ to register an assist battler into the active battle system so a forced action can execute, or is there a known limitation where forced actions won’t run for battlers that didn’t enter the normal turn cycle?
Discord_PPWCpz0fsm.png

// -------------------------------------------------------------------------
// Steel Assist System: force assist actions inside the same battle scene
// -------------------------------------------------------------------------
(function() {
if (!BattleManager) return;
const _SteelAssist_startAction = BattleManager.startAction;
BattleManager.startAction = function() {
// If this is the first action of the SRPG battle, build the assist queue.
try {
if ($gameSystem && $gameSystem.steelAssistEnabled && $gameSystem.steelAssistEnabled()) {
if (!$gameTemp._steelAssistQueueBuilt) {
$gameTemp._steelAssistQueueBuilt = true;
$gameTemp._steelAssistQueue = [];
const ctx = $gameTemp._steelMainBattle;
const members = $gameTemp._steelAssistMembers || {atk:[], def:[]};
const targetEventId = ctx ? ctx.targetEventId : 0;
const targetUnit = targetEventId ? $gameSystem.EventToUnit(targetEventId) : null;
const targetBattler = targetUnit ? targetUnit[1] : null;
const userEventId = ctx ? ctx.userEventId : 0;
const userUnit = userEventId ? $gameSystem.EventToUnit(userEventId) : null;
const userBattler = userUnit ? userUnit[1] : null;
const pushQueue = (eventIds, forcedTargetBattler, forcedTargetEventId) => {
eventIds.forEach(eid => {
const u = $gameSystem.EventToUnit(eid);
if (!u || !u[1]) return;
const b = u[1];
// choose skill (weapon-mode prefers <srpgWeaponSkill:X> from equipped weapon; fallback to attackSkillId)
let skillId = 0;
if (_steelAssistSkillMode === 'fixed') {
skillId = _steelAssistSkillId;
} else {
// Prefer weapon-defined SRPG skill if present
try {
if (b.isActor && b.isActor()) {
const w = b.weapons && b.weapons().length ? b.weapons()[0] : null;
const wid = w && w.meta ? Number(w.meta.srpgWeaponSkill || 0) : 0;
if (wid) skillId = wid;
} else if (b.isEnemy && b.isEnemy()) {
// Enemies may define a weapon skill on enemy meta
const em = b.enemy && b.enemy() ? b.enemy().meta : null;
const eid2 = em ? Number(em.srpgWeaponSkill || 0) : 0;
if (eid2) skillId = eid2;
}
} catch (e) {}
if (!skillId) skillId = (b.attackSkillId ? b.attackSkillId() : 1);
}
if (!skillId) return;
// NOTE:
// - Attack-assists should target the main target.
// - Defense-assists should target the main attacker (the "user").
const tgtBattler = forcedTargetBattler || targetBattler;
const tgtEventId = Number(forcedTargetEventId || targetEventId || 0);
$gameTemp._steelAssistQueue.push({
subject: b,
skillId: skillId,
target: tgtBattler,
targetEventId: tgtEventId
});
});
};
// atk assists -> shoot the main target
pushQueue(members.atk || [], targetBattler, targetEventId);
// def assists -> shoot the main attacker
pushQueue(members.def || [], userBattler, userEventId);
if (_steelAssistDebug && $gameTemp._steelAssistQueue.length) {
console.log('[SteelAssist] queue length', $gameTemp._steelAssistQueue.length);
}
}
}
} catch (e) {}
_SteelAssist_startAction.call(this);
};
const _SteelAssist_endBattle = BattleManager.endBattle;
BattleManager.endBattle = function(result) {
try {
$gameTemp._steelAssistQueue = [];
$gameTemp._steelAssistQueueBuilt = false;
} catch (e) {}
_SteelAssist_endBattle.call(this, result);
};
const _SteelAssist_endAction = BattleManager.endAction;
BattleManager.endAction = function() {
// If Assist System is off, just behave normally.
if (!$gameSystem || !$gameSystem.steelAssistEnabled || !$gameSystem.steelAssistEnabled()) {
_SteelAssist_endAction.call(this);
return;
}
// Prevent infinite chaining / re-entrancy.
if (this._steelAssistResolving) {
_SteelAssist_endAction.call(this);
return;
}
const q = ($gameTemp && $gameTemp._steelAssistQueue) ? $gameTemp._steelAssistQueue : [];
const next = q.shift();
if ($gameTemp) $gameTemp._steelAssistQueue = q;
// No assist queued -> normal endAction.
if (!next || !next.subject || !next.skillId || next.skillId <= 0) {
_SteelAssist_endAction.call(this);
return;
}
// Validate that battler is still able to act.
const subject = next.subject;
if (subject.isDead && subject.isDead()) {
_SteelAssist_endAction.call(this);
return;
}
if (subject.isHidden && subject.isHidden()) {
_SteelAssist_endAction.call(this);
return;
}
// SRPG rule: only one assist per battler per battle (prevents "stealing turns"/looping).
if (subject._steelAssistUsedThisBattle) {
_SteelAssist_endAction.call(this);
return;
}
subject._steelAssistUsedThisBattle = true;
// Force the assist action BEFORE ending the current action.
this._steelAssistResolving = true;
// Decide target index based on who the subject is (actor targets enemy; enemy targets actor).
const oppUnit = (subject.isActor && subject.isActor()) ? $gameTroop : $gameParty;
let targetIndex = 0;
// Prefer the original target if we have it.
if (typeof next.targetIndex === "number") {
targetIndex = next.targetIndex;
} else if (next.target && oppUnit && oppUnit.members) {
targetIndex = oppUnit.members().indexOf(next.target);
if (targetIndex < 0) targetIndex = 0;
}
// Safety: if no valid targets, just end normally.
if (!oppUnit || !oppUnit.members || oppUnit.members().length <= 0) {
this._steelAssistResolving = false;
_SteelAssist_endAction.call(this);
return;
}
// Force action + register with BattleManager so it actually executes.
try {
subject.forceAction(next.skillId, targetIndex);
if (BattleManager.forceAction) BattleManager.forceAction(subject);
} catch (e) {
console.warn("[SteelAssist] forceAction failed", e);
this._steelAssistResolving = false;
_SteelAssist_endAction.call(this);
return;
}
// Finish the previous action (this will switch the phase back to 'turn' etc.)
_SteelAssist_endAction.call(this);
// Immediately process the forced action if the engine supports it.
if (BattleManager.processForcedAction) {
BattleManager.processForcedAction();
}
this._steelAssistResolving = false;
};

})();
})();

Original thread: https://forums.rpgmakerweb.com/threads/srpg-gear-mz-forced-assist-units-appear-in-battle-but-never-execute-their-action.182140/