Recently I just check out RMXP to see the default script inside there and compare the differences with Ace, and I found this method in hidden class RPG::Sprite
loop_animation
Plays the animation specified in animation (RPG::Animation) in a loop on the indicated sprite.
Unlike normal animations, will loop back to the first frame after reaching the last frame, with no pause. Can be displayed at the same time as a normal animation. This method is used to display the animation specified in the status class (RPG::State).
If animation is set to nil, the animation will stop.
I wandering around for a while and manage to find out that the loop_animation method used in make a loop animation when a battler inflicted by a state, ex: sleep, then an animation indicating that the battler is in sleep state plays without stoping until the state removed from the battler. Now I can see that it's really cool.
Now my question, is this possible in Ace? I mean doing a loop animation when a battler inflicted by a state, ex: sleep.. then I made an animation like Z Z Z pop out, and it will be looping until the state removed from the battler?
I have tried several method, yes I managed to do it(the animation looping and dissapear when the state removed), but the there;s a problem, everytime the state animation played, it will interrupt all that going on in battle.
For example, I cast Meteor skill which has a very long duration animation, then when the state animation begin, the meteor skill animation halted, even dissapeared and not played. More over it kind like the state animation is interrupting all things like attacking, or use item and etc. I know I do something wrong here. Looking at XP the looping animation did not interrupt anything.
Now back to my question, is this really possible doing a loop_animation like XP regarding a state effect in Ace?
Perhaps this would turn into a script request, if someone wanted to do it for me, or maybe I just need a clarity about this.
Thank you all, forgive me for a long babbling..
Need help with loop_animation method
● ARCHIVED · READ-ONLY
-
-
Possible. Yanfly has the state animation. Go check that out ;)
-
So you could do this by doing something similar to the following (aliasing as appropriate)
This will at the very least keep you from interrupting other things that are going on.Spoilerclass RPG::Sprite def initialize @loop_animation = nil @loop_animation_counter = 0 end def update loop_animation unless @loop_animation == nil end def loop_animation current_frame = @loop_animation.frames[@loop_animation_counter] self.show_frame(current_frame) if @loop_animation_counter == @loop_animation.frame_max @loop_animation_counter = 0 else @loop_animation_counter += 1 end end def show_frame #Do some magic end end -
Depending on how you implemented it, it might be holding things up because Ace causes the battle to pause until an animation is finished. So you'd either need to disable that, or to have some flag so it only does it to skill/item animations, and not to state animations.
-
Oh thanks both of you, but the issue have already solved, my friend lend me some hand :)
This topic can be closed. :)
@shaz
This is the problem, you're right, but this have been solved, thank you anyway :)it might be holding things up because Ace causes the battle to pause until an animation is finished. -
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.