I want to add an action to another.. i am applying this on "GameAction_apply"..
this is done before the dmg is dealt, because i want that action to be added even if the first action misses,,
(i know about "force action" ect, but my problem is about the timing, .. not about how to add the action)
So lets say we have these 2 actions, first is default,second is the added action..
now if the enemy dies from the first action.. the SV char trys to use the second action aswell and "jumps" when the death of the enemy is recognized..
So the thing is, i used an "if condition" that should make sure to only add the second action if the unit is "not dead"..
But this cant work, because when this code runs, the enemy is still alive,because the dmg wasnt dealt yet..
so here is my "if condition" that checks if the enemy is dead:
but i am not sure for which "Game_Action"- function i need to wait till the dmg is applied, and more important, how to use "Promise" to ask if the "Unit is not Dead".. after the dmg applied.
-> in order to only run my "add action" code if the unit is "not dead"
// i guess the timming issue is only about a few frames..
any help on how to make this work the simplest way.. with "promise" or any other solution would be really welcome!
and hopefully you all had a nice Christmas
this is done before the dmg is dealt, because i want that action to be added even if the first action misses,,
(i know about "force action" ect, but my problem is about the timing, .. not about how to add the action)
So lets say we have these 2 actions, first is default,second is the added action..
now if the enemy dies from the first action.. the SV char trys to use the second action aswell and "jumps" when the death of the enemy is recognized..
So the thing is, i used an "if condition" that should make sure to only add the second action if the unit is "not dead"..
But this cant work, because when this code runs, the enemy is still alive,because the dmg wasnt dealt yet..
caethyril wrote here#10 ,..
that "Promise" can be used to wait for another function,,, but its a bit hard to understand for me..so here is my "if condition" that checks if the enemy is dead:
JavaScript:
if (!target[1].isDead()) // use my code for extra action ect;
but i am not sure for which "Game_Action"- function i need to wait till the dmg is applied, and more important, how to use "Promise" to ask if the "Unit is not Dead".. after the dmg applied.
-> in order to only run my "add action" code if the unit is "not dead"
// i guess the timming issue is only about a few frames..
any help on how to make this work the simplest way.. with "promise" or any other solution would be really welcome!
and hopefully you all had a nice Christmas