So, I have a question: I am wanting to create a skill that basically it does damage as normal, but if it kills an enemy as the killing blow, if there is still 1 or more enemies still alive, that the actor reuses that skill on another enemy at random before the turn order continues as normal. How would I got about creating this kind of skill?
MV Skill that reuses itself on enemy defeat?
RPG Maker MV SupportYanfly action sequence, after action effect check if target hp is 0 and that there's still alive enemies in the troop, move to a different target and run the skill sequence again. That should work (even though I remember answering a similar question not too long ago where the dude complained they didn't get it to work properly LOL).
EDIT: if you have immortal on during the action sequence you need to check that there's still enemies whose hp is > 0
EDIT: if you have immortal on during the action sequence you need to check that there's still enemies whose hp is > 0
if what was suggested doesnt work out for some reason, its also doable between the skill core and the buffs and states core plugin. having the skill apply a state to the user, saving the target as a property on the user, and using the state to check if the target is dead after as an action end effect in order to force an action should work regardless of immortality
Not very sure how actually set that up though, as I am still mostly unfamiliar with action sequences in general.
Bumping because I am still needing help with this.
Well if you don't want to use action sequences, did you try Robro's suggestion using force action and notetags?
It's not that I don't want to use them, it is just I don't know *how* to use them that well, so I have no idea how to make use of it fully.
If you want to learn action sequences, there's the plugin instructions and probably forum and youtube tutorials. Robro's suggestion would be something like (change state Xs and Y for state and skill id):
Skill notetag:
State notetag:
Skill notetag:
<Pre-Damage Eval>if (!this._forcing){user._targetX = target;user.addState(X);}</Pre-Damage Eval>State notetag:
<Custom Action End Effect>if (user._targetX.hp <= 0) {user.removeState(X);var skillId = Y;user.forceAction(skillId, -1);BattleManager.forceAction(user);$gameTroop._interpreter.setWaitMode('action');delete user._targetX;}</Custom Action End Effect>just to note one of the reasons i brought it up, the target would have died if they should have by the time action end effects run. So if there are any immortal enemies, using isDead() would allow it to differentiate killing from dropping their hp to 0.
its also why i mentioned it as an alternative to Yanfly's MV AS. targets are made immortal at the start of each skill so thy can't die during it. a side effect is that targets cannot pass any check to determine if they should be able to die. Never tried to see if its the same in VS, but states should still work if someone needs it in MZ
@rpgLord69 @Robro33 Testing what was provided there (with replacing "hp <= 0" with "isDead()") worked like a charm, thank you. I definitely will look at tutorials for AS though so that I can know how to use them properly though.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/skill-that-reuses-itself-on-enemy-defeat.179595/