Page 1 of 1

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

Posted: Tue Aug 28, 2018 12:35 am
by Geckos
Didn't end up getting it working~ got more errors and abandoned the pursuit! May return to at a later date

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

Posted: Tue Aug 28, 2018 1:30 am
by trooper6
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"        
 

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

Posted: Tue Aug 28, 2018 2:44 am
by Geckos
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.

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

Posted: Tue Aug 28, 2018 3:08 am
by trooper6
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.

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

Posted: Tue Aug 28, 2018 9:00 am
by Geckos
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

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

Posted: Sun Sep 02, 2018 6:08 am
by Geckos
---