Layered images - "Unknown Attributes" error

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
dragonsmidst
Newbie
Posts: 5
Joined: Mon Nov 02, 2020 2:49 pm
itch: Rollback
Contact:

Layered images - "Unknown Attributes" error

#1 Post by dragonsmidst » Sun Dec 20, 2020 8:41 pm

Hello,

I've been working on a Ren'Py game (including here that it's NSFW if that's required or anything) for a little while now and this is the first time I've run into this error and can't figure out how to resolve it. I've scoured these forums and google, but haven't found anything that I've been able to follow along with and resolve my issue. I'm currently using layered images for the game's sprites and have been using the shortened version from the layered images documentation. I've been using the same format for all of the sprites, but when I've added the most recent sprite I get the error "qrom unknown attributes: qrom". Qrom is the name of the character and below is the layered image code I'm using:

Code: Select all

########## Qrom ##########

layeredimage qrom:

    always "qrom_base"

    group expressions:
        attribute neutral default:
            "qrom_expression_neutral"

        attribute blush:
            "qrom_expression_blush"

    group outfit auto


##### Qrom Side #####

image side qrom armor_full = "Characters/Qrom/qrom_side_armor_neutral.png"
image side qrom casual = "Characters/Qrom/qrom_side_casual_neutral.png"
image side qrom armor_halfnude = "Characters/Qrom/qrom_side_nude_neutral.png"
image side qrom casual shirtless = "Characters/Qrom/qrom_side_halfnude_neutral.png"
image side qrom towel = "Characters/Qrom/qrom_side_nude_neutral.png"
image side qrom nude = "Characters/Qrom/qrom_side_nude_neutral.png"
image side qrom nude_erect = "Characters/Qrom/qrom_side_nude_neutral.png"

image side qrom armor_full blush = "Characters/Qrom/qrom_side_armor_blush.png"
image side qrom casual blush = "Characters/Qrom/qrom_side_casual_blush.png"
image side qrom armor_halfnude blush = "Characters/Qrom/qrom_side_nude_blush.png"
image side qrom shirtless blush = "Characters/Qrom/qrom_side_halfnude_blush.png"
image side qrom towel blush = "Characters/Qrom/qrom_side_nude_blush.png"
image side qrom nude blush = "Characters/Qrom/qrom_side_nude_blush.png"
image side qrom nude_erect blush = "Characters/Qrom/qrom_side_nude_blush.png"
This is the same code I've been using for every character in the game (aside from the expressions group) and they all work fine. Also, if I put this code in a new game it works perfectly fine and I don't get the error. It's only when trying to use it in my actual game I get the error. Sorry if I made a dumb error or missed an indent or something silly. I'm still very new to coding in general. The rest of the code for the character is below. They're in separate .rpy files for my own sanity though I don't believe that's supposed to affect it. I've also gone as far as to delete all of the save files in case there was something getting carried over weirdly that was causing the issue.

Code: Select all

define q = Character ("Qrom", color="c9c9c7", window_background="BG/Menus/qrom_textbox.png", image="qrom", who_size=45, who_ypos=39, what_prefix='"', what_suffix='"')

define qmys = Character("???", window_background="BG/Menus/mys_textbox.png", image="qrom", who_size=45, who_ypos=39, who_color="ff4747", what_prefix='"', what_suffix='"')

Code: Select all

em "Alright, this is the west wing where the men stay. Your dorm supervisor should be around here somewhere. {size=25}If he's not passed out drunk somewhere.{/size}"

            show qrom casual at center
            with dissolve

            qmys "Oho, looks like you brought me some fresh meat, Little Em."
The side images are also not working correctly, but I assume that's to do with the main asset error. Also, I haven't included any game screen shots since it shows the nude sprite as the default base and didn't want to risk posting NSFW images unless absolutely necessary. Thanks in advance for any help you're able to offer. :)

User avatar
_ticlock_
Veteran
Posts: 323
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Layered images - "Unknown Attributes" error

#2 Post by _ticlock_ » Mon Dec 21, 2020 8:54 pm

Hi, dragonsmidst,

You use:

Code: Select all

show qrom casual at center
However, in your layeredimage qrom I don't see the attribute casual. That is why you have 'unknown attribute'.
For the next line:

Code: Select all

qmys "Oho, looks like you brought me some fresh meat, Little Em."
Renpy tries to find side image with tags qrom and casual, so you should not have any problems with correct side image.

PS: You don't need two characters q and qmys. Instead you can use dynamic=True property to change qrom name:

Code: Select all

define q = Character ("qrom_name", dynamic=True, color="c9c9c7", window_background="BG/Menus/qrom_textbox.png", image="qrom", who_size=45, who_ypos=39, what_prefix='"', what_suffix='"')

label start:
    $ qrom_name = "???"
    q "Oho, looks like you brought me some fresh meat, Little Em."
Also, I believe you can also use another layeredimage for side images, to make things more organized. (I am not sure if layeredimage attributes work with side images :oops: )

dragonsmidst
Newbie
Posts: 5
Joined: Mon Nov 02, 2020 2:49 pm
itch: Rollback
Contact:

Re: Layered images - "Unknown Attributes" error

#3 Post by dragonsmidst » Mon Dec 21, 2020 9:54 pm

Hey, thanks for answering. I hadn't known about a dynamic property. That's really cool and I'll have to try that out, thanks! As for the missing casual arrtibute, shouldn't having

Code: Select all

group outfit auto
eliminate the need to create every combination of outfit as an attribute? The Automatic Attributes section in the layered image documentation had me under the impression that using the keyword "auto" told renpy to search the folders for anything matching down the line. So having an image labeled qrom_outfit_casual.png should have renpy go down the line seeing qrom, then the outfit category and find the casual labeled one?

This is how I have the images saved:
sprite outfits.PNG
However, I did also try what you suggested (I think) and added a casual attribute and still no dice.

Code: Select all

########## Qrom ##########

layeredimage qrom:

    always "qrom_base"

    group expressions:
        attribute neutral default:
            "qrom_expression_neutral"

        attribute blush:
            "qrom_expression_blush"

    group outfit auto:
        attribute casual default:
            "qrom_outfit_casual"
I still get the same error where the sprite shows as the base and the default neutral expression, but the outfit does not work.
asset error.png
My apologies if I'm misinterpreting what you are saying.

User avatar
_ticlock_
Veteran
Posts: 323
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Layered images - "Unknown Attributes" error

#4 Post by _ticlock_ » Mon Dec 21, 2020 11:22 pm

My apologies. I should have read more carefully.
I took another look and don't see the actual problem. You mentioned that it works in a new project, though.
Did you try Force Recompile?
Am I correct that it shows the base image but fails to show the attribute image?

dragonsmidst
Newbie
Posts: 5
Joined: Mon Nov 02, 2020 2:49 pm
itch: Rollback
Contact:

Re: Layered images - "Unknown Attributes" error

#5 Post by dragonsmidst » Tue Dec 22, 2020 12:29 am

Just tried force recompile and that still didn't work. Then I tried deleting the persistent data and force recompile, still no luck. If I copy/paste my characters.rpy, images.rpy, and the image folder into a new project it works as it's supposed to.

Yes, the error is that it shows only the base image and will put the default expression on (though if I try to change the expression it doesn't work. Also defaulting an outfit does not work either, it's still just the base showing.) and is not showing the outfit attribute.

I also tried creating a new project and copy/pasting all the files into it and I will get the error again. Maybe it's something else in my code somewhere that's somehow messing with the attributes for this specific character? But the only code I changed between before and after adding the sprite assets was dialog and nothing fancy. So I'm just at a loss as to why it would just not work based on some sort of dialog text. :(

dragonsmidst
Newbie
Posts: 5
Joined: Mon Nov 02, 2020 2:49 pm
itch: Rollback
Contact:

Re: Layered images - "Unknown Attributes" error

#6 Post by dragonsmidst » Tue Dec 22, 2020 2:39 pm

Okay, so I created a new project and copy/pasted all the files aside from the one the character was first being called, then I wrote all the code for that part again manually and it's working now. I don't know if maybe somehow there was a typo somewhere in the dialog that caused the error, but it seems to be resolved now. Thank you for your help with this, especially the dynamic name, that worked so awesomely. :)

Post Reply

Who is online

Users browsing this forum: rayminator