public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

Yanfly ATB: Keep charged action upon forced action.

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: Yanfly ATB: Keep charged action upon forced action.
  • Original author: hoboayoyo
  • Original date: March 31, 2024
  • Source thread: https://forums.rpgmakerweb.com/threads/yanfly-atb-keep-charged-action-upon-forced-action.167356/
  • Source forum path: Game Development Engines > Legacy Engine Support > RPG Maker MV Support

Summary

I'm trying to develop chain attacks like in Etrian Odyssey being used by one of my character, Evelyne. The idea is... A party member that is not Evelyne uses a fire attack. Call common event. -Checks if Evelyne has follow up fire attack state.

Archived First Post

I'm trying to develop chain attacks like in Etrian Odyssey being used by one of my character, Evelyne. The idea is...

A party member that is not Evelyne uses a fire attack.
Call common event.
-Checks if Evelyne has follow up fire attack state.
-If she does, Evelyne is than forced to action on previously attacked enemy.

The issue is that if a character is forced to use an action while readying an action, they will lose their charged action.
I have no idea how to fix this and have been looking for an answer for a while.
The best state I have this in is after the follow up attack is activated, the game will loop and than have Evelyne use a fire attack, than run the common event that has her follow up causing it to constantly loop.
I've tried a couple variations and cannot get the previous charged attack to go off, either Evelyne will reset or go into a loop.

Attached is a project demo, starting the game will give a brief overview of the issue, along with the script and a video.
The script changes I made to try to fix this is about line 1410 to 1515 or so. Any help is appreciated.




[ISPOILER]
var EvelyneATB;

// Function to get battle data for a subject based on actor ID
function getBattleDataByActorId(actorId) {
// Iterate through all battlers in the battle
var battlers = $gameParty.battleMembers().concat($gameTroop.members());
for (var i = 0; i < battlers.length; i++) {
var battler = battlers;
// Check if the battler is an actor and its actor ID matches the given actor ID
if (battler.isActor() && battler.actorId() === actorId) {
// Return the battler's data
return battler;
}
}
// Return null if no matching battler is found
return null;
}

Yanfly.ATB.BattleManager_processForcedAction =
BattleManager.processForcedAction;
BattleManager.processForcedAction = function() {
// Eve Actor data:
if(this._subject._actorId != 3){
EvelyneATB = getBattleDataByActorId(3);
}
if (EvelyneAT {
// Access subject's data
console.log("Got EvelyneATB: " + JSON.stringify(EvelyneAT); // Example: Log the subject's name
} else {
console.log("Actor with ID ???" + " not found in the battle.");
}
// Eve Actor data
console.log("forced action: " + this._subject._actorId);
//console.log("forced action")//hobo
var forced = false;
if (this._actionForcedBattler && this.isATB()) {
if(this._subject._actorId == 3){
var prevSubject = EvelyneATB;
console.log("prev Subject: " + JSON.stringify(prevSubject));
forced = true;
}
var action = this._actionForcedBattler.currentAction();
}
Yanfly.ATB.BattleManager_processForcedAction.call(this);
if(this._subject._actorId == 3 && forced == true){
this._subject = prevSubject;
console.log("This subject: " + JSON.stringify(this._subject));
forced = false;
}
//have a switch that stores eve's atb and if a forced action is called with her involved store it and wait.

};

Yanfly.ATB.BattleManager_endAction = BattleManager.endAction;
BattleManager.endAction = function() {
if (this.isATB()) {
if(this._subject._actorId == 3){
var prevSubject = EvelyneATB;
console.log("prev Subject 2: " + JSON.stringify(prevSubject));
var forced = true;
}
this.endATBAction();
if( forced == true){
this._subject = prevSubject;
console.log("This subject 2: " + JSON.stringify(this._subject));
}
} else {
Yanfly.ATB.BattleManager_endAction.call(this);
}
};

BattleManager.endATBAction = function() {


if (Imported.YEP_BattleEngineCore) {
if (this._processingForcedAction) this._phase = this._preForcePhase;
this._processingForcedAction = false;
console.log("Actor: " + this._subject._actorId );

/* if(this._subject._actorId == 3){
this._atbSpeed = EvelyneATB._atbSpeed;
this._atbCharge = EvelyneATB._atbCharge;
this._atbCharging = EvelyneATB._atbCharging;
this._atbChargeMod = EvelyneATB._atbChargeMod
console.log("evelyne setup");
console.log(this._processingForcedAction);
console.log(this._phase);
// return;
}
*/
}
if (this._subject) this._subject.onAllActionsEnd();
if (this.updateEventMain()) return;
this._subject.endTurnAllATB();
if (this.loadPreForceActionSettings()) return;

this.updateBattlerATB(true);
var chargedBattler = this.getChargedATBBattler();
if (chargedBattler) {
this.startATBAction(chargedBattler);
} else {
this.setATBPhase();
}
};
[/ISPOILER]

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download

Referenced Images / Attachments

www.mediafire.com
www.mediafire.com
www.mediafire.com
www.mediafire.com
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#rpg-maker-archive#mv-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar