Animation in LayeredImage freezing?

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
pumpkin spike
Regular
Posts: 76
Joined: Fri Mar 09, 2018 6:13 pm
Projects: A Bureau of Monsters
itch: pumpkin-spike
Location: A Pumpkin Patch
Contact:

Animation in LayeredImage freezing?

#1 Post by pumpkin spike »

I set up a blinking animation with LayeredImage and noticed that as I placed dialogue in the game, the blinking animation freezes and defaults to the closed eyes image whenever I change between two mouths. This also coincides as the last frame of the animation, but I tried putting in an extra frame to see if it freezes there instead, it doesn't. What might be causing this? Has this happened to anyone else?

LayeredImage code:

Code: Select all

layeredimage a:
    always:
        "images/a[gender]_down/a[gender]_base_down.png"
    group eyes:
        attribute open:
            "images/a[gender]_down/a[gender]_down_openeyes.png"
        attribute close:
            "images/a[gender]_down/a[gender]_down_closedeyes.png"
        attribute blink:
            "a_down[gender]_blink"
    group mouth:
        attribute open1:
            "images/a[gender]_down/a[gender]_down_openmouth.png"
        attribute frown:
            "images/a[gender]_down/a[gender]_down_frown.png"
blinking code (I have a separate one for each gender which has identical code, just a different image name):

Code: Select all

image a_down_m_blink:
    "images/a[gender]_down/a[gender]_down_openeyes.png"
    5.0
    "images/a[gender]_down/a[gender]_down_closedeyes.png"
    0.2
    "images/a[gender]_down/a[gender]_down_openeyes.png"
    0.5
    "images/a[gender]_down/a[gender]_down_closedeyes.png"
    0.2
    repeat
script:

Code: Select all

menu:
        "Please choose a gender."
        "Male":
            $ gender = "_m"

        "Female":
            $ gender = "_f"

    scene bg with dissolve
    show a_down blink frown at Transform:
        xpos 0.0 
        ypos -250
    with dissolve
    "text"
    show a_down blink open1
    mc"text"
    show a_down blink frown
This is the point where the stopped animation occurs. At first, I didn't put the 'blink' per show of the sprite. Since I've put it there, the error occurs a little later in the script, but at a similar transition between open1 -> frown.
Image
WIP AllxAll game with turn based fighting (Demo 2.0 out!)

Image
WIP Yaoi game Demo 1.0 out! (haitus)

pumpkin spike
Regular
Posts: 76
Joined: Fri Mar 09, 2018 6:13 pm
Projects: A Bureau of Monsters
itch: pumpkin-spike
Location: A Pumpkin Patch
Contact:

Re: Animation in LayeredImage freezing?

#2 Post by pumpkin spike »

Troubleshooting I've done since:
-Added a second blinking sprite that does not need to switch between genders, this one performs with no errors. Might this have to do with the code needing to continuously check which sprite's gender I want?
-Changed a few blinks to just open, this seemed to eliminate the problem. Does this have to do with timing, too? Maybe I'm not letting the animation code run long enough to reach the error?

Maybe there's a another/better way to pick between LayeredImages that I don't know of since this isn't really working?
Image
WIP AllxAll game with turn based fighting (Demo 2.0 out!)

Image
WIP Yaoi game Demo 1.0 out! (haitus)

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]