Is it still OK to use LiveComposite for blinking sprites?

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
thirstyoctopus
Regular
Posts: 72
Joined: Mon Aug 27, 2018 12:04 pm
Projects: Romance Visual Novel story
Organization: Thirsty Octopus
Contact:

Is it still OK to use LiveComposite for blinking sprites?

#1 Post by thirstyoctopus »

Hey everyone

I was considering implementing a blinking aesthetic to my character sprites in the game I'm working on and doing some searching I could only find the deprecated page referring to LiveComposite for Blinking and Lip Flap. I don't need the lip flap as my game is voice markers only but I wondered if there was another way to have automatic random blinking for sprites that are on screen? I currently use layeredimages in my project and each sprite has a blank face body with a set of expressions, so if I were to separate the eyes from the mouth would it be possible to implement this feature easily?

Any advice on this that steers away from the LiveComposite option would be appreciated, thank you.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Is it still OK to use LiveComposite for blinking sprites?

#2 Post by Ocelot »

You can define an ATL animation for your eyes and use that animated image in layeredimage. For example following will create animation with randomly blinking eyes:

Code: Select all

image blinking_eyes:
    "eyes_open"
    choice:
        pause 8.0
    choice:
        pause 12.0
    choice 0.5:
        pause 4.0
    choice 0.2:
        pause 0.8
    "eyes_closed"
    pause 0.5
    repeat
< < insert Rick Cook quote here > >

User avatar
thirstyoctopus
Regular
Posts: 72
Joined: Mon Aug 27, 2018 12:04 pm
Projects: Romance Visual Novel story
Organization: Thirsty Octopus
Contact:

Re: Is it still OK to use LiveComposite for blinking sprites?

#3 Post by thirstyoctopus »

Ocelot wrote: Tue Apr 20, 2021 7:36 am You can define an ATL animation for your eyes and use that animated image in layeredimage. For example following will create animation with randomly blinking eyes:

Code: Select all

image blinking_eyes:
    "eyes_open"
    choice:
        pause 8.0
    choice:
        pause 12.0
    choice 0.5:
        pause 4.0
    choice 0.2:
        pause 0.8
    "eyes_closed"
    pause 0.5
    repeat
Thanks for the suggestion. Would you be able to explain how to implement this though? I was hoping I wouldn't have to go through every line I'd included a sprite to be able to make this work.

Currently, my layeredimages are set up as follows, with a set of poses and a set of expressions which are assigned automatically based on file name:

Code: Select all

layeredimage l:
    group pose auto:
        attribute u1 default
    group face auto
And I would reference them in the script like this:

Code: Select all

show l u1 s1 at position

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Is it still OK to use LiveComposite for blinking sprites?

#4 Post by Imperf3kt »

Note that "LiveComposite" was replaced with just "Composite" a few years ago
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Syrale
Regular
Posts: 100
Joined: Sun Oct 25, 2015 10:28 am
Completed: Robot Daycare, Deep Sea Valentine, Locke(d)
Projects: Artificial Selection, rei_carnation
Github: kigyo
itch: kigyo
Discord: kigyo#2564
Contact:

Re: Is it still OK to use LiveComposite for blinking sprites?

#5 Post by Syrale »

Not sure if you can combine the "auto" method with defining stuff on your own, but if you can, this should work:

Code: Select all

layeredimage l:
    group pose auto:
        attribute u1 default
    group face auto
    group eyes:
    	attribute open_eyes default "blinking_eyes"
    	attribute closed_eyes "images/character/closed_eyes.png"
Basically: For the animated eyes, you add the name of the image you defined. For all other eyes (aka those that don't blink), you have to add the file path instead.

User avatar
thirstyoctopus
Regular
Posts: 72
Joined: Mon Aug 27, 2018 12:04 pm
Projects: Romance Visual Novel story
Organization: Thirsty Octopus
Contact:

Re: Is it still OK to use LiveComposite for blinking sprites?

#6 Post by thirstyoctopus »

Syrale wrote: Wed Apr 21, 2021 3:17 am Not sure if you can combine the "auto" method with defining stuff on your own, but if you can, this should work:

Code: Select all

layeredimage l:
    group pose auto:
        attribute u1 default
    group face auto
    group eyes:
    	attribute open_eyes default "blinking_eyes"
    	attribute closed_eyes "images/character/closed_eyes.png"
Basically: For the animated eyes, you add the name of the image you defined. For all other eyes (aka those that don't blink), you have to add the file path instead.
I ended up trying a few things and finally got it work this way:

Code: Select all

image l_face_os1:
    "lily/pose_1/l_face_os1.png"
    choice:
        8
    choice:
        10
    choice:
        4
    choice:
        .2
    "lily/pose_1/l_face_cs1.png"
    pause .5
    repeat
And left my layeredimage definitions as is. Basically the auto on face means that if I choose to display the 'open smile' (os1) on pose 1, it will instead inherit the above ATL block which switches the open eyes to the closed eyes version. I just will need to do this for the other relevant expressions and this way I don't need to add code within the chapters, just define it once

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]