Question on new RenPY

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Message
Author
MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

Question on new RenPY

#1 Post by MoonKarla »

Hi!! I'm back after this whole lot of time, and I started doing my game. But I got a problem, I have the new RenPY 5.6.4 version or soemthign like that.. my question si..where I put ALL of the files I need in for the game?

Because when I declare hten and run the game, they come out that it can't find it. And how do I put music and audio to the game? o.o

I got a curious question about the menu choices: If a choice meu has 2 chioces and those chioices affect on how the story goes, like for exmaple:

Choice 1- Go on date with Cynthia?
Choice 2- Not to go.


If the main chara chose the first option, he goes on the date and gets a desilusion, but if he chooses the second option, he doens't disappointed and realizes about the other character's feelings earlier.

How does anyone code that? is it possible?
Image

User avatar
Mirielle
Regular
Posts: 130
Joined: Thu Nov 02, 2006 5:05 am
Deviantart: miirne
Soundcloud: mirne-1
Contact:

#2 Post by Mirielle »

Haha! I may not be the best at programming, but this I can actually help you with!
where I put ALL of the files I need in for the game?
When you create a new project, it creates a folder inside the version of Ren'Py your using and it titles itself as your game. Inside this folder, there is another folder entitled game, in which you put everything such as music, pictures, etc. Your script is also in this folder.

And in regards to your second question I think it would go something like this...

Code: Select all

menu:

    "Go on a date with Cynthia?"

    "Yes":
        $ cynthia_date = True
        "POV" "Of course I will Cynthia!"

    "No":
        $cynthia_date = False
        "POV" "I'm sorry Cynthia, I can't."

if cynthia_date == True:
    "I went on a date and had a delusion."

elif cynthia_date == False:
    "I felt bad that I didn't go out with Cynthia, I wish I had realized her feelings earlier." 

        
Pretty sure that's how it works, you can also use a points system, which is the only other thing I know how to do.
Available for voice acting - Please listen to my demo reel!

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#3 Post by MoonKarla »

Thanks ^^ but I put the images in the game folder andd it still says bg musaroom not found O.O

And I declared it like this:
## Declare images.

image bg black = "#000000"
image bg gray = "#c0c0c0"
# image bg mbedroom = "musa-room.jpeg"
#image bg school = "school.jpeg"
# image eileen happy = "eileen_happy.png"
the bedroom and the school ones are mine, the other two were in the game already and I leave them to guide myself
Image

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

#4 Post by Jake »

MoonKarla wrote:And I declared it like this:

Code: Select all

    # image bg mbedroom = "musa-room.jpeg"
The '#' at the beginning of the line tells Ren'Py that the line is a comment and should be ignored - it's so you can put explanatory text, notes, reminders and so on in amongst your script that Ren'Py doesn't try and interpret as instructions or dialogue.

Remove the '#' and line the indents up again and try it again. If that still doesn't work, check that the name (the 'mbedroom' in 'image bg mbedroom = "musa-room.jpeg") is spelled correctly in all the places it's written.
Server error: user 'Jake' not found

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#5 Post by MoonKarla »

Thanks!! Now It works!! *dances*
Image

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#6 Post by MoonKarla »

Hii! Now I'm curious about some things.

I'm trying to do another game which is shorter than my first (unfinished) project. I got two questions on the programming.

-How do I do with the points? How do I make for the game to count scores and give a grade for them.

-How do I make the user to type a name for the character they choose?

-BTW, how do I make a user to choose a between four characters (students) and two professors??

My project is for science week, consists in a short program, where the user chooses a teacher and a student, the user assumes the student role where he/she has to answer 10 questions about natural sciences or chemistry.

I hope its a good idea for a science project and that I'm not bothering anybody.
Image

F.I.A
Miko-Class Veteran
Posts: 546
Joined: Wed Sep 21, 2005 10:49 pm
Projects: Winter Shard, EVE, Hyperion
Contact:

#7 Post by F.I.A »

MoonKarla wrote: -How do I do with the points? How do I make for the game to count scores and give a grade for them.

My project is for science week, consists in a short program, where the user chooses a teacher and a student, the user assumes the student role where he/she has to answer 10 questions about natural sciences or chemistry.

Code: Select all

    #To set up a grade count, first you must set up a variable, which will be Mark.
    $ Mark = 0
    
    #When you answer a question, you can deduct/add point depending on the answer. Like this...
    menu question_1:
        "Who theorized that gravity caused the apple to fall on his head?"
        "Newton":
            $ Mark += 1
        "Graham":
            pass
    
    menu question_2:
        "Who thought up 'E=mc2'?"
        "Einstein":
            $ Mark += 1
        "Curien":
            pass
    
    menu question_3:
        "Can anyone hear you yell in space?"
        "Yes."
            pass
        "No."
            $ Mark +=1
            
    #You can then set up a grade by checking on the value in Mark, which can be 0,1,2 or 3.
    
    if Mark > 2:
        "Good. I am going rather well."
    elif Mark = 2:
        "Average, huh?"
    elif Mark = 1:
        "Ack"
    elif Mark = 0:
        "I made a monkey looks smarter..."

I can only answer one for now with these limited times. Check the Ren'py thread for the other two.
「通りすがりのメーカだ。覚えとけ。」

----------
Winter shard
Image
WIP: Hyperion(Trace unknown), ?????(Progressing)

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#8 Post by MoonKarla »

Thanks ^^ Luckily the coding is alike to when I did something like that in BASIC (I used to practice on that language when I was in 11th)
Image

absinthe
Regular
Posts: 194
Joined: Sat Dec 10, 2005 12:26 am
Contact:

#9 Post by absinthe »

This is how I've been doing player input (but there might be a better way to do it now!).

Code: Select all

    "The teacher looks at me, waiting for me to give my name."

    $ first_name = renpy.input("What is your first name?")
    $ last_name = renpy.input("What is your last name?")
    
    "Teacher:" "%(first_name)s %(last_name)s?"
For a very simple character selection system, you can use menus and variables.

Code: Select all

label char_select:

    $ char_class = "default girl"
    
    menu:
        "Which character would you like to play?"
        "The cute girl":
            $ char_class = "cute girl"
            "You are the %(char_class)s!"  # You are the cute girl!
            # set up stats and variables specific to being a cute girl here.
            jump cute_girl_intro

        "The smart girl":
            $ char_class = "smart girl"
            "You are the %(char_class)s!"
            # set up stats and variables specific to being a smart girl here.
            jump smart_girl_intro

        "The athletic girl":
            $ char_class = "athletic girl"
            "You are the %(char_class)s!"
            # set up stats and variables specific to being an athletic girl here.
            jump athletic_girl_intro
Or you could get a little more fancy and put in a character confirmation system.

Code: Select all

label char_select:

    $ char_class = "default girl"
    
    menu:
        "Which character would you like to play?"
        "The cute girl":
            $ char_class = "cute girl"
            jump confirm_select

        "The smart girl":
            $ char_class = "smart girl"
            jump confirm_select

        "The athletic girl":
            $ char_class = "athletic girl"
            jump confirm_select
            
label confirm_select:
    
    menu:
        "You have selected to play the %(char_class)s.  Is this okay?"
        "Yes.":
            jump intro_sort

        "No.":
            jump char_select

label intro_sort:
    
    if char_class == "cute girl":
        jump cute_girl_intro   # or set up any stats if necessary

    if char_class == "smart girl":
        jump smart_girl_intro   # or set up any stats if necessary

    if char_class == "athletic girl":
        jump athletic_girl_intro   # or set up any stats if necessary

And you're right, it's a lot like BASIC in a way! Lots of different ways to achieve any one goal, so you just have to find what works for you. :)
My 2007 NaNo entry: Eidolon

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#10 Post by MoonKarla »

Now I got a problem. I can't undestand what's wrong. I made a quick sketch of what the game would be like...
label start:

scene bg classroom
with fade

t "So..which student will take the test first?"
jump char_select

label char_select:

$ char_class = "student"

menu:
"Which character would you like to play?"
"Girl 1":
$ char_class = "student"
# set up stats and variables specific to being a cute girl here.
jump student_intro

"Girl 2":
$ char_class = "student"
# set up stats and variables specific to being a smart girl here.
jump student_intro

"Boy 1":
$ char_class = "student"
# set up stats and variables specific to being an athletic girl here.
jump student_intro

"Boy 2":
$ char_class = "student"
# set up stats and variables specific to being an athletic girl here.
jump student_intro


label student_intro:

show bg classroom
with pixellate

t "Tell me your name please"

$ first_name = renpy.input("What is your first name?")
$ last_name = renpy.input("What is your last name?")

t "%(first_name)s %(last_name)s?"

%(first_name) "Yes!"
jump game

label game:

#To set up a grade count, first you must set up a variable, which will be Mark.
$ %(first_name) = 0

#When you answer a question, you can deduct/add point depending on the answer. Like this...
menu question_1:
"Who theorized that gravity caused the apple to fall on his head?"
"Newton":
$ %(first_name) += 1
"Graham":
pass

menu question_2:
"Who thought up 'E=mc2'?"
"Einstein":
$ %(first_name) += 1
"Curien":
pass

menu question_3:
"Can anyone hear you yell in space?"
"Yes."
pass
"No."
$ %(first_name) +=1
jump grade

label grade:
#You can then set up a grade by checking on the value in Mark, which can be 0,1,2 or 3.

elif %(first_name) = 10:
t "Excellent! keep that good work!!"
%(first_name) "YAY!!!!"

if %(first_name) => 5:
t "You did good but you can do better next time"
%(first_name) "*grins*"

elif %(first_name) =< 4:
t "Sorry to tell you %(first_name), but you failed"
%(first_name) "I made a monkey looks smarter..."

elif %(first_name) = 0:
t "Sorry to tell you %(first_name), but you failed"
%(first_name) "I made a monkey looks smarter..."
Can someone tell me what's wrong? *confused*
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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
Contact:

#11 Post by PyTom »

In the future, please give the error message Ren'Py gives you. It really helps in giving support.

I think you're a little confused with the substitution syntax. You can't use a substitution to create a variable. You'd have to write

$ grade = 0

rather than anything using %.

Also, in strings, you want to write %(foo)s or %(foo)d for strings and numbers, respectively, rather than writing %(foo).
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

#12 Post by Jake »

And incidentally, if you post code snippets - particularly long ones like that - it really helps if you enclose them in 'code' tags rather than 'quote's. Or use the 'Code' button at the top of the editor.

The Code tags preserve whitespace, you see, meaning that it's all indented properly when we see it in your post, which is quite important for Ren'Py/Python script.
Server error: user 'Jake' not found

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#13 Post by MoonKarla »

Thanks ^^ Sorry for beign such a pain in the ass TwT
Image

MoonKarla
Regular
Posts: 30
Joined: Sat Oct 07, 2006 12:43 pm
Location: Panama
Contact:

#14 Post by MoonKarla »

Hi! how do I make a game to have a finishing? I got the programming finished but how I code that it's the end.

And..how do I put images of the characters when the player will choose the character?
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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
Contact:

#15 Post by PyTom »

If you run the "return" statement outside of a call, then it will return you to the main menu, which is a reasonable way of ending the game.

You probably want to use a renpy.imagemap to let the user pick a character... see the reference manual and the UI portion of the demo to see how that works.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users