LayeredImage Won't Show a Layer

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
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

LayeredImage Won't Show a Layer

#1 Post by ArizaLuca »

This is the code for the person:

Code: Select all

layeredimage dollmaker:
    always:
        "dollmaker_base"
    group eyes auto:
        attribute normal default:
            "dollmaker blink"
        attribute halfshut:
            "dollmaker halfshut blink"
        attribute screwedup:
            "dollmaker_eyes_screwedup"
        attribute closed:
            "dollmaker_eyes_closed"
        attribute averted:
            "dollmaker averted blink"
        attribute squint:
            "dollmaker squint blink"
        attribute wide:
            "dollmaker wide blink"
    group mouth auto:
        attribute smile default
    group eyebrows auto:
        attribute normal default
    if Dshadow:
        "dollmaker_shadow"
    if Dshadow2:
        "dollmaker_shadow2"
    group outfit auto:
        attribute cloak default:
            "dollmaker_outfit_cloak"
    if Dtears:
        "dollmaker_tears"
    if Dsweatdrop:
        "dollmaker_sweatdrop"
The code for being implemented into the game:

Code: Select all

show bg shop day onlayer back
    with fade
    
    "Most people would overlook the small, cramped shop with purple curtains and a deep purple overhang crammed on the corner, stars embroidered in the curtains and seemingly giving off a faint glow."

    "Most people would look at the window, momentarily admiring the handpainted sign and the many handcrafted dolls in the window, all adorable in their own ways and verging on cartoonish or goofy in some cases, narrowly avoiding being creepy, before rushing past."

    "Most people would."
    
    show dollmaker onlayer front
    with dissolve

    "The bell gave a cheerful, bright tune, making the hooded shopkeeper look up from the counter. A warm smile was fixed on her features."

    show dollmaker screwedup onlayer front
    with dissolve

    D "Hello, and welcome to Desruc Dolls. Are you looking for anything in particular today?"
However, when the second one is shown, the eyebrows disappear.
Screen Shot 2019-03-06 at 4.09.29 PM.png
but with the other one, there is nothing wrong...
Screen Shot 2019-03-06 at 4.09.36 PM.png
What happened?

Also, if I try to manually add in the correct attributes, there is an error here:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 97, in script
    show dollmaker screwedup smile normal onlayer front
  File "renpy/common/00layeredimage.rpy", line 736, in _choose_attributes
    raise Exception("The attributes for {} conflict: {}".format(tag, " ".join(both)))
Exception: The attributes for dollmaker conflict: screwedup normal

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 97, in script
    show dollmaker screwedup smile normal onlayer front
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 1165, in execute
    show_imspec(self.imspec, atl=getattr(self, "atl", None))
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 1135, in show_imspec
    atl=atl)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 684, in show
    new_what = renpy.game.context().images.apply_attributes(layer, key, name)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 919, in apply_attributes
    return self.choose_image(nametag, required, optional, name)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 936, in choose_image
    newattrs = ca(tag, ca_required, ca_optional)
  File "renpy/common/00layeredimage.rpy", line 736, in _choose_attributes
    raise Exception("The attributes for {} conflict: {}".format(tag, " ".join(both)))
Exception: The attributes for dollmaker conflict: screwedup normal

Darwin-18.0.0-x86_64-i386-64bit
Ren'Py 7.2.0.424
DollGame 1.0
Wed Mar  6 16:19:17 2019

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: LayeredImage Won't Show a Layer

#2 Post by mitoky »

I am guessing the issue is caused by naming two attributes the same way :

Code: Select all

group eyes auto:
        attribute normal default:
            "dollmaker blink"

Code: Select all

    group eyebrows auto:
        attribute normal default
So when "normal" changes into something else, the eyebrows which too are named "normal" dissapear as well. So rename the eyebrows and the issue should dissapear.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Alex