YEP_X_ActSeq Addon request

Good afternoon.


I am looking for an enterprising individual to provide me with a way to call an action sequence directly from a skill ID, given in the args of the function call.


Specifically, I am looking for a way to use an action sequence when a custom state becomes active. I was trying to dig through the action sequence and battle engine core plugins to see where it actually decides to pull the action sequences from the skill and execute them, but I can't seem to find that information.


Ideally, I'd like to be able to call a function, and have it perform the action sequence of the skill Id, as if the skill had been used, processing every action sequence argument as if it had been used normally. This way, I could animate a state effect as if it were a skill. Specifically for a re-raise type skill, which yanfly has already provided the code for (here). Without this ability, the animation called in this state plays immediately after death occurs, and the HP recovery happens on the exact same frame, without waiting for the animation to finish. If the next action is an enemy, it will also get to act before the animation is even finished as well.


I think this sort of thing is out of the scope of the support yanfly provides for his tips/tricks and lunatic code, so if anyone could help me out, that'd be awesome.
One way I could think of is make a 'dummy' skill with the action sequence you desired to play out, and then have the state to forceAction that skill? Would that be what you're looking for? I'm sorry if I don't understand the question.
One way I could think of is make a 'dummy' skill with the action sequence you desired to play out, and then have the state to forceAction that skill? Would that be what you're looking for? I'm sorry if I don't understand the question.

That would be one way to solve it. I even tried that, but couldn't figure out how to make the state force the action.


$gameParty.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameParty.members()[index]);


The script call spreadsheet lists the above commands for forcing an action, the second command doesn't seem to even reference a skill to use, so I don't think it's the correct thing to use. The first one might be correct, but I have no idea what to set the indexes to to make the afflicted use the skill on itself.
Someone in the other Action Sequence thread wrote this: 


var skill = [id of part 2 skill];


var target = -1 or -2; //-1 for random target, -2 for same target as this skill


user.forceAction(skill, target);


BattleManager.forceAction(user);


BattleManager.processForcedAction();


This was supposed to be on <After Eval> tag of a skill, but since it is also an eval, maybe it can work within the state lunatic code?
I managed to get it to perform the setup action portion, but it's not passing the target correctly, so the second half of the sequence doesn't work.


When I changed the sequence to exclusively target the user, it works fine, because it ignores whatever the initial target was. That's workable.


The problem now is that the sequence immediately begins playing before the enemy is finished with it's own sequence, likely because the yanfly auto-life state triggers as soon as HP is zero. If I remove that part of the state, I get gameover as soon as the actor dies, and the sequence doesn't play at all.


edit:


alright, I managed to workaround all of those problems and have a working version. Thanks for your assistance.


View attachment output.mp4
So you got it to work? 


Yay 😀 😀 😀


I'm glad I could help ^^

Original thread: https://forums.rpgmakerweb.com/threads/yep_x_actseq-addon-request.65025/