layered image's group can't be called

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
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

layered image's group can't be called

#1 Post by Anastimafilia »

Hello! I need some help with this layered image, whenever I call this layered image it only shows the default assets, calling the other group face layers never works

Code: Select all

layeredimage svero1:

    group body:
        attribute normal default "sv_lass"

    group face_effects:
        attribute no default Null()
        attribute blush1 "sv_blush1"

    group face:
        attribute regular default "sv_regular1"
        attribute pleasure "sv_pleasure"
        attribute anguish1 "sv_anguish1"
        attribute tease1 "sv_tease1"

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1060
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: layered image's group can't be called

#2 Post by m_from_space »

Anastimafilia wrote: Sun May 26, 2024 12:42 pm Hello! I need some help with this layered image, whenever I call this layered image it only shows the default assets, calling the other group face layers never works
So how do you show the image in the first place including the attributes you wanna show?

So this doesn't work?

Code: Select all

show svero1 blush1 tease1

User avatar
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

Re: layered image's group can't be called

#3 Post by Anastimafilia »

exactly, that code you just wrote doesn't work

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1060
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: layered image's group can't be called

#4 Post by m_from_space »

Anastimafilia wrote: Mon May 27, 2024 3:14 pm exactly, that code you just wrote doesn't work
So I tested it with mockup images, it works fine. But the face effects should probably be drawn after the face, if you want them to appear on top of the face.

Can you start the Renpy launcher, hit the "update" button, choose the latest "Renpy nightly fix" and try again? Also make sure the image files you are using are inside the "images" folder and that they have the correct filenames, e.g. "sv_blush1.png"!

Here is what is working for me:

Code: Select all

image sv_lass = Solid("#fff", xysize=(500, 500))

image sv_regular1 = Solid("#00f", xysize=(100, 100))
image sv_pleasure = Solid("#f0f", xysize=(100, 100))
image sv_anguish1 = Solid("#f00", xysize=(100, 100))
image sv_tease1 = Solid("#0ff", xysize=(100, 100))

image sv_blush1 = Solid("#f50", xysize=(50, 50))

layeredimage svero1:

    group body:
        attribute normal default "sv_lass"

    group face:
        attribute regular default "sv_regular1"
        attribute pleasure "sv_pleasure"
        attribute anguish1 "sv_anguish1"
        attribute tease1 "sv_tease1"

    group face_effects:
        attribute no default Null()
        attribute blush1 "sv_blush1"

# The game starts here.
label start:

    show svero1

    "..."

    show svero1 anguish1 blush1

    "..."

    return

User avatar
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

Re: layered image's group can't be called

#5 Post by Anastimafilia »

thanks for the reply, the reason why face effects are on top of my face layer is because those face effects are all simple alpha layers, notice how it's just a simple blush face effect, it works perfectly with all my other sprites, this one is the only one giving me a headache
file names are also fine, my work around is to call them like this

Code: Select all

show svero1

    sv "Hello"

    show svero1 anguish1
    
    sv "this summer is so hot!"
this method works OK but what I normally do with all other layered images is to simply code it like this

Code: Select all

show svero1

    sv "Hello"
    
    sv anguish1 "this summer is so hot!"
and this last example is what's giving me troubles for some reason

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1060
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: layered image's group can't be called

#6 Post by m_from_space »

Anastimafilia wrote: Tue May 28, 2024 1:18 pm thanks for the reply, the reason why face effects are on top of my face layer is because those face effects are all simple alpha layers, notice how it's just a simple blush face effect, it works perfectly with all my other sprites, this one is the only one giving me a headache
Uhm, yeah that's why I was mentioning it, because in your original code you let the "face_effects" layer underneath the "face" layer, the order inside the layered image matters. What is coming first, is drawn first. So that's why the "blush" should come last.
my work around is to call them like this

Code: Select all

show svero1

    sv "Hello"

    show svero1 anguish1
    
    sv "this summer is so hot!"
You told me that this is *not* working when I specifically asked for it. o.O
this method works OK but what I normally do with all other layered images is to simply code it like this

Code: Select all

show svero1

    sv "Hello"
    
    sv anguish1 "this summer is so hot!"
and this last example is what's giving me troubles for some reason
I mean if you want that to work, you have to connect the image to the character. I assume you have done that (otherwise it would throw an error anyway):

Code: Select all

define sv = Character("Name", image="svero1")
It works for me using my example code again:

Code: Select all

define e = Character("Eileen", image="svero1")

# The game starts here.
label start:

    show svero1

    e "I am normal."

    e anguish1 blush1 "I should be blushing at the moment."

    e tease1 "Teasing..."

    return

User avatar
Anastimafilia
Regular
Posts: 26
Joined: Mon May 30, 2022 3:43 pm
itch: anastimafilia
Discord: Anastimafilia#1400
Contact:

Re: layered image's group can't be called

#7 Post by Anastimafilia »

thanks a lot for your help, you made me realize it was a mistake I made while defining the character and creating the layered group
everything works now perfectly, thanks a lot, mods can close this thread now

Post Reply

Who is online

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