Help with Ren'py game template

ENF Master

Member
Jul 16, 2017
208
516
Hi everyone, I am looking to make a very basic ren'py game with choices, just wondering if anyone has a template I can use for this. I am struggling a bit with the tutorials and creating it from scratch.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,971
16,228
Hi everyone, I am looking to make a very basic ren'py game with choices, just wondering if anyone has a template I can use for this. I am struggling a bit with the tutorials and creating it from scratch.
Er... There's no possible template for this ; it's the whole game that would need to be covered by it.

There's the template you're looking for :
Code:
default changeThisFlagName = False

define mc = Character( "Change the name" )
define CHANGETHIS = Character( "Change this name" )

label start:
    scene CHANGE_THIS_SCENE_NAME
    mc "CHANGE THIS DIALOG LINE"
    mc "CHANGE THIS DIALOG LINE"
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    scene CHANGE_THIS_SCENE_NAME
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    scene CHANGE_THIS_SCENE_NAME
    mc "CHANGE THIS DIALOG LINE"

    menu:
        "CHANGE THIS CHOICE":
            $ changeThisFlagName = True
            mc "CHANGE THIS DIALOG LINE"
           CHANGETHIS "CHANGE THIS DIALOG LINE"
           scene CHANGE_THIS_SCENE_NAME
            mc "CHANGE THIS DIALOG LINE"
            mc "CHANGE THIS DIALOG LINE"
           CHANGETHIS "CHANGE THIS DIALOG LINE"
        "CHANGE THIS CHOICE":
            $ changeThisFlagName = False
            mc "CHANGE THIS DIALOG LINE"
           scene CHANGE_THIS_SCENE_NAME
            mc "CHANGE THIS DIALOG LINE"

    scene CHANGE_THIS_SCENE_NAME
    mc "CHANGE THIS DIALOG LINE"
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    scene CHANGE_THIS_SCENE_NAME

    menu:
        "CHANGE THIS CHOICE":
             jump CHANGE_THIS_LABEL_NAME

        "CHANGE THIS CHOICE":
             jump ALSO_CHANGE_THIS_LABEL_NAME


label CHANGE_THIS_LABEL_NAME:
         mc "CHANGE THIS DIALOG LINE"
        CHANGETHIS "CHANGE THIS DIALOG LINE"
        scene CHANGE_THIS_SCENE_NAME
        mc "CHANGE THIS DIALOG LINE"
        mc "CHANGE THIS DIALOG LINE"
       CHANGETHIS "CHANGE THIS DIALOG LINE"
jump CHANGE_THIS

label ALSO_CHANGE_THIS_LABEL_NAME:
        mc "CHANGE THIS DIALOG LINE"
       CHANGETHIS "CHANGE THIS DIALOG LINE"
       scene CHANGE_THIS_SCENE_NAME
       mc "CHANGE THIS DIALOG LINE"
       mc "CHANGE THIS DIALOG LINE"
       CHANGETHIS "CHANGE THIS DIALOG LINE"
      jump CHANGE_THIS


label CHANGE_THIS:
    [...]
Not a real help, right ?
 

ENF Master

Member
Jul 16, 2017
208
516
Er... There's no possible template for this ; it's the whole game that would need to be covered by it.

There's the template you're looking for :
Code:
default changeThisFlagName = False

define mc = Character( "Change the name" )
define CHANGETHIS = Character( "Change this name" )

label start:
    scene CHANGE_THIS_SCENE_NAME
    mc "CHANGE THIS DIALOG LINE"
    mc "CHANGE THIS DIALOG LINE"
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    scene CHANGE_THIS_SCENE_NAME
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    scene CHANGE_THIS_SCENE_NAME
    mc "CHANGE THIS DIALOG LINE"

    menu:
        "CHANGE THIS CHOICE":
            $ changeThisFlagName = True
            mc "CHANGE THIS DIALOG LINE"
           CHANGETHIS "CHANGE THIS DIALOG LINE"
           scene CHANGE_THIS_SCENE_NAME
            mc "CHANGE THIS DIALOG LINE"
            mc "CHANGE THIS DIALOG LINE"
           CHANGETHIS "CHANGE THIS DIALOG LINE"
        "CHANGE THIS CHOICE":
            $ changeThisFlagName = False
            mc "CHANGE THIS DIALOG LINE"
           scene CHANGE_THIS_SCENE_NAME
            mc "CHANGE THIS DIALOG LINE"

    scene CHANGE_THIS_SCENE_NAME
    mc "CHANGE THIS DIALOG LINE"
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    CHANGETHIS "CHANGE THIS DIALOG LINE"
    scene CHANGE_THIS_SCENE_NAME

    menu:
        "CHANGE THIS CHOICE":
             jump CHANGE_THIS_LABEL_NAME

        "CHANGE THIS CHOICE":
             jump ALSO_CHANGE_THIS_LABEL_NAME


label CHANGE_THIS_LABEL_NAME:
         mc "CHANGE THIS DIALOG LINE"
        CHANGETHIS "CHANGE THIS DIALOG LINE"
        scene CHANGE_THIS_SCENE_NAME
        mc "CHANGE THIS DIALOG LINE"
        mc "CHANGE THIS DIALOG LINE"
       CHANGETHIS "CHANGE THIS DIALOG LINE"
jump CHANGE_THIS

label ALSO_CHANGE_THIS_LABEL_NAME:
        mc "CHANGE THIS DIALOG LINE"
       CHANGETHIS "CHANGE THIS DIALOG LINE"
       scene CHANGE_THIS_SCENE_NAME
       mc "CHANGE THIS DIALOG LINE"
       mc "CHANGE THIS DIALOG LINE"
       CHANGETHIS "CHANGE THIS DIALOG LINE"
      jump CHANGE_THIS


label CHANGE_THIS:
    [...]
Not a real help, right ?
What I meant was a basis to start with, something with quotations so I can get the general grasp for it. Not a whole game. I'm just struggling to get it right at the moment so I was hoping that seeing the ready code, for a simple game would sort of help kickstart my brain. I'm an artist, not really a programmer.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,971
16,228
[...] I was hoping that seeing the ready code, [...]
Then take any ren'py game you want, and use unren ( , ) to look at its code.
 

moskyx

Forum Fanatic
Jun 17, 2019
4,223
13,984
What I meant was a basis to start with, something with quotations so I can get the general grasp for it. Not a whole game. I'm just struggling to get it right at the moment so I was hoping that seeing the ready code, for a simple game would sort of help kickstart my brain. I'm an artist, not really a programmer.
You can start looking at the script.rpy file of "The Question", the demo game that comes with Ren'Py SDK (renpy/The Question/game). You have 2 characters defined, a simple True/False variable and some menu choices (the ones you use to "jump" to another sections of the game, called labels). You also can see how the pics are displayed thanks to the "scene" and "show" actions. Then you can look into more complex games