help with live composites

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
shiza
Regular
Posts: 29
Joined: Wed Jun 14, 2017 12:36 pm
Contact:

help with live composites

#1 Post by shiza »

So I'm trying to make a character based live composite where can change the pose and give the character the correct clothes that matches that pose. The character name is Kim and I want to put calm-c1 on top of the kim calm pose. The clothes and poses are stored in a character file in the base image file of the project. The file for her is named kim.

Code: Select all


init python:
    
    def draw_kim(st, at):
        return LiveComposite(
            (198, 650), #image size
            (0,0), "kim calm.png", #(0,0) notes the position
            (0,0), "calm-c1.png"
            ),.1
init:
    image k = DynamicDisplayable(draw_kim)
    $ k = Character ("Kim", color="#006600", image="kim",show_image=DynamicDisplayable(draw_kim))

Is this setup correctly for multiple poses and clothes?
What is the equivalent expression of "show kim calm" to display a LiveComposite?

mikolajspy
Regular
Posts: 169
Joined: Sun Jun 04, 2017 12:05 pm
Completed: Too many, check signature
Deviantart: mikolajspy
Location: Wrocław, Poland
Contact:

Re: help with live composites

#2 Post by mikolajspy »

I think something more like this would be better for your purpose.

Code: Select all

init python:
    def draw_kim(pose, cloth):   #[pose] and [cloth] are function attributes
        return LiveComposite(
            (198, 650), #image size
            (0,0), pose,
            (0,0), emot,
            )
init:
    $k = Character ("Kim", color="#006600", image="kim")
    image kim calm = draw_kim("kim calm.png","calm-c1.png") #here we're calling function and fill the attributes
and then simply in dialogues

Code: Select all

show kim calm
if you have more poses and clothes you would define them for example like this:

Code: Select all

image kim calm2 = draw_kim("kim calm 2.png","calm-c2.png")
image kim angry3 = draw_kim("kim angry.png","angry-a1.png")
and so on.

I hope it gives you idea what to do :)

shiza
Regular
Posts: 29
Joined: Wed Jun 14, 2017 12:36 pm
Contact:

Re: help with live composites

#3 Post by shiza »

mikolajspy wrote: Fri Sep 15, 2017 4:05 pm I think something more like this would be better for your purpose.

Code: Select all

init python:
    def draw_kim(pose, cloth):   #[pose] and [cloth] are function attributes
        return LiveComposite(
            (198, 650), #image size
            (0,0), pose,
            (0,0), emot,
            )
init:
    $k = Character ("Kim", color="#006600", image="kim")
    image kim calm = draw_kim("kim calm.png","calm-c1.png") #here we're calling function and fill the attributes
and then simply in dialogues

Code: Select all

show kim calm
if you have more poses and clothes you would define them for example like this:

Code: Select all

image kim calm2 = draw_kim("kim calm 2.png","calm-c2.png")
image kim angry3 = draw_kim("kim angry.png","angry-a1.png")
and so on.

I hope it gives you idea what to do :)
So I just implemented your code into the game and there is one problem with it. The image only draws when the assets are in the image folder and not the kim subfolder and the image statement is removed in the character statement. I tried using path directory like "kim\kim calm.png" but it seems like the language can't interpret pathing parameters.

Code: Select all

init python:
    def draw_kim(pose, cloth):   #[pose] and [cloth] are function attributes
        return LiveComposite(
            (198, 650), #image size
            (0,0), pose,
            (0,0), cloth,
            )
init:
    #$k = Character ("Kim", color="#006600", image='kim') old version
    $k = Character ("Kim", color="#006600") #new version
    image kim calm = draw_kim("kim calm.png","calm-c1.png") #here we're calling function and fill the attributes

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: help with live composites

#4 Post by Divona »

shiza wrote: Sat Sep 16, 2017 4:07 am I tried using path directory like "kim\kim calm.png" but it seems like the language can't interpret pathing parameters.

Code: Select all

kim/kim calm.png
Completed:
Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]