Can't get Layered Images 'Variant Picker' to work

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
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Can't get Layered Images 'Variant Picker' to work

#1 Post by Geckos » Tue Aug 28, 2018 12:35 am

Didn't end up getting it working~ got more errors and abandoned the pursuit! May return to at a later date
Last edited by Geckos on Sun Sep 02, 2018 6:08 am, edited 6 times in total.
Image ImageImage

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Can't get Layered Images 'Variant Picker' to work

#2 Post by trooper6 » Tue Aug 28, 2018 1:30 am

It doesn't seem like you need a picker at all.
I use a picker because I want one keyword to pick multiple things. The Patreon article used a picker because it wanted to randomize which arms were shown. It looks like you just want to show some arms, not randomly, not as part of a multi-part conglomerate. You just want to show a variety of arms...which...you don't need a picker for.

Do you actually have variants? Because I'm not seeing any from the files you've provided. Assuming the files you showed are all the files we have, I'd get rid of the "1"s in your file name. And then I'd create your layered image like so:

Code: Select all

layeredimage owen:
    always "owen_base"
    group collar auto prefix "collar":
        attribute flat default
    group face auto:
        attribute neut default
    group arms auto prefix "arms":
        attribute down default
        
label start:
    show owen at left
    "This will show Owen."
    show owen collar_up
    "Now the collar is up."
    show owen -collar_up
    "Now the collar goes back to default, down."
    show owen creepy arms_up
    "Now Owen has a creepy face and also has his arms up."
    "etc"        
 
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: Can't get Layered Images 'Variant Picker' to work

#3 Post by Geckos » Tue Aug 28, 2018 2:44 am

trooper6 wrote:
Tue Aug 28, 2018 1:30 am
It doesn't seem like you need a picker at all.
I use a picker because I want one keyword to pick multiple things. The Patreon article used a picker because it wanted to randomize which arms were shown. It looks like you just want to show some arms, not randomly, not as part of a multi-part conglomerate. You just want to show a variety of arms...which...you don't need a picker for.

Do you actually have variants? Because I'm not seeing any from the files you've provided. Assuming the files you showed are all the files we have, I'd get rid of the "1"s in your file name. And then I'd create your layered image like so:

Code: Select all

layeredimage owen:
    always "owen_base"
    group collar auto prefix "collar":
        attribute flat default
    group face auto:
        attribute neut default
    group arms auto prefix "arms":
        attribute down default
        
label start:
    show owen at left
    "This will show Owen."
    show owen collar_up
    "Now the collar is up."
    show owen -collar_up
    "Now the collar goes back to default, down."
    show owen creepy arms_up
    "Now Owen has a creepy face and also has his arms up."
    "etc"        
 
Ya, it is set up pretty well that I can dictate arm positions easily. I just wanted certain expressions to pull from certain arm poses: i.e. Thoughtful only has arms_up, grumpy only has arms_cross, and for neut to random between the 3. It would take away a bit of my workload and pave the way for future, more complicated, sprites.
Attachments
owen_lol2.jpg
Last edited by Geckos on Tue Aug 28, 2018 9:21 am, edited 2 times in total.
Image ImageImage

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Can't get Layered Images 'Variant Picker' to work

#4 Post by trooper6 » Tue Aug 28, 2018 3:08 am

If what you want is random arm choices, then you should just exactly copy the code in the Patreon article. The Picker code you posted above, for example, doesn't match the Picker Code on the Patreon article.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: Can't get Layered Images 'Variant Picker' to work

#5 Post by Geckos » Tue Aug 28, 2018 9:00 am

trooper6 wrote:
Tue Aug 28, 2018 1:30 am
It doesn't seem like you need a picker at all.
I use a picker because I want one keyword to pick multiple things. The Patreon article used a picker because it wanted to randomize which arms were shown. It looks like you just want to show some arms, not randomly, not as part of a multi-part conglomerate. You just want to show a variety of arms...which...you don't need a picker for.

Do you actually have variants? Because I'm not seeing any from the files you've provided. Assuming the files you showed are all the files we have, I'd get rid of the "1"s in your file name. And then I'd create your layered image like so:

Code: Select all

layeredimage owen:
    always "owen_base"
    group collar auto prefix "collar":
        attribute flat default
    group face auto:
        attribute neut default
    group arms auto prefix "arms":
        attribute down default
        
label start:
    show owen at left
    "This will show Owen."
    show owen collar_up
    "Now the collar is up."
    show owen -collar_up
    "Now the collar goes back to default, down."
    show owen creepy arms_up
    "Now Owen has a creepy face and also has his arms up."
    "etc"        
 
Tried putting the additional line from the Patreon code, as well as few other variants I found while troubleshooting in the lemmasoft forums and still no dice. I suppose it's time I go and rename everything to match the swimsuit nonsense so I can at least see if the base code works :P

*EDIT*
Sigh, so, I know building the sprite from the ground up let me understand more about what was going on, but a tiny piece of me is still like 'I can't believe that worked'

So I got the random arms working with this code:

Code: Select all

layeredimage owen:

    attribute_function Picker([
        "neut leftarm_hip",
        "neut leftarm_back",
        "neut leftarm_slack",

    ])
    
    


    group body:
        attribute swimsuit "owen_base_0"
        attribute apron default "owen_base_1"
        attribute shirt "owen_base_2"

    group leftarm:
        if_any "swimsuit"

        attribute leftarm_slack "owen_leftarm_slack_0"
        attribute leftarm_hip "owen_leftarm_hip_0"
        attribute leftarm_back "owen_leftarm_back_0"

    group leftarm:
        if_not "swimsuit"

        attribute leftarm_slack "owen_leftarm_slack_1"
        attribute leftarm_hip "owen_leftarm_hip_1"
        attribute leftarm_back "owen_leftarm_back_1"


    group face:
        attribute neut default
And some butchering of his image files for testing purposes.

Thanks for helping me figure it out XD OTL <3
Attachments
owen_lol2.jpg
Image ImageImage

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: Can't get Layered Images 'Variant Picker' to work

#6 Post by Geckos » Sun Sep 02, 2018 6:08 am

---
Image ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users