layeredimage expected statement

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
_GooseWithAKeyboard_
Newbie
Posts: 4
Joined: Wed Dec 29, 2021 11:45 pm
Projects: Something Under the Parlor Floor
Location: Asia-Pacific
Contact:

layeredimage expected statement

#1 Post by _GooseWithAKeyboard_ »

I'm trying to make a layered image for one of my characters. RenPy is not able to pick up the statement attached and instead says the following:
File "game/002charspriteinit.rpy", line 2: expected statement.
layeredimage a->:

This is the code I'm using at the moment.

Code: Select all

layeredimage a:

    always:
        "a_face"

    group left:

        attribute ldef default:
            "a_left_ldef"

        attribute lpose:
            "a_left_lpose"

    group right:

        attribute rdef default:
            "a_right_rdef"

        attribute rpose:
            "a_right_rpose"

    group xpress:

        attribute flush:
            "a_xpress_flush"

    group eyes:

        attribute open default:
            "a_eyes_open"
            default True

        attribute narrowed:
            "a_eyes_narrowed"

    group mouth:

        attribute d default:
            "a_mouth_d"

        attribute f:
            "a_mouth_f"
I have made the following attempts to fix this issue:
  • Removing the initial colon (arrow simply faced in the opposite direction)
  • Autodefining as many attributes as possible (did nothing)
  • Removing the blank lines between sections (did nothing)
  • Adding more blank lines between sections (did nothing)
  • Copy-pasting text directly from the documentation and switching out the attribute names/filenames (did nothing)
  • Turning RenPy on and off again (did nothing)
At this point I feel like I'm either missing out on something very, very simple, or I have somehow broken the game files (again). Please help...

Edit: The code works perfectly well when I put it into a testing program on its own. Is there some way other RenPy statements could be messing with it?
Edit 2: When placed, along with the rest of the init blocks, at the beginning of the script.rpy file, everything runs just fine. I do not know why, since I specifically isolated 001scriptinit.rpy and 002charspriteinit.rpy to be picked up first as a safety measure, but that's what happens. I've been advised by a family member that this may be a compiling issue? I'd still like to know what specifically caused this, though, since piling everything into script.rpy can't be economical in the long run.
- Formatting Dictionaries Incorrectly Since Now, Apparently -

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: layeredimage expected statement

#2 Post by Per K Grok »

_GooseWithAKeyboard_ wrote: Thu Jan 13, 2022 1:48 am ---
I do not know why, since I specifically isolated 001scriptinit.rpy and 002charspriteinit.rpy to be picked up first as a safety measure, but that's what happens. I've been advised by a family member that this may be a compiling issue? I'd still like to know what specifically caused this, though, since piling everything into script.rpy can't be economical in the long run.
I'm not sure what "isolated 001scriptinit.rpy and 002charspriteinit.rpy to be picked up first" means. Maybe 'init offset=- someting' ?

The problem could be that you are trying to run the code before other necessary parts to run that code is in place.

Splitting the code up in different rpy-files does not in itself cause any problem.

Gouvernathor
Newbie
Posts: 23
Joined: Thu Aug 06, 2020 9:27 am
Github: Gouvernathor
Discord: Armise#6515
Contact:

Re: layeredimage expected statement

#3 Post by Gouvernathor »

My guess is that there's probably something just before the layeredimage declaration that's messing with it. Try putting it at the beginning of the file where it caused a problem ?

Post Reply

Who is online

Users browsing this forum: No registered users