I am resurrecting this post to add updates and new questions, im gonna explain:
After some investigation, i've found what I wanted and ive been able to make the infinite attack loop, thanks to using this: BattleManager.queueForceAction(user, skill, target);
That's great but now appears a new bug:
When my actor attacks and repeats for the first time, it doesn't back to its position, but after executing the 2nd attack, 3rd and next attacks he is backing to origin position. This is more graphic:
https://i.gyazo.com/43efec7b7f1ce39f78493224635836a4.mp4
I would like to make all the attacks without backing to its position, and only when ends all attacks ends. I've tried a lot of things, but didn't worked at all.
Im posting notes of the attack too, maybe it helps to solve this:
<Whole Action>
move user: targets, front, 20
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
wait 100
</Whole Action>
<Finish Action>
if $gameSwitches.value(100);
wait: 10
else
move user: return
wait for movement
end
</Finish Action>
<Post-Damage Eval>
if(target.isDead() && user.isStateAffected(64)){
var id = user._actorId;
var pos = $gameParty._actors.indexOf(id);
var skill = 1;
var target = -1;
$gameSwitches.setValue(100, true);
BattleManager.queueForceAction(user, skill, target);
}
</Post-Damage Eval>
<After Eval>
$gameSwitches.setValue(100, false);
</After Eval>
After some investigation, i've found what I wanted and ive been able to make the infinite attack loop, thanks to using this: BattleManager.queueForceAction(user, skill, target);
That's great but now appears a new bug:
When my actor attacks and repeats for the first time, it doesn't back to its position, but after executing the 2nd attack, 3rd and next attacks he is backing to origin position. This is more graphic:
https://i.gyazo.com/43efec7b7f1ce39f78493224635836a4.mp4
I would like to make all the attacks without backing to its position, and only when ends all attacks ends. I've tried a lot of things, but didn't worked at all.
Im posting notes of the attack too, maybe it helps to solve this:
<Whole Action>
move user: targets, front, 20
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
wait 100
</Whole Action>
<Finish Action>
if $gameSwitches.value(100);
wait: 10
else
move user: return
wait for movement
end
</Finish Action>
<Post-Damage Eval>
if(target.isDead() && user.isStateAffected(64)){
var id = user._actorId;
var pos = $gameParty._actors.indexOf(id);
var skill = 1;
var target = -1;
$gameSwitches.setValue(100, true);
BattleManager.queueForceAction(user, skill, target);
}
</Post-Damage Eval>
<After Eval>
$gameSwitches.setValue(100, false);
</After Eval>
ORIGINAL POST:
---------------------------------------------------------------------------------
Hi guys, im gonna explain what I am working on:
I want that if an actor is affected by a passive state and kills a target with a normal attack, it repeats the attack on a random enemy.
I've been abled to do this with this code:
-------------------------------------------------------------------
<Post-Damage Eval>
if(target.isDead() && user.isStateAffected(59)){
var id = user._actorId;
var pos = $gameParty._actors.indexOf(id);
BattleManager.forceAction($gameParty.members()[pos]);
}
</Post-Damage Eval>
-------------------------------------------------------------------
This only works once, just as I expected and wanted, but I would like to create a improvement of this, making it having no limits in the number of attacks, making possible to attack and attack and attack untill all enemies are dead (if they kill only with 1 basic attack)
I have tried but it is impossible for an newbie like me on JS, could some1 help me?