Having Two Main Characters and thus dif. perspectives? How?
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.
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.
Having Two Main Characters and thus dif. perspectives? How?
I was looking around using the search option for different keywords, and manually browsing some forums, however anything that even sounded close to my question wasn't exactly what I was trying to figure out, so I decided I might as well post up my own.
I'm working together with a friend on a VN, and while we're both going to be working with the code I plan to try and do most of it myself. Our 'hook,' you might say, is the fact we plan to have two main characters in our game — and thus, two different paths in the game. The two characters are together most of the story and the story itself isn't changing between the two routes, however, there are parts of the story one will experience and some the other will instead. This allows for two unique perspectives to really tell the whole story.
So the process would require there to be a character choice when you start a new game, and then you play as that character. We're even hoping to have a 'true ending' that you can only unlock by playing through both stories.
My question to you, however, is just how to go about doing this. We're both totally new to ren'py, and seeing as I'm just starting to practice with the code it's really messing with my brain. So, I wanted to get an idea of what I have to do to have the character selection screen, how to code in their paths [since I assume to do two stories, we have to code out two totally separate codes within the script and have one character choice go right into the first one and the other choice skip over the first story in the code, to reach theirs], and anything else that you may think is useful.
Since we are new, we're not planning to have too many choices in the game, minus which path to take, so we're hoping once we get that part down coding the rest won't be too difficult.
OH, Also, I was going to ask if there was a simple way to have the game remember that you beat it as one character, and when you beat it with the other you get the 'true ending' after their normal one. That sounds simple enough, I think.
Any help is much appreciated!
I'm working together with a friend on a VN, and while we're both going to be working with the code I plan to try and do most of it myself. Our 'hook,' you might say, is the fact we plan to have two main characters in our game — and thus, two different paths in the game. The two characters are together most of the story and the story itself isn't changing between the two routes, however, there are parts of the story one will experience and some the other will instead. This allows for two unique perspectives to really tell the whole story.
So the process would require there to be a character choice when you start a new game, and then you play as that character. We're even hoping to have a 'true ending' that you can only unlock by playing through both stories.
My question to you, however, is just how to go about doing this. We're both totally new to ren'py, and seeing as I'm just starting to practice with the code it's really messing with my brain. So, I wanted to get an idea of what I have to do to have the character selection screen, how to code in their paths [since I assume to do two stories, we have to code out two totally separate codes within the script and have one character choice go right into the first one and the other choice skip over the first story in the code, to reach theirs], and anything else that you may think is useful.
Since we are new, we're not planning to have too many choices in the game, minus which path to take, so we're hoping once we get that part down coding the rest won't be too difficult.
OH, Also, I was going to ask if there was a simple way to have the game remember that you beat it as one character, and when you beat it with the other you get the 'true ending' after their normal one. That sounds simple enough, I think.
Any help is much appreciated!
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: Having Two Main Characters and thus dif. perspectives? H
If you're new to Ren'Py, you really need to play through the tutorial game and read through the documentation (at least the stuff under Quickstart) first. A lot of what I'm going to say is going to be gobbledegook if you don't understand the basics. That said...
The first thing you need to do is start off with the character select. You can do this in multiple ways, but the two probably most common/easiest:
1. A menu. This is the easiest. If you go into the script.rpy file, you see "label start:" this is where the game starts. If you want the character select to be the first thing in your game, that's where you're going to put it. So your label would look something like this:
This will make a menu with two choices, as you can probably see. A note: you can make as many .rpy script files as you want to contain all the labels in the scripts. In general, it'd probably be easiest to put each character's script into two different files so it doesn't get too confusing. Ren'Py will search all of your .rpy files to find the label you're referring to in your jump, so even if you have multiple files, the labels are all shared. (so you can't have two with the same name)
Of course, if most of the story is the same and only part of it changes, you might have only one script file and go for a variable sort of thing:
Then, as you go through the game script, whenever there are differences depending on which character has been chosen, you can do something like:
For the game to remember that you beat it as one character, you'd use persistent variables. I'd probably make two variables, one for character A, one for character B. The variables are originally false, and once the game is beaten, it changes to true. When both variables are true, it unlocks a true ending. Something like that.
If you want something a little more sophisticated than a menu/choice screen, you have:
2. Image maps. You can customize this to make it look nicer and more like a "professional" character select screen, something like this. /shameless plug
And I think that covers everything! Hopefully this helps.
The first thing you need to do is start off with the character select. You can do this in multiple ways, but the two probably most common/easiest:
1. A menu. This is the easiest. If you go into the script.rpy file, you see "label start:" this is where the game starts. If you want the character select to be the first thing in your game, that's where you're going to put it. So your label would look something like this:
Code: Select all
label start:
menu:
"Please choose a character."
"Character A":
jump character_a_start
"Character B":
jump character_b_startOf course, if most of the story is the same and only part of it changes, you might have only one script file and go for a variable sort of thing:
Code: Select all
label start:
menu:
"Please choose a character."
"Character A":
$ character = "A"
"Character B":
$ character = "B"Code: Select all
if character == "A":
"Something happens here."
else:
"Something happens here to character B."If you want something a little more sophisticated than a menu/choice screen, you have:
2. Image maps. You can customize this to make it look nicer and more like a "professional" character select screen, something like this. /shameless plug
And I think that covers everything! Hopefully this helps.
Re: Having Two Main Characters and thus dif. perspectives? H
This. You are officially my hero, I must say.
I have gone through the tutorial and all to get the basics, my only issue is my over eagerness to jump into everything rather than taking it step by step, so I'm trying to digest a lot of things a bit too quickly.
BUT, Aside from that, this should really help. I was reading up on image maps before, but I wasn't quite sure how to associate that with you making a choice for your character. Since I'm crazy about making things like an interface or logo looking professionally done, I did want to create something very much like your own example when it comes to the character choices.
Would I include something like an imagemap with the menu code you gave an example of, or would there be a more sophisticated way of coding that up?
Also, for making multiple script files, I would need to make each script include all the same stuff -- like definitions for images, and of course characters -- and just have a different label, right? Since whichever label I jump to from script A to script B and vice versa will use the information for things like that in the respective script file.
I have gone through the tutorial and all to get the basics, my only issue is my over eagerness to jump into everything rather than taking it step by step, so I'm trying to digest a lot of things a bit too quickly.
BUT, Aside from that, this should really help. I was reading up on image maps before, but I wasn't quite sure how to associate that with you making a choice for your character. Since I'm crazy about making things like an interface or logo looking professionally done, I did want to create something very much like your own example when it comes to the character choices.
Would I include something like an imagemap with the menu code you gave an example of, or would there be a more sophisticated way of coding that up?
Also, for making multiple script files, I would need to make each script include all the same stuff -- like definitions for images, and of course characters -- and just have a different label, right? Since whichever label I jump to from script A to script B and vice versa will use the information for things like that in the respective script file.
- Camille
- Eileen-Class Veteran
- Posts: 1227
- Joined: Sat Apr 23, 2011 2:43 pm
- Completed: Please see http://trash.moe
- Projects: the head well lost
- Organization: L3
- Tumblr: narihira
- Deviantart: crownwaltz
- itch: lore
- Contact:
Re: Having Two Main Characters and thus dif. perspectives? H
I know how you feel because I was the same way when I started Ren'Py. I just wanted to get to all the cool stuff. XD But there are so many good resources for Ren'Py already that between the forums, wiki, and documentation, you have almost everything you need to make your game. Just slow down and make sure you learn everything, otherwise it'll be harder for you later. Things can get confusing if you don't have the basics down. Honestly, the fastest way to figure Ren'Py out is just to try everything. Put coding into your game, change some things, and run it! Learn what works and what doesn't, what causes what, etc. But I understand that it can all be a little overwhelming at first, so I'm glad I was able to help.
This is what my own character select imagemap looks like, code-wise:
The page I linked to in my last post has more of a general overview of how to use imagemaps, but I've tried to explain everything in my code behind the #s, so.
Re: multiple script files: That's the beauty of Ren'Py. You only have to declare all that stuff once. When you call something, Ren'Py will go through all your scripts until it finds its definition. So once you've defined something--a label, character, variable, screen, whatever--it's there and can be used anywhere in that game. I myself made a define.rpy file where I put all those character/variable/music/etc definitions, and then I have a separate .rpy file for every chapter of my game. Even though Ren'Py games are made, by default, with a screens.rpy, options.rpy, etc., files, you could take code out of any of those and move them to any other .rpy file and they would still work perfectly fine. This makes it so you can be organized as much you want--with a lot of different .rpy files--or as little as you want. You could code a whole game and put all of the coding in just one .rpy file if you really wanted to.
This is what my own character select imagemap looks like, code-wise:
Code: Select all
screen character_select:
zorder 50 #this makes sure the imagemap is on top of everything else
imagemap:
ground "ui/characters.jpg" #what the imagemap looks like normally
hover "ui/characters-hover.jpg" #what it looks like when everything's hovered over
hotspot (173, 99, 333, 446) clicked Return("shuuki")
hotspot (519, 100, 330, 445) clicked Return("natsume")
label start:
show image "ui/characters.jpg"
with dissolve #these two lines are because I'm a perfectionist and want the screen to fade in, which it can't do normally when you use call
# and you have to use call NOT SHOW for an imagemap screen, otherwise the game will just take you back to the main menu afterward/skip over the screen, basically
call screen character_select
$ result = _return #makes that return into a variable so you can use it
if result == "natsume":
jump natsume_start
elif result == "shuuki":
jump shuuki_startRe: multiple script files: That's the beauty of Ren'Py. You only have to declare all that stuff once. When you call something, Ren'Py will go through all your scripts until it finds its definition. So once you've defined something--a label, character, variable, screen, whatever--it's there and can be used anywhere in that game. I myself made a define.rpy file where I put all those character/variable/music/etc definitions, and then I have a separate .rpy file for every chapter of my game. Even though Ren'Py games are made, by default, with a screens.rpy, options.rpy, etc., files, you could take code out of any of those and move them to any other .rpy file and they would still work perfectly fine. This makes it so you can be organized as much you want--with a lot of different .rpy files--or as little as you want. You could code a whole game and put all of the coding in just one .rpy file if you really wanted to.
Re: Having Two Main Characters and thus dif. perspectives? H
Wow, that really helps. Shows me pretty much everything -- and between that and your previous post, it nearly covers all the complicated portions of what we're expecting to deal with in our first VN. I really can't thank you enough for the assistance!
and yeah, when it comes to trying to jump in, I'm quick to get myself overwhelmed. Its not even so much that I want to do all the complicated stuff, but that feeling of "I have to read this and learn this" and then getting myself overwhelmed just drags me down. What I'm doing now though is working on just a random script, and trying my best to get use to the basic-basic coding and how to work basic scenes, learn how to properly set everything up, etc.
This is a huge help though, so thank you once again. I'll have to be sure we update on how things are going once we get into the actual development!
and yeah, when it comes to trying to jump in, I'm quick to get myself overwhelmed. Its not even so much that I want to do all the complicated stuff, but that feeling of "I have to read this and learn this" and then getting myself overwhelmed just drags me down. What I'm doing now though is working on just a random script, and trying my best to get use to the basic-basic coding and how to work basic scenes, learn how to properly set everything up, etc.
This is a huge help though, so thank you once again. I'll have to be sure we update on how things are going once we get into the actual development!
Who is online
Users browsing this forum: Google [Bot]