Ren'Py Tutorial: Part 1
This tutorial is for the visual novel Ren’Py engine. The reason I’m putting this online is because there are many n00bs still out there trying to figure out what a flag does and how to indent script. I’m right now quoting straight from my head because the modem was just nabbed. Hey, guys, I’m doing everyone a service here! There will be lesser n00bs and more time for Memebase!
I’m going to put it this way: I’ll show you the ropes, but don’t go hanging anyone with them. Or using them as a leash (hem hem hem). Such is the relationship (!) of Ren’Py and H-games. I‘m trusting you’re not going to rip off some CGs from an existent source (or spending 6 hours of sitting in front of Manga Studio 4 with your home-brewed porn) then slab them into a compilation of creepy stuff.
I’m going to be straight and frank with this. I haven’t had my lunch, my mom has been commenting on my hair samples and the mental illness websites all say the same stuff (along the lines of “Too late, mate, yer PWNED!!!1!). Anyway, enough with the hobo slackishness and here goes. Mind you, I actually planned this out as a walk-through complete with pictures, though there are bugs with uploading the pictures from my computer at the moment. Trust your soul with Percy. If you see any references to images that do not exist, they probably don’t exist. I’m not bothered, I mean, I’ve no time to edit the lines out; I’m being watched and followed.
I’m going to put it this way: I’ll show you the ropes, but don’t go hanging anyone with them. Or using them as a leash (hem hem hem). Such is the relationship (!) of Ren’Py and H-games. I‘m trusting you’re not going to rip off some CGs from an existent source (or spending 6 hours of sitting in front of Manga Studio 4 with your home-brewed porn) then slab them into a compilation of creepy stuff.
I’m going to be straight and frank with this. I haven’t had my lunch, my mom has been commenting on my hair samples and the mental illness websites all say the same stuff (along the lines of “Too late, mate, yer PWNED!!!1!). Anyway, enough with the hobo slackishness and here goes. Mind you, I actually planned this out as a walk-through complete with pictures, though there are bugs with uploading the pictures from my computer at the moment. Trust your soul with Percy. If you see any references to images that do not exist, they probably don’t exist. I’m not bothered, I mean, I’ve no time to edit the lines out; I’m being watched and followed.
Ok, fine! I was slacking off and didn’t crop the image. This is what you first get when you first execute Ren’Py, minus the Microsoft Word which I am using to type this out (I’d like to see the n00bishness of Microsoft programmers when they forgot to add Microsoft into the dictionary. Such is the shame of the American. But they made Blizzard, didn’t they, now?) I’d recommend you play the tutorial game before you do anything else. Everyone here knows how to play an h-, er, I mean, visual novel, right? Who am I kidding, Lancelot, you practically breathe the stuff. G2G, lunch break. I’m having cows on fire, because everyone needs to know what constitutes the flesh, blood and bones (mostly bones) that is H*****-SAMA!!!
Uh, yeah. I’ll be back…(German accent)
Creating a New Game
Ok, I’m back. Right. I’m assuming you’ve already downloaded and installed Ren’Py. After you’ve played the tutorial game, you would probably be acquainted with the Graphic User Interface (GUI, pronounced ‘gooey’. Hehehe). Let’s start by making a new game.
Right. Basically, click on the ‘New Project’ button on the opening screen. Follow the prompts such as typing in the name of the project, like so.
Uh, yeah. I’ll be back…(German accent)
Creating a New Game
Ok, I’m back. Right. I’m assuming you’ve already downloaded and installed Ren’Py. After you’ve played the tutorial game, you would probably be acquainted with the Graphic User Interface (GUI, pronounced ‘gooey’. Hehehe). Let’s start by making a new game.
Right. Basically, click on the ‘New Project’ button on the opening screen. Follow the prompts such as typing in the name of the project, like so.
A title which doesn't exist
Mmm, marshmallows. Note how the cursor doesn’t blink, is not controllable by the keyboard arrows, only has a ‘Cancel’ button, and is generally not user-friendly. That’s kinda typical. It’s good enough the interface dosen’t need to be controlled with keyboard. It’s got mouse coordinates. You gotta press Enter. You through? Good, ‘cause lock the doors and close the blinds, we’re going for a ride!
Grab my…CAR SEAT!!!
Grab my…CAR SEAT!!!
Continuation...
Now you can choose the interface of your game. Basically the opening screen. I’m going to choose Marker design with Cotton Candy colour scheme because I am still on a rainbow high. After you’ve chosen the colour scheme, you’ll be redirected to the main screen. Don’t worry. Your changes have been made. Just press ‘Launch’. You can always change this from the main menu later. Don’t be afraid, it’s a natural thing!
If you chose the UI that I did, you’ll wind up with this. This is the opening screen of the game. What I don’t understand is the font is always the same no matter what graphics you choose. You can change the font, though I forgot how. It’s supposed to be pretty easy, though you’re going to have to do the kerning ALL OVER AGAIN. Later on, it is possible to change the blank background to an image. But that’s much later and I forgot the script to it as well, anyhow. Do I have to repeat how I don’t have readily-available Internet? No, I don’t think so.
Now, on to the programming. Press the ‘Quit’ Button. You should end up with only the main menu still open or a ragequit.
If you chose the UI that I did, you’ll wind up with this. This is the opening screen of the game. What I don’t understand is the font is always the same no matter what graphics you choose. You can change the font, though I forgot how. It’s supposed to be pretty easy, though you’re going to have to do the kerning ALL OVER AGAIN. Later on, it is possible to change the blank background to an image. But that’s much later and I forgot the script to it as well, anyhow. Do I have to repeat how I don’t have readily-available Internet? No, I don’t think so.
Now, on to the programming. Press the ‘Quit’ Button. You should end up with only the main menu still open or a ragequit.
Back to square 1.
Click on ‘Edit Script’. This dodgy JEdit screen will pop up.
There is already some text when you open up the window of JEdit, not just some abyss of white blankness that signifies the COM’s passing. The white blankness is what you get when you open up a raw, Ren’Py-unaffiliated JEdit session. It’s possible to start from the white blankness, but I mean, who bothers? Not me.
This default, pre-written text is actually meant to give you ‘instructions’ on how to make a visual novel, but seeing as to why you’re reading this, I don’t really think it helped, now, did it? That’s why I’m here.
You’ll wind up with pretty colourful text as you can see, unless you are one of the 15% of males and 1% of females who are colour blind.If you are a hemaphrodite, does that mean 15/100 + 1/100? Wait, let me work this out. I forgot my probability. Ok, so it’s a 4/25 chance of a hemaphrodite being colour blind. Maybe that’s why they can’t choose between…oh, never mind.
Now, I will explain what each colour is, and how to get it.
Some disturbing reddish colour: This is a comment. Comments are there for the programmer to make comments. Munya.
Ok, fine. They are for stuff like making reminders, notes, dirty language that you don’t want the players to know about. You get the picture. You can access them by doing a hash key (#). Some programming languages require you to do double back slashes and others, another set of double hash keys at the end of your comment to deactivate the comment function. Comments are COMPLETELY IGNORED by the program. In fact, if you ran a program littered with as many comments as there were the total bodies burnt in Auschwitz, Treblinka and Mauthausen combined, you cannot tell if someone’s written comments or not. They just don’t show up. (Good for the bodies not showing up too).
JEdit runs on Python programming language (hence the name Ren’PY). It’s a language specialising in readability of text. Typical lines of script in lower languages like C+ and C++ look like Einstein was drunk. (Lower language=more primitive data input=more customisation. You can customise EVERYTHING. I’ll get to why we aren’t using C languages later).
This is something you have to remember: in programming, it’s every line for itself. Just because you put for example, comment function on one line, doesn’t mean if you press enter, the formatting will still be the same for the next line. Try it for yourself. Make a comment with some insane text. Choose the line just before the ‘e “ You’ve created a new Ren’Py game”’. Why? Because that’s a line without anything on it. It’s fresh. Unused. Virgin. *cough*cough*splutter*. Okay, anyway, put a hash key on the line. Notice how when you click on the line, there are already spacings at the front of the line. Yes, it’s possible to delete them. No, don’t do that.
That’s called indentation. In aforementioned C++, it doesn’t matter how many spacings you put at the beginning of a line of script What governs what command is assigned to which mass of epileptic-seizure inducing text are a lot of symbols like {{()_+*%. Renpy uses how many spaces are in front of a line. It works in groups of 4 spaces.
If a group of lines have an indentation of 4 spaces, they belong to one block. If another group of lines has indentation of 8, they are another block. Remember how we work in fours. That’s your new evil number. Now go find a group of 4 evil dictators. Tell you what, that’s your homework. I’ve got a list of 4 mentally illnessed people to start you off: Wagner, Schumann, H*****-sama, van Gogh. Are you having fun? I sure am. (Science Focus Q24, pg 89).
Back to testing our theory. Type something on your comment line.
Now, thou shalt press ‘ENTER’. Try typing something.
See how the text is black? Save the progress under the same name. Go to the main menu, the one with the ‘Launch’ button. Launch the game. This ‘Parsing the script failed.’ window should show up.
‘Parsing’ is the programming version of Grammar Nazi enforcement. It screens your entire script for errors. That basically means they want a command. Blank black text doesn’t mean anything. Gaah, I want a coffee but I already had one this morning.
What do you want to do to the text? Make it into a comment? A piece of dialogue? A menu item?
Wait, before I move on to dialogue, menus and other creepy stuff, I’ll explain why we aren’t using C++, the more customisable programming language.
Python is practically based on C++, only made simpler. MUCH simpler . Even if reality almost beats you up and knocks you down, I know you will look straight and walk forward, Dream Fighter! If we were to use C++, it’s not as if it’s not specific to Ren’Py. As in, we would have to create the interface, the opening menu, the dialogue boxes all over again. That’s what the developers at Ren’py have already done for us. No need to reinvent the guillotine; we’ve got chainsaws. Now, dialogue.
DIIIIIIIIAAAAAAAAAALOGUEE
Click on ‘Edit Script’. This dodgy JEdit screen will pop up.
There is already some text when you open up the window of JEdit, not just some abyss of white blankness that signifies the COM’s passing. The white blankness is what you get when you open up a raw, Ren’Py-unaffiliated JEdit session. It’s possible to start from the white blankness, but I mean, who bothers? Not me.
This default, pre-written text is actually meant to give you ‘instructions’ on how to make a visual novel, but seeing as to why you’re reading this, I don’t really think it helped, now, did it? That’s why I’m here.
You’ll wind up with pretty colourful text as you can see, unless you are one of the 15% of males and 1% of females who are colour blind.If you are a hemaphrodite, does that mean 15/100 + 1/100? Wait, let me work this out. I forgot my probability. Ok, so it’s a 4/25 chance of a hemaphrodite being colour blind. Maybe that’s why they can’t choose between…oh, never mind.
Now, I will explain what each colour is, and how to get it.
Some disturbing reddish colour: This is a comment. Comments are there for the programmer to make comments. Munya.
Ok, fine. They are for stuff like making reminders, notes, dirty language that you don’t want the players to know about. You get the picture. You can access them by doing a hash key (#). Some programming languages require you to do double back slashes and others, another set of double hash keys at the end of your comment to deactivate the comment function. Comments are COMPLETELY IGNORED by the program. In fact, if you ran a program littered with as many comments as there were the total bodies burnt in Auschwitz, Treblinka and Mauthausen combined, you cannot tell if someone’s written comments or not. They just don’t show up. (Good for the bodies not showing up too).
JEdit runs on Python programming language (hence the name Ren’PY). It’s a language specialising in readability of text. Typical lines of script in lower languages like C+ and C++ look like Einstein was drunk. (Lower language=more primitive data input=more customisation. You can customise EVERYTHING. I’ll get to why we aren’t using C languages later).
This is something you have to remember: in programming, it’s every line for itself. Just because you put for example, comment function on one line, doesn’t mean if you press enter, the formatting will still be the same for the next line. Try it for yourself. Make a comment with some insane text. Choose the line just before the ‘e “ You’ve created a new Ren’Py game”’. Why? Because that’s a line without anything on it. It’s fresh. Unused. Virgin. *cough*cough*splutter*. Okay, anyway, put a hash key on the line. Notice how when you click on the line, there are already spacings at the front of the line. Yes, it’s possible to delete them. No, don’t do that.
That’s called indentation. In aforementioned C++, it doesn’t matter how many spacings you put at the beginning of a line of script What governs what command is assigned to which mass of epileptic-seizure inducing text are a lot of symbols like {{()_+*%. Renpy uses how many spaces are in front of a line. It works in groups of 4 spaces.
If a group of lines have an indentation of 4 spaces, they belong to one block. If another group of lines has indentation of 8, they are another block. Remember how we work in fours. That’s your new evil number. Now go find a group of 4 evil dictators. Tell you what, that’s your homework. I’ve got a list of 4 mentally illnessed people to start you off: Wagner, Schumann, H*****-sama, van Gogh. Are you having fun? I sure am. (Science Focus Q24, pg 89).
Back to testing our theory. Type something on your comment line.
Now, thou shalt press ‘ENTER’. Try typing something.
See how the text is black? Save the progress under the same name. Go to the main menu, the one with the ‘Launch’ button. Launch the game. This ‘Parsing the script failed.’ window should show up.
‘Parsing’ is the programming version of Grammar Nazi enforcement. It screens your entire script for errors. That basically means they want a command. Blank black text doesn’t mean anything. Gaah, I want a coffee but I already had one this morning.
What do you want to do to the text? Make it into a comment? A piece of dialogue? A menu item?
Wait, before I move on to dialogue, menus and other creepy stuff, I’ll explain why we aren’t using C++, the more customisable programming language.
Python is practically based on C++, only made simpler. MUCH simpler . Even if reality almost beats you up and knocks you down, I know you will look straight and walk forward, Dream Fighter! If we were to use C++, it’s not as if it’s not specific to Ren’Py. As in, we would have to create the interface, the opening menu, the dialogue boxes all over again. That’s what the developers at Ren’py have already done for us. No need to reinvent the guillotine; we’ve got chainsaws. Now, dialogue.
DIIIIIIIIAAAAAAAAAALOGUEE
Go back to that line of black, commandless text. Dialogue is text in quotation marks. Simple. So simple, the great Leeeeeeeeeerooooooooooooy Jeeeeeeeenkiiiiiiiiiins himself can do this. I hope. Put a set of quotation marks at the end and beginning of the text, like so.
It turned green! Now save your progress and launch the game.
Now they’re complaining that they’ve got no indention. Remember our indention? They work in gropes, er, I mean, groups of 4. Which evil dictators did you get? The fact that that line has no indention means that it belongs to the block that says ‘label start’. This block doesn’t need another command, it’s a schizoid social outcast. No offence, brain.
Make it a part of the block ‘e “ You’ve created a new Ren’Py game”’. Do this by imitating the same amount of spaces at the beginning of the block you want to join it to. I’d like to actually show you what I mean by blocks, but this internet needs a kick in the ____.
Look at the very side. There are numbers. These numbers denote your lines. The game is launched by the command ‘label: start’. Label is in light orange, as it is a command. So is return, which ends the game and brings you to the front menu.
Put 4 spacings in front of your green dialogue. Note how, when you’re making spaces between the actual valid indentations of multiples of 4, there’s that grey vertical line faint line.
That line comes when you have a line which is not indented on a multiple of 4, or to show how many blocks you have (if you indented correctly). Therefore, it acts an a measurement device for indentation. To finish off making you string into dialogue, I’m going to add 2 more spaces in front of the string to make it 4.
Notice how the grey line has disappeared.The first and second blocks do not have any grey lines tied to them. The third one will. Oh, yeah, save the progress and launch. Check it out, baby!
IT’S OVER 9000!!1!!!
(What is actually supposed to happen: when you run the game, you will see what you typed down as your narration. If you didn’t, there is a parsing error in either your indentation, quotation marks or the fact that you put your line before ‘label: start.’ I need to take a break, I’m fuming at how someone’s been interrupting my work.)
Not to be anticlimatic or anything, but we’ve only just covered dialogue.
Darn, there are so many spelling errors which I HAVE TO include for the sake of colloquialism to the point that my spell-check deactivated itself. How is that possible? Every single time I update, it takes 5 seconds to load and all the spelling and grammatical errors are piling up. One step at a time, babe.
What else have we covered, eh?
· Creating a new game
· Customising the interface
· Some cracksaccharine about the insanity that is C++
· Why 4 is death and that GAP is actually a good thing (type ‘GAP hetalia’ and see what I mean)
· 4 evil dictators
· The building blocks of programming life
· The probability of colour blindness in a hermaphrodite
Am I missing something?
Nah, I don’t think so.
That will be all for our first lesson, me dear children. Sweet dreams…you’ll have them, alright!
By the way, I've got no more books to read on Josef Mengele.
It turned green! Now save your progress and launch the game.
Now they’re complaining that they’ve got no indention. Remember our indention? They work in gropes, er, I mean, groups of 4. Which evil dictators did you get? The fact that that line has no indention means that it belongs to the block that says ‘label start’. This block doesn’t need another command, it’s a schizoid social outcast. No offence, brain.
Make it a part of the block ‘e “ You’ve created a new Ren’Py game”’. Do this by imitating the same amount of spaces at the beginning of the block you want to join it to. I’d like to actually show you what I mean by blocks, but this internet needs a kick in the ____.
Look at the very side. There are numbers. These numbers denote your lines. The game is launched by the command ‘label: start’. Label is in light orange, as it is a command. So is return, which ends the game and brings you to the front menu.
Put 4 spacings in front of your green dialogue. Note how, when you’re making spaces between the actual valid indentations of multiples of 4, there’s that grey vertical line faint line.
That line comes when you have a line which is not indented on a multiple of 4, or to show how many blocks you have (if you indented correctly). Therefore, it acts an a measurement device for indentation. To finish off making you string into dialogue, I’m going to add 2 more spaces in front of the string to make it 4.
Notice how the grey line has disappeared.The first and second blocks do not have any grey lines tied to them. The third one will. Oh, yeah, save the progress and launch. Check it out, baby!
IT’S OVER 9000!!1!!!
(What is actually supposed to happen: when you run the game, you will see what you typed down as your narration. If you didn’t, there is a parsing error in either your indentation, quotation marks or the fact that you put your line before ‘label: start.’ I need to take a break, I’m fuming at how someone’s been interrupting my work.)
Not to be anticlimatic or anything, but we’ve only just covered dialogue.
Darn, there are so many spelling errors which I HAVE TO include for the sake of colloquialism to the point that my spell-check deactivated itself. How is that possible? Every single time I update, it takes 5 seconds to load and all the spelling and grammatical errors are piling up. One step at a time, babe.
What else have we covered, eh?
· Creating a new game
· Customising the interface
· Some cracksaccharine about the insanity that is C++
· Why 4 is death and that GAP is actually a good thing (type ‘GAP hetalia’ and see what I mean)
· 4 evil dictators
· The building blocks of programming life
· The probability of colour blindness in a hermaphrodite
- And indentation.
Am I missing something?
Nah, I don’t think so.
That will be all for our first lesson, me dear children. Sweet dreams…you’ll have them, alright!
By the way, I've got no more books to read on Josef Mengele.
FEEDBACK from the sane knight
Wow. This is just-wow. You're more dedicated for this than I am Percival!
-Words of skepticism from your pal, Lancey!
-Words of skepticism from your pal, Lancey!