How to force multi-hit skill to run common event everytime it hits?

Greeting!

Basically, a skill can call common event only once after hit regardless number of hit. Just wonder whether there is a way to make a multi-hit skill call common event every time it hits.

For example 3-hit skill will call a common event 3 times.
I generally did it with a code snippet like this:

remembered_event = $game_temp.common_event_id$game_temp.reserve_common_event(35)SceneManager.scene.process_event$game_temp.reserve_common_event(remembered_event)This will remember whatever Common Event was queued, if any, then reserve the event you want to run with each hit, process it immediately, and then reserve the Common Event that was remembered (so that it's queued again).

You will probably want to stick this in an appropriate place in Game_Battler - possibly a method like make_damage_value if this skill does damage.
I generally did it with a code snippet like this:

remembered_event = $game_temp.common_event_id$game_temp.reserve_common_event(35)SceneManager.scene.process_event$game_temp.reserve_common_event(remembered_event)This will remember whatever Common Event was queued, if any, then reserve the event you want to run with each hit, process it immediately, and then reserve the Common Event that was remembered (so that it's queued again).You will probably want to stick this in an appropriate place in Game_Battler - possibly a method like make_damage_value if this skill does damage.
So your snippet will only work if the skill actually hits and does damage, won't it? That would be what I want for my project. One more question, if I would like to set for more common events that can be executed, how can I add it to your snippet. For example, skill A will run common event 1 while skill B will run common event 2.
Bump, still need a way to do this.
I've moved this thread to Script Request. Please be sure to post your threads in the correct forum next time. Thank you.


That requires a script to change the original behaviour, because by default the common events are only run once for the script.


You might be able to make something work with script calls in the damage formula, but for that you have to tell us what you want the CE do. If it does something complex, again you need a script to set it up (but call the script from the damage formula instead of a common event.
I've moved this thread to Script Request. Please be sure to post your threads in the correct forum next time. Thank you.

That requires a script to change the original behaviour, because by default the common events are only run once for the script.

You might be able to make something work with script calls in the damage formula, but for that you have to tell us what you want the CE do. If it does something complex, again you need a script to set it up (but call the script from the damage formula instead of a common event.
Thank you for moving this thread to correct forum Andar.

For my project, I design a state that enables player to auto cast attacking spell when the character uses attack command. This is easy just have a skill attack checks if state is true then call common event (to force auto casting spell on random chance).

And I would like to have multi-hit skill also can proc this auto spell as well but default game design will only trigger common event only once after action ends. I would like to have the skill calls common event right after each successfully hit.

Hopefully you see a clearer picture now.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-force-multi-hit-skill-to-run-common-event-everytime-it-hits.40209/