Creating a group

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
Bum_McFluff
Regular
Posts: 45
Joined: Sat Aug 18, 2018 8:15 pm
Contact:

Creating a group

#1 Post by Bum_McFluff »

I want to create layered image characters, but can't find how to make the group in the first place. If I want to make a new image I add (for example) image r = 'characters/robin.png' to my image.rpy file. I assumed it might be similar to this, adding something like: group r = 'characters/robin/body/base/robin_base_00.png' but I keep getting errors that I can't interpret. This is my first foray into making a game.

Code: Select all

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

File "game/groups.rpy", line 7: expected statement.
    group r = 'characters/robin/body/base/robin_base.png'
            ^
Ren'Py Version: Ren'Py 7.3.5.606
Sat Feb 08 16:43:05 2020
It says 'expected statement', but I don't know what type of statement I can make except 'HELP!'
What, spy on our spy as he searches for their spy? Why not, sounds rather like fun.

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: Creating a group

#2 Post by Per K Grok »

Bum_McFluff wrote: Sat Feb 08, 2020 1:46 am I want to create layered image characters, but can't find how to make the group in the first place. If I want to make a new image I add (for example) image r = 'characters/robin.png' to my image.rpy file. I assumed it might be similar to this, adding something like: group r = 'characters/robin/body/base/robin_base_00.png' but I keep getting errors that I can't interpret. This is my first foray into making a game.

Code: Select all

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

File "game/groups.rpy", line 7: expected statement.
    group r = 'characters/robin/body/base/robin_base.png'
            ^
Ren'Py Version: Ren'Py 7.3.5.606
Sat Feb 08 16:43:05 2020
It says 'expected statement', but I don't know what type of statement I can make except 'HELP!'
No you do not define groups like you can do with images. Groups are defined in the definition of the layered image.

Code: Select all

layeredimage kombi:

    always:
        "hat1"

    group r:
        attribute glad:
            "tie1"

        attribute sad:
            "shoes1"

label start:

    show kombi glad
    "I'm glad"

    show kombi sad
    "I'm sad"

"hat1", "tie1" and "shoes1" are all images.

You can refer to an image with the full address, as you described "characters/robin.png" or only with the image name without the suffix; "robin". Ren'py will find the image. You must make sure you only have one image with that name, though.

When starting out doing games you should keep things very simple. You should probably not bother with stuff like layered images until you have done a couple of small games using more basic stuff.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Creating a group

#3 Post by Alex »


User avatar
Bum_McFluff
Regular
Posts: 45
Joined: Sat Aug 18, 2018 8:15 pm
Contact:

Re: Creating a group

#4 Post by Bum_McFluff »

You can refer to an image with the full address, as you described "characters/robin.png" or only with the image name without the suffix; "robin". Ren'py will find the image. You must make sure you only have one image with that name, though.

When starting out doing games you should keep things very simple. You should probably not bother with stuff like layered images until you have done a couple of small games using more basic stuff.
Thanks for that, I am going to start small, but eventually I want to use this and if I can get my head around it now, I may be able to plan better going forward. Thanks again.
What, spy on our spy as he searches for their spy? Why not, sounds rather like fun.

Post Reply

Who is online

Users browsing this forum: Ocelot