how to stop an Animation?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
sigmaxion
Regular
Posts: 35
Joined: Wed Jul 19, 2006 6:52 pm
Location: China
Contact:

how to stop an Animation?

#1 Post by sigmaxion »

I mean, how to make the animation only paly once. I'm using something like this:

init:
image attack = Animation ("a1.png",0.02,"a2.png",0.02,"a3.png",0.02,
"a4.png",0.02,"a5.png",0.04,"a6.png",0.13,"a7.png",0.06,"a8.png",0.05)

show attack

and you know, the animaion would play repeatedly. But I only want it to play once.
I browsed the reference, but i didn't find anything useful.

Could somebody help me out?

btw, I don't want to use anim.Filmstrip function.
Last edited by sigmaxion on Sat Jul 22, 2006 6:07 am, edited 1 time in total.

shaja
Regular
Posts: 73
Joined: Sun Oct 16, 2005 8:34 am
Contact:

#2 Post by shaja »

"If the number of arguments is odd, the animation will stop with the last image (well, actually delay for a year before looping). Otherwise, the animation will restart after the final delay time."

So, your code should be:

Code: Select all

image attack = Animation ("a1.png",0.02,"a2.png",0.02,"a3.png",0.02,
"a4.png",0.02,"a5.png",0.04,"a6.png",0.13,"a7.png",0.06,"a8.png")

sigmaxion
Regular
Posts: 35
Joined: Wed Jul 19, 2006 6:52 pm
Location: China
Contact:

#3 Post by sigmaxion »

Thank you!

and now I have another question.

how to change animation?

I mean,how does the animaion change in a queue?
for example, I what get a effect like this:
The guy goes forward, then make an attack, after that jump back to oringnal position.
To achieve this effect, I have 3 animations, so I wonder how to paly these animations one by one...

waiting for answer.

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#4 Post by monele »

I don't think there's any queue system for animations. Right now, I would play the first one (show anim1) then wait for it to finish ($ renpy.pause(3.5)), then play the next one (show anim2), etc...
Are you using such an animation for a cutscene ? If so, it's just a bit of work for timing everything nicely, but it should work.

sigmaxion
Regular
Posts: 35
Joined: Wed Jul 19, 2006 6:52 pm
Location: China
Contact:

#5 Post by sigmaxion »

monele wrote:I don't think there's any queue system for animations. Right now, I would play the first one (show anim1) then wait for it to finish ($ renpy.pause(3.5)), then play the next one (show anim2), etc...
Are you using such an animation for a cutscene ? If so, it's just a bit of work for timing everything nicely, but it should work.
Thank you for reply.
In fact, at first, my thought is same with you. Because I do the same thing in another engine.
But, I just began to try this engine a few days ago, so I don't know the "WAIT" command...
Thanks for your advice again.

Post Reply

Who is online

Users browsing this forum: No registered users