Hello again. I'm trying to make my battle system to where skill common events get called before the skill gets used (i.e before the skill animation and effects are shown). I'm trying to do this for two reasons: 1 so that battlers can "say" something cool before they use a skill (for example when "Fire" is being casted, I want the casting actor/enemy battler to say "Burn in hell!" And then cast the spell). And 2 so that "Weapon" Skills will play the caster's weapon attack animation instead of the skill's user animation, because each weapon has its own unique attack animation showing the weapon being swung. I've got this working perfectly for actors only, but I can't figure out how to get it to work for enemies... It's so strange, I can't make any sense of this at all.
So this is how I'm trying to change it to where the skill's common event gets called first:
#Play user Animations
@common_event_id = $data_skills[@active_battler.current_action.skill_id].common_event_id
if @animation1 > 0
@active_battler.animation_id = @animation1
@wait_count = get_wait_guess_for_animation(@animation1)
end
The common event should play before the enemy's skill animation but for some reason it only calls it "after" the animation, and "after" the effects of the skill and damage pop. And if I put in something that gives an error, the error does happen before the skill gets used like it's supposed to. I'm pretty sure this is the right place because when I remove the "@active_battler.animation_id = @animation1", the user animation doesn't play at all like I'd expect.
All night I've tried placing the "@common_event_id = $data_skills[@active_battler.current_action.skill_id].common_event_id" in hundreds of different places through out the script, and everytime it works (i.e. not get an error and actually call the event), it will only call it "after" the skill's animation and effect is shown, never before. I don't know how this is even possible when it says call it before the animation, especially since this worked just fine for actors. It seems actors and enemy skills get processed differently, I guess because of the AI. Please, if anyone can help me do this... or write me a small script that will make sure skill's common events always get called "before" the skill's animation and effects are shown, I'd greatly appreciate it... It still baffles me why, no matter where I put the @common_event_id = line, it never calls it before the skill gets used, only after... I really hope someone can help me make sense of this.
So this is how I'm trying to change it to where the skill's common event gets called first:
#Play user Animations
@common_event_id = $data_skills[@active_battler.current_action.skill_id].common_event_id
if @animation1 > 0
@active_battler.animation_id = @animation1
@wait_count = get_wait_guess_for_animation(@animation1)
end
The common event should play before the enemy's skill animation but for some reason it only calls it "after" the animation, and "after" the effects of the skill and damage pop. And if I put in something that gives an error, the error does happen before the skill gets used like it's supposed to. I'm pretty sure this is the right place because when I remove the "@active_battler.animation_id = @animation1", the user animation doesn't play at all like I'd expect.
All night I've tried placing the "@common_event_id = $data_skills[@active_battler.current_action.skill_id].common_event_id" in hundreds of different places through out the script, and everytime it works (i.e. not get an error and actually call the event), it will only call it "after" the skill's animation and effect is shown, never before. I don't know how this is even possible when it says call it before the animation, especially since this worked just fine for actors. It seems actors and enemy skills get processed differently, I guess because of the AI. Please, if anyone can help me do this... or write me a small script that will make sure skill's common events always get called "before" the skill's animation and effects are shown, I'd greatly appreciate it... It still baffles me why, no matter where I put the @common_event_id = line, it never calls it before the skill gets used, only after... I really hope someone can help me make sense of this.