[Suggestion] new default script.rpy

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
User avatar
Lemma-Class Veteran
Posts: 2146
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor

[Suggestion] new default script.rpy

#1 Post by Imperf3kt » Sat Sep 02, 2017 9:24 am

A lot of forum posts recently have been riddled with indentation issues and general incorrect usage of Ren'Py.
I believe these people haven't read the documentation or cannot understand it, so I made a few additions to the default script.rpy in order to show basic examples of the most common features of Ren'Py usage and was wondering if it was worth replacing the default script when making a new game.

I do understand that it might also be too complicated for a complete newbie, but these are things they will require to learn, and a visual representation is the best way to show correct usage in my opinion.

Would anyone agree this is an improvement, or is it not?

Code: Select all

# The script of the game goes in this file.

# Declare characters used by this game. The color argument colorizes the
# name of the character.

define e = Character("Eileen")

# default any variables used in the game.

default cookies = 0

# The game starts here.

label start:

    # Show a background. This uses a placeholder by default, but you can
    # add a file (named either "bg room.png" or "bg room.jpg") to the
    # images directory to show it.

    scene bg room

    # This shows a character sprite. A placeholder is used, but you can
    # replace it by adding a file named "eileen happy.png" to the images
    # directory.

    show eileen happy

    # These display lines of dialogue.

    "Hello, world."

    e "You've created a new Ren'Py game."

    e "Once you add a story, pictures, and music, you can release it to the world!"

    # This is a label. It is used as a point to jump to or call.
    # Labels are always placed on the very left of your script with no indentation.
    # All content contained within the label is indented by four spaces.
    # When naming labels, do not put any spaces in them. Use underscores if you need a space.
label make_a_choice:

    # This is a choice menu which is used to give he player options to choose from that control
    # how the story unfolds in your game.
        "Are you ready to begin making your game?"
        # This puts a question on the screen at the same time as the choices. Leave it out if you want.
            jump lets_go
            jump not_yet

label not_yet:
    e "Would you like to have some cookies and milk while you make up your mind?"
    e "They really are delicious."
    # Let's try calling a label. This is similar to a jump, except it will return here after you reach a "return" in the label.
    call callme
    # This is a conditional. It is used to check variables and act accordingly.
    if cookies > 0:
        # This says if we have more than 0 cookies.
        # This is how to display a variable mid-sentence.
        e "You've eaten [cookies] cookies."

    if cookies < 1:
        # This says if cookies are less than 1.
        e "You haven't eaten any cookies."
    elif cookies == 3:
        # This says if the cookies variable is equal to 10.
        e "I think you've had enough..."
        jump secret_label
    jump make_a_choice

label lets_go:
    # This is a hyperlink. It will make text a link and open a webpage if clicked.
    e "Alright then, have fun and remember you can always ask for help at the {a=https://lemmasoft.renai.us/}Lemmasoft forums{/a}."
    # This ends the game.
label callme:    
            # This is how to adjust a variable which is defined before the start label.
            # Here, we are adding 1 cookie to our variable, so we use the python function +=
            # and give it a value to change it by. To remove cookies, use -= or to set it to
            # a desired number, use =
            $ cookies += 1
            # This is how to make a choice continue on as if nothing happened.
        "No thanks. I'm trying to cut back on sweets.":
        # The menu ends here, so we need to close the block by removing one level of indentation.
label secret_label:
    e "You ate all my cookies."
    e "Well, I did keep offering them."
    e "So now you know the basics of Ren'Py, its time to get started on making your own game."
    e "Have fun and remember these simple points while making your game."
    # This ends the game
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
Ren'Py Creator
Posts: 15316
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY

Re: [Suggestion] new default script.rpy

#2 Post by PyTom » Sat Sep 02, 2017 1:36 pm

My initial reaction is that this is way too complicated - implementing far too many concepts for someone who's just starting on their game. I sort of worry that someone will see this and lol-nope out, rather than building little by little, only adding the concepts they're interested in. Certainly, I don't think think we need calls and secret endings.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Lemma-Class Veteran
Posts: 2146
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor

Re: [Suggestion] new default script.rpy

#3 Post by Imperf3kt » Sat Sep 02, 2017 4:19 pm

Thats what I was afraid of.
The more I wrote it, the more I thought "this is getting too much."

Maybe this is better off as a tutorial, but you've already got that covered with the tutorial that ships with Ren'Py. Can't force-feed people after all.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

User avatar
Lemma-Class Veteran
Posts: 3524
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA

Re: [Suggestion] new default script.rpy

#4 Post by trooper6 » Sat Sep 02, 2017 4:21 pm

A lot of this is also in the script for The Question. You can lead a horse to water, but you can't make them drink.
The only think I think needs to be incorporated into the script/documentation is using default and define...because no one seems to get that.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Posts: 6
Joined: Tue Dec 12, 2017 6:53 am
Projects: Your Life Is A Failure Simulator
Organization: S.H.Y.
IRC Nick: Hesyisytehray
Tumblr: hesyisytehray
Deviantart: Hesyisytewithhray
Github: hesyisytehray
Skype: Hesyisytehray
Soundcloud: Hesyisytehray
itch: hesyisytehray
Location: SEA

Re: [Suggestion] new default script.rpy

#5 Post by Hesyisytehray » Tue Dec 12, 2017 9:49 am


Seems that this forum is very interesting place for learning 😊

Posts: 235
Joined: Wed Sep 24, 2014 5:03 pm
Projects: No Good Wife
Organization: Wild Rose Interactive

Re: [Suggestion] new default script.rpy

#6 Post by verysunshine » Tue Feb 13, 2018 5:03 pm

What you're suggesting is basically "The Question" and the basic parts of the tutorial. Maybe adding a line to the default script informing people about the tutorial and The Question would be helpful.

"Date for the romance. Marry for the truth." - No Good Wife

Post Reply

Who is online

Users browsing this forum: No registered users