Dynamic path 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
User avatar
Mirrodin
Regular
Posts: 114
Joined: Sun Mar 19, 2017 2:56 pm
Contact:

Dynamic path animation

#1 Post by Mirrodin »

Hi guys,

Today, I have a problem with dynamic animation, here is my code :

Code: Select all

image anim_atk = Movie(channel="anim_atk", play= "rpg/animation/[attaque_selectionne.animation_path]", xalign=0.5, yalign=0.5, loop=False)
The problem here, it's on init time so the dynamic object isen't implemented.

Code: Select all

$ anim_atk = Movie(channel="anim_atk", play= "rpg/animation/[attaque_selectionne.animation_path]", xalign=0.5, yalign=0.5, loop=False)
Isn't working, "Can't register channel outside of init phase"

I don't want to implement each path static, so how do you do that, have you a solution ?

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Dynamic path animation

#2 Post by Alex »

Why not declare several images and later show one or another?

Code: Select all

label start:
    $ a = renpy.random.choice(("anim_atk_1", "anim_atk_2"))
    "..."
    show expression a at truecenter
    "?"
    jump start
https://www.renpy.org/doc/html/displayi ... -statement
https://www.renpy.org/doc/html/statemen ... renpy.show
https://www.renpy.org/doc/html/other.html#renpy-random

Post Reply

Who is online

Users browsing this forum: No registered users