"image_name_component" not found error in layeredimage

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
Spallidshorse
Newbie
Posts: 12
Joined: Thu Dec 08, 2016 3:13 pm
Contact:

"image_name_component" not found error in layeredimage

#1 Post by Spallidshorse »

Hi!

I've been tasked with implementing layeredimages in a ren'py game and am running into a weird issue that I think must be on my end, but can't, for the life of me, figure out what the issue is:

Code: Select all

define b = Character("James")

layeredimage boy:
    image_format "images/characters/boy/{image}.png"

    group expression auto

label start:

    show boy normal

    boy talking "oh,hi"

    return
with these files:

Code: Select all

images/characters/boy/boy_expression_talking.png
images/characters/boy/boy_expression_annoyed.png
images/characters/boy/boy_expression_angry.png
images/characters/boy/boy_expression_resigned.png
images/characters/boy/boy_expression_disappointed.png
images/characters/boy/boy_expression_confused.png
images/characters/boy/boy_expression_thinking.png
images/characters/boy/boy_expression_yawning.png
images/characters/boy/boy_expression_normal.png

yields this:

Code: Select all

```
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 6: expected 'image_name_component' not found.
    group expression auto
         ^

Ren'Py Version: Ren'Py 7.2.2.491
Thu Apr 11 10:30:56 2019
```
I encounter the same error, at the same line (the first "group" statement) regardless of whether or not I define the group's attributes automatically or explicitly. Help!

User avatar
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: "image_name_component" not found error in layeredimage

#2 Post by XxrenxX »

I havent used this feature yet so I could be wrong but does {image}.png work? I was under the assumption it would use something like boy_expression_[prefix_].png similar to how the gui calls for various bars and strollers for screens.

Spallidshorse
Newbie
Posts: 12
Joined: Thu Dec 08, 2016 3:13 pm
Contact:

Re: "image_name_component" not found error in layeredimage

#3 Post by Spallidshorse »

The error persists with or without the call to image_format (which contains the {image}.png string).

Unless something broke in a recent update,

Code: Select all

    layeredimage foo:
        image_format: "image_locations/{image}.png" 
works and is proper (but maybe not for layeredimages where the image is defined automatically? [which doesn't matter for my purposes as the error persist regardless of whether or not the attributes are defined explicitly or automatically]). My recollection is that the image_format argument is basically just a string stored as a variable that layeredimage later interpolates, replacing "image" in the braces with the name_group_attribute to find the image location.

I feel like I must be messing up the names of the images when I save them, but I can't for the life of me figure out what I'm doing wrong.

Post Reply

Who is online

Users browsing this forum: Google [Bot]