Question on new RenPY
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Question on new RenPY
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?
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](http://img.photobucket.com/albums/v231/Niann/K-rla2.gif)
- Mirielle
- Regular
- Posts: 130
- Joined: Thu Nov 02, 2006 5:05 am
- Deviantart: miirne
- Soundcloud: mirne-1
- Contact:
Haha! I may not be the best at programming, but this I can actually help you with!
And in regards to your second question I think it would go something like this...
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.
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.where I put ALL of the files I need in for the game?
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."
Available for voice acting - Please listen to my demo reel!
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:
And I declared it like this:
the bedroom and the school ones are mine, the other two were in the game already and I leave them to guide myself## 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"
![Image](http://img.photobucket.com/albums/v231/Niann/K-rla2.gif)
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.MoonKarla wrote:And I declared it like this:
Code: Select all
# image bg mbedroom = "musa-room.jpeg"
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
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.
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](http://img.photobucket.com/albums/v231/Niann/K-rla2.gif)
-
- Miko-Class Veteran
- Posts: 546
- Joined: Wed Sep 21, 2005 10:49 pm
- Projects: Winter Shard, EVE, Hyperion
- Contact:
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.
This is how I've been doing player input (but there might be a better way to do it now!).
For a very simple character selection system, you can use menus and variables.
Or you could get a little more fancy and put in a character confirmation system.
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. ![Smile :)](./images/smilies/icon_smile.gif)
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?"
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
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
![Smile :)](./images/smilies/icon_smile.gif)
My 2007 NaNo entry: Eidolon
Now I got a problem. I can't undestand what's wrong. I made a quick sketch of what the game would be like...
Can someone tell me what's wrong? *confused*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..."
![Image](http://img.photobucket.com/albums/v231/Niann/K-rla2.gif)
- PyTom
- Ren'Py Creator
- Posts: 16096
- 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:
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).
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(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
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.
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
- PyTom
- Ren'Py Creator
- Posts: 16096
- 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:
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.
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(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: No registered users