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.
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.
www.mediafire.com
[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]