/usr/share/doc/renpy/html/quickstart.html is in renpy-doc 6.17.6-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Quickstart — Ren'Py Documentation</title>
<link rel="stylesheet" href="_static/screen.css" type="text/css" media="screen, projection"/>
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" media="print" />
<!--[if lt IE 8]>
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" media="screen, projection"/>
<![endif]-->
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '6.18.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Ren'Py Documentation" href="index.html" />
<link rel="next" title="Language Basics" href="language_basics.html" />
<link rel="prev" title="Welcome to Ren'Py's documentation!" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="language_basics.html" title="Language Basics"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to Ren'Py's documentation!"
accesskey="P">previous</a> |</li>
<li> <img src="_static/logo.png" width=19 height=21 align=center>
<li> <a href="http://www.renpy.org/">Ren'Py Home</a> |
<li><a href="index.html">Ren'Py Documentation</a></li>
</ul>
</div>
<div class="container">
<div class="span4">
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Quickstart</a><ul>
<li><a class="reference internal" href="#the-ren-py-launcher">The Ren'Py Launcher</a></li>
<li><a class="reference internal" href="#a-simple-game">A Simple Game</a></li>
<li><a class="reference internal" href="#init">Init</a></li>
<li><a class="reference internal" href="#characters">Characters</a></li>
<li><a class="reference internal" href="#images">Images</a></li>
<li><a class="reference internal" href="#transitions">Transitions</a></li>
<li><a class="reference internal" href="#positions">Positions</a></li>
<li><a class="reference internal" href="#music-and-sound">Music and Sound</a></li>
<li><a class="reference internal" href="#pause-statement">Pause Statement</a></li>
<li><a class="reference internal" href="#ending-the-game">Ending the Game</a></li>
<li><a class="reference internal" href="#menus-labels-and-jumps">Menus, Labels, and Jumps</a></li>
<li><a class="reference internal" href="#python-and-if-statements">Python and If Statements</a></li>
<li><a class="reference internal" href="#releasing-your-game">Releasing Your Game</a></li>
<li><a class="reference internal" href="#script-of-the-question">Script of The Question</a></li>
<li><a class="reference internal" href="#where-do-we-go-from-here">Where do we go from here?</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome to Ren'Py's documentation!</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="language_basics.html"
title="next chapter">Language Basics</a></p>
<h4>Search</h4>
<div id="cse-search-form" style="width: 100%;"></div>
<div class="copydata">
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
<br>
</div>
</div>
</div>
</div>
<div class="document span20 last">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="quickstart">
<h1>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline">¶</a></h1>
<p>Welcome to the Ren'Py quickstart manual. The purpose of this manual is
to demonstrate how you can make a Ren'Py game from scratch, in a few
easy steps. We'll do this by showing how to make a simple game, <em>The
Question</em>, from scratch. This manual contains a number of examples,
which are included as part of the demo game.</p>
<div class="section" id="the-ren-py-launcher">
<h2>The Ren'Py Launcher<a class="headerlink" href="#the-ren-py-launcher" title="Permalink to this headline">¶</a></h2>
<p>Before you begin making a game, you should first take some time to
learn how the Ren'Py launcher works. The launcher lets you create,
manage, edit, and run Ren'Py projects.</p>
<p><strong>Getting Started.</strong> To get started you'll want to
<a class="reference external" href="http://www.renpy.org/wiki/renpy/Download_Ren'Py">download Ren'Py</a>.</p>
<p>Once you've downloaded Ren'Py, you'll want to extract it. This can
generally be done by right-clicking on the package file, and picking
"Extract" if that's an option, or "Open" if it's not. Follow the
prompts, and you'll have a working copy of Ren'Py.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Please be sure you've extracted Ren'Py to its own directory or
folder on disk. If you try to run it from inside a ZIP file, it
won't work properly.</p>
</div>
<p>Once you've extracted Ren'Py, you'll need to run it.</p>
<ul class="simple">
<li>On Windows, run the <tt class="docutils literal"><span class="pre">renpy</span></tt> or <tt class="docutils literal"><span class="pre">renpy.exe</span></tt> program.</li>
<li>On Mac OS X, run the <tt class="docutils literal"><span class="pre">renpy</span></tt> application.</li>
<li>On Linux, run the <tt class="docutils literal"><span class="pre">renpy.sh</span></tt> script.</li>
</ul>
<p>After running this, the Ren'Py launcher should run.</p>
<img alt="_images/launcher.png" class="align-right" src="_images/launcher.png" />
<p><strong>Choosing and Launching a Project.</strong> You should first see what the
completed <em>The Question</em> game looks like. To do this, start the Ren'Py
launcher, and choose "The Question" from the first screen. Choose
"Launch Project" to start <em>The Question</em>.</p>
<p>You can get back to the Ren'Py demo by doing the same thing, but
choosing "Tutorial" instead of "The Question".</p>
<p><strong>Creating a new Project.</strong>
Create a new project by choosing "Create New Project" from the
launcher. The launcher will then ask you for a project name. Since
"The Question" is already taken, you should enter something different,
like "My Question". The launcher will then ask you to choose a color
theme for the project. It doesn't matter what you pick at this point,
just choose something that appeals to you. You'll be returned to the
top menu of the launcher with your new game chosen.</p>
</div>
<div class="section" id="a-simple-game">
<h2>A Simple Game<a class="headerlink" href="#a-simple-game" title="Permalink to this headline">¶</a></h2>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="s">"I'll ask her..."</span>
<span class="s">"Me"</span> <span class="s">"Um... will you..."</span>
<span class="s">"Me"</span> <span class="s">"Will you be my artist for a visual novel?"</span>
<span class="s">"Silence."</span>
<span class="s">"She is shocked, and then..."</span>
<span class="s">"Sylvie"</span> <span class="s">"Sure, but what is a </span><span class="se">\"</span><span class="s">visual novel?</span><span class="se">\"</span><span class="s">"</span>
</pre></div>
</div>
<p>This is perhaps one of the simplest Ren'Py games. It doesn't include
any pictures or anything like that, but it does show a conversation
between the two characters.</p>
<p>To try this out, go into the launcher, select the "My Question
Project", and choose "script.rpy" from under Edit File. Ren'Py may
ask you to select a text editor, after which it will download the
editor you select. When it finishes, script.rpy will open in an
editor. Erase everything in script.rpy, as we're starting from
scratch, so you don't need what's there. Copy the example above into
script.rpy, and save it.</p>
<p>You're now ready to run this example. Go back to the launcher, and
choose "Launch Project". Ren'Py will start up. Notice how, without any
extra work, Ren'Py has given you menus that let you load and save the
game, and change various preferences. When ready, click "Launch Project",
and play through this example game.</p>
<p>This example shows some of the commonly-used Ren'Py statements.</p>
<p>The first line is a label statement. The label statement is used to
give a name to a place in the program. In this case, we create a label
named <tt class="docutils literal"><span class="pre">start</span></tt>. The start label is special, as it's where Ren'Py
scripts begin running when the user clicks "Start Game" on the main
menu.</p>
<p>The other lines are say statements. There are two forms of the say
statement. The first is a string (beginning with a double-quote,
containing characters, and ending with a double-quote) on a line by
itself, which is used for narration, and the thoughts of the main
character. The second form consists of two strings. It's used for
dialogue, with the first string being a character name and the second
being what that character is saying.</p>
<p>Note that all the say statements are indented by four spaces. This is
because they are a block underneath the label statement. In Ren'Py,
blocks must be indented relative to the prior statement, and all of
the statements in a block must be indented by the same amount.</p>
<p>When strings contain double-quote characters, those characters need to
be preceded by a backslash. This is done in the last line of our
example.</p>
<p>While this simple game isn't much to look at, it's an example of how
easy it is to get something working in Ren'Py. We'll add the pictures
in a little bit, but first, let's see how to declare characters.</p>
</div>
<div class="section" id="init">
<h2>Init<a class="headerlink" href="#init" title="Permalink to this headline">¶</a></h2>
<p>The init statement is used to execute blocks of Ren'Py statements before the
script executes. Init blocks are used to define images and characters, to set
up unchanging game data structures, and to customize Ren'Py. Code inside init
blocks should not interact with the user or change any of the layers, and so
should not contain say, menu, scene, show, or hide statements, as well as calls
to any function that can do these things.</p>
<p>An init statement is introduced with the keyword init, followed by an optional
priority number, and a mandatory colon. If the priority is not given, it
defaults to 0. Priority numbers should be in the range -999 to 999. Numbers
outside of this range are reserved for Ren'Py code.</p>
<p>The priority number is used to determine when the code inside the init block
executes. Init blocks are executed in priority order from low to high. Within a
file, init blocks with the same priority are run in order from the top of the
file to the bottom. The order of evaluation of priority blocks with the same
priority between files is undefined.</p>
<p>The init blocks are all run once, during a special init phase. When control
reaches the end of an init block during normal execution, execution of that
block ends. If an init statement is encountered during normal execution, the
init block is not run. Instead, control passes to the next statement.</p>
</div>
<div class="section" id="characters">
<h2>Characters<a class="headerlink" href="#characters" title="Permalink to this headline">¶</a></h2>
<p>One problem with the first example is that it requires you to
repeatedly type the name of a character each time they speak. In a
dialogue-heavy game, this might be a lot of typing. Also, both
character names are displayed in the same way, in fairly boring white
text. To fix this, Ren'Py lets you define characters in advance. This
lets you associate a short name with a character, and to change the
color of the character's name.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">define</span> <span class="n">s</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s">'Sylvie'</span><span class="p">,</span> <span class="na">color</span><span class="o">=</span><span class="s">"#c8ffc8"</span><span class="p">)</span>
<span class="k">define</span> <span class="n">m</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s">'Me'</span><span class="p">,</span> <span class="na">color</span><span class="o">=</span><span class="s">"#c8c8ff"</span><span class="p">)</span>
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="s">"I'll ask her..."</span>
<span class="n">m</span> <span class="s">"Um... will you..."</span>
<span class="n">m</span> <span class="s">"Will you be my artist for a visual novel?"</span>
<span class="s">"Silence."</span>
<span class="s">"She is shocked, and then..."</span>
<span class="n">s</span> <span class="s">"Sure, but what is a </span><span class="se">\"</span><span class="s">visual novel?</span><span class="se">\"</span><span class="s">"</span>
</pre></div>
</div>
<p>The first and and second lines define characters. The first line
defines a character with the short name of "s", the long name
"Sylvie", with a name that is shown in a greenish color. (The colors
are red-green-blue hex triples, as used in web pages.)</p>
<p>The second line creates a character with a short name "m", a long name
"Me", with the name shown in a reddish color. Other characters can be
defined by copying one of the character lines, and changing the short
name, long name, and color.</p>
<p>We've also changed the say statements to use character objects instead
of a character name string. This tells Ren'Py to use the characters we
defined in the init block.</p>
</div>
<div class="section" id="images">
<h2>Images<a class="headerlink" href="#images" title="Permalink to this headline">¶</a></h2>
<p>A visual novel isn't much of a visual novel without pictures. Let's
add some pictures to our game.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">image</span> <span class="n">bg</span> <span class="n">meadow</span> <span class="o">=</span> <span class="s">"meadow.jpg"</span>
<span class="k">image</span> <span class="n">bg</span> <span class="n">uni</span> <span class="o">=</span> <span class="s">"uni.jpg"</span>
<span class="k">image</span> <span class="n">sylvie</span> <span class="n">smile</span> <span class="o">=</span> <span class="s">"sylvie_smile.png"</span>
<span class="k">image</span> <span class="n">sylvie</span> <span class="n">surprised</span> <span class="o">=</span> <span class="s">"sylvie_surprised.png"</span>
<span class="k">define</span> <span class="n">s</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s">'Sylvie'</span><span class="p">,</span> <span class="na">color</span><span class="o">=</span><span class="s">"#c8ffc8"</span><span class="p">)</span>
<span class="k">define</span> <span class="n">m</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s">'Me'</span><span class="p">,</span> <span class="na">color</span><span class="o">=</span><span class="s">"#c8c8ff"</span><span class="p">)</span>
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="k">scene</span> <span class="n">bg</span> <span class="n">meadow</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="s">"I'll ask her..."</span>
<span class="n">m</span> <span class="s">"Um... will you..."</span>
<span class="n">m</span> <span class="s">"Will you be my artist for a visual novel?"</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">surprised</span>
<span class="s">"Silence."</span>
<span class="s">"She is shocked, and then..."</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="n">s</span> <span class="s">"Sure, but what is a </span><span class="se">\"</span><span class="s">visual novel?</span><span class="se">\"</span><span class="s">"</span>
</pre></div>
</div>
<p>The first new thing we needed to do was to declare the images, using
image statements on lines 2, 3, 5, and 6, inside the init block. These
image statements give an image name, and the filename the image is
found in.</p>
<p>For example, line 5 declares an image named "sylvie smile", found in
the filename "sylvie_smile.png", with the tag "sylvie".</p>
<p>We have a scene statement on line 12. This statement clears out the
screen, and shows the "bg meadow" image. The next line is a show
statement, which shows the "sylvie smile" image on the screen.</p>
<p>The first part of an image name is the image tag. If an image is being
shown, and another image with the same tag is on the screen, then the
image that's on the screen is replaced with the one being shown. This
happens on line 19, the second show statement. Before line 19 is run,
the image "sylvie smile" is on the screen. When line 19 is run, that
image is replaces with "sylvie surprised", since they share the
"sylvie" tag.</p>
<p>For Ren'Py to find the image files, they need to be placed in the game
directory of the current project. The game directory can be found at
"<cite>Project-Name</cite>/game/", or by clicking the "Game Directory" button in
the launcher. You'll probably want to copy the image files from the
"the_question/game/" directory into the "my_question/game/" directory,
so you can run this example.</p>
<p>Ren'Py does not make any distinction between character and background
art, as they're both treated as images. In general, character art
needs to be transparent, which means it should be a PNG
file. Background art can be JPEG or PNG files. By convention,
background images start with the "bg" tag.</p>
<p><strong>Hide Statement.</strong>
Ren'Py also supports a hide statement, which hides the given image.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">label</span> <span class="n">leaving</span><span class="p">:</span>
<span class="n">s</span> <span class="s">"I'll get right on it!"</span>
<span class="k">hide</span> <span class="n">sylvie</span>
<span class="s">"..."</span>
<span class="n">m</span> <span class="s">"That wasn't what I meant!"</span>
</pre></div>
</div>
<p>It's actually pretty rare that you'll need to use hide. Show can be
used when a character is changing emotions, while scene is used when
everyone leaves. You only need to use hide when a character leaves and
the scene stays the same.</p>
</div>
<div class="section" id="transitions">
<h2>Transitions<a class="headerlink" href="#transitions" title="Permalink to this headline">¶</a></h2>
<p>Simply having pictures pop in and out is boring, so Ren'Py implements
transitions that can make changes to the screen more
interesting. Transitions change the screen from what it looked like at
the end of the last interaction (dialogue, menu, or transition), to
what it looks like after any scene, show, and hide statements.</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="k">scene</span> <span class="n">bg</span> <span class="n">uni</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="n">s</span> <span class="s">"Oh, hi, do we walk home together?"</span>
<span class="n">m</span> <span class="s">"Yes..."</span>
<span class="s">"I said and my voice was already shaking."</span>
<span class="k">scene</span> <span class="n">bg</span> <span class="n">meadow</span>
<span class="k">with</span> <span class="n">fade</span>
<span class="s">"We reached the meadows just outside our hometown."</span>
<span class="s">"Autumn was so beautiful here."</span>
<span class="s">"When we were children, we often played here."</span>
<span class="n">m</span> <span class="s">"Hey... ummm..."</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="k">with</span> <span class="n">dissolve</span>
<span class="s">"She turned to me and smiled."</span>
<span class="s">"I'll ask her..."</span>
<span class="n">m</span> <span class="s">"Ummm... will you..."</span>
<span class="n">m</span> <span class="s">"Will you be my artist for a visual novel?"</span>
</pre></div>
</div>
<p>The with statement takes the name of a transition to use. The most
common one is <tt class="docutils literal"><span class="pre">dissolve</span></tt> which dissolves from one screen to the
next. Another useful transition is <tt class="docutils literal"><span class="pre">fade</span></tt> which fades the
screen to black, and then fades in the new screen.</p>
<p>When a transition is placed after multiple scene, show, or hide
statements, it applies to them all at once. If you were to write:</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">scene</span> <span class="n">bg</span> <span class="n">meadow</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="k">with</span> <span class="n">dissolve</span>
</pre></div>
</div>
<p>Both the "bg meadow" and "sylvie smiles" would be dissolved in at the
same time. To dissolve them in one at a time, you need to write two
with statements:</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">scene</span> <span class="n">bg</span> <span class="n">meadow</span>
<span class="k">with</span> <span class="n">dissolve</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="k">with</span> <span class="n">dissolve</span>
</pre></div>
</div>
<p>This first dissolves in the meadow, and then dissolves in sylvie. If
you wanted to instantly show the meadow, and then show sylvie, you
could write:</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">scene</span> <span class="n">bg</span> <span class="n">meadow</span>
<span class="k">with</span> <span class="bp">None</span>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span>
<span class="k">with</span> <span class="n">dissolve</span>
</pre></div>
</div>
<p>Here, None is used to indicate a special transition that updates
Ren'Py's idea of what the prior screen was, without actually showing
anything to the user.</p>
</div>
<div class="section" id="positions">
<h2>Positions<a class="headerlink" href="#positions" title="Permalink to this headline">¶</a></h2>
<p>By default, images are shown centered horizontally, and with their
bottom edge touching the bottom of the screen. This is usually okay
for backgrounds and single characters, but when showing more than one
character on the screen it probably makes sense to do it at another
position. It also might make sense to reposition a character for story
purposes.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">show</span> <span class="n">sylvie</span> <span class="n">smile</span> <span class="k">at</span> <span class="n">right</span>
</pre></div>
</div>
<p>To do this repositioning, add an at-clause to a show statement. The at
clause takes a position, and shows the image at that position. Ren'Py
includes several pre-defined positions: <tt class="docutils literal"><span class="pre">left</span></tt> for the right side of
the screen, <tt class="docutils literal"><span class="pre">right</span></tt> for the right side, <tt class="docutils literal"><span class="pre">center</span></tt> for centered
horizontally (the default), and <tt class="docutils literal"><span class="pre">truecenter</span></tt> for centered
horizontally and vertically.</p>
<p>A user can define their own positions, and event complicated moves,
but that's outside of the scope of this quickstart.</p>
</div>
<div class="section" id="music-and-sound">
<h2>Music and Sound<a class="headerlink" href="#music-and-sound" title="Permalink to this headline">¶</a></h2>
<p>Most games play music in the background. Music is played with the play music
statement. It can take either a string containing a filename, or a list of filenames
to be played. When the list is given, the item of it is played in order.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">play</span> <span class="n">music</span> <span class="s">"illurock.ogg"</span>
<span class="k">play</span> <span class="n">music</span> <span class="p">[</span><span class="s">"1.ogg"</span><span class="p">,</span> <span class="s">"2.ogg"</span><span class="p">]</span>
</pre></div>
</div>
<p>When changing music, one can supply a fadeout and a fadein clause, which
are used to fade out the old music and fade in the new music.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">play</span> <span class="n">music</span> <span class="s">"illurock.ogg"</span> <span class="n">fadeout</span> <span class="mf">1.0</span> <span class="n">fadein</span> <span class="mf">1.0</span>
</pre></div>
</div>
<p>And if you supply a loop clause, it loops. if you supply a noloop clause, it
doesn't loop. In Ren'Py, music files automatically loop until they are stopped
by the user.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">play</span> <span class="n">music</span> <span class="s">"illurock.ogg"</span> <span class="n">loop</span>
<span class="k">play</span> <span class="n">music</span> <span class="s">"illurock.ogg"</span> <span class="n">noloop</span>
</pre></div>
</div>
<p>Music can be stopped with the stop music statement, which can also
optionally take a fadeout clause.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">stop</span> <span class="n">music</span>
</pre></div>
</div>
<p>Sound effects can be played with the play sound statement. It defaults to not looping.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="k">play</span> <span class="na">sound</span> <span class="s">"effect.ogg"</span>
</pre></div>
</div>
<p>The play sound statement can have same clauses with the play music statement.</p>
<p>Ren'Py support many formats for sound and music, but OGG Vorbis is
preferred. Like image files, sound and music files must be placed in
the game directory.</p>
</div>
<div class="section" id="pause-statement">
<h2>Pause Statement<a class="headerlink" href="#pause-statement" title="Permalink to this headline">¶</a></h2>
<p>The pause statement causes Ren'Py to pause until the mouse is clicked. If the
optional expression is given, it will be evaluated to a number, and the pause
will automatically terminate once that number of seconds has elapsed.</p>
</div>
<div class="section" id="ending-the-game">
<h2>Ending the Game<a class="headerlink" href="#ending-the-game" title="Permalink to this headline">¶</a></h2>
<p>You can end the game by running the return statement, without having
called anything. Before doing this, it's best to put something in the
game that indicates that the game is ending, and perhaps giving the
user an ending number or ending name.</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="s">".:. Good Ending."</span>
<span class="k">return</span>
</pre></div>
</div>
<p>That's all you need to make a kinetic novel, a game without any
choices in it. Now, we'll look at what it takes to make a game that
presents menus to the user.</p>
</div>
<div class="section" id="menus-labels-and-jumps">
<h2>Menus, Labels, and Jumps<a class="headerlink" href="#menus-labels-and-jumps" title="Permalink to this headline">¶</a></h2>
<p>The menu statement lets you present a choice to the user:</p>
<div class="highlight-renpy"><div class="highlight"><pre>
<span class="n">s</span> <span class="s">"Sure, but what's a </span><span class="se">\"</span><span class="s">visual novel?</span><span class="se">\"</span><span class="s">"</span>
<span class="k">menu</span><span class="p">:</span>
<span class="s">"It's a story with pictures."</span><span class="p">:</span>
<span class="k">jump</span> <span class="n">vn</span>
<span class="s">"It's a hentai game."</span><span class="p">:</span>
<span class="k">jump</span> <span class="n">hentai</span>
<span class="k">label</span> <span class="n">vn</span><span class="p">:</span>
<span class="n">m</span> <span class="s">"It's a story with pictures and music."</span>
<span class="k">jump</span> <span class="n">marry</span>
<span class="k">label</span> <span class="n">hentai</span><span class="p">:</span>
<span class="n">m</span> <span class="s">"Why it's a game with lots of sex."</span>
<span class="k">jump</span> <span class="n">marry</span>
<span class="k">label</span> <span class="n">marry</span><span class="p">:</span>
<span class="k">scene</span> <span class="n">black</span>
<span class="k">with</span> <span class="n">dissolve</span>
<span class="s">"--- years later ---"</span>
</pre></div>
</div>
<p>This example shows how menus are used with Ren'Py. The menu statement
introduces an in-game-menu. The menu statement takes a block of lines,
each consisting of a string followed by a colon. These are the menu
choices which are presented to the user. Each menu choice should be
followed by a block of one or more Ren'Py statements. When a choice is
chosen, the statements following it are run.</p>
<p>In our example, each menu choice runs a jump statement. The jump
statement transfers control to a label defined using the label
statement. The code following that label is run.</p>
<p>In our example above, after Sylvie asks her question, the user is
presented with a menu containing two choices. If the user picks "It's
a story with pictures.", the first jump statement is run, and control
is transferred to the <tt class="docutils literal"><span class="pre">vn</span></tt> label. This will cause the pov character to
say "It's a story with pictures and music.", after which control is
transferred to the <tt class="docutils literal"><span class="pre">marry</span></tt> label.</p>
<p>Labels may be defined in any file that is in the game directory, and
ends with .rpy. The filename doesn't matter to Ren'Py, only the labels
contained within it. A label may only appear in a single file.</p>
</div>
<div class="section" id="python-and-if-statements">
<h2>Python and If Statements<a class="headerlink" href="#python-and-if-statements" title="Permalink to this headline">¶</a></h2>
<p>While simple (and even fairly complex) games can be made using only
using menus and jump statements, after a point it becomes necessary to
store the user's choices in variables, and access them again
later. This is what Ren'Py's python support is for.</p>
<p>Python support can be accessed in two ways. A line beginning with a
dollar-sign is a single-line python statement, while the keyword
"python:" is used to introduce a block of python statements.</p>
<p>Python makes it easy to store flags in response to user input. Just
initialize the flag at the start of the game:</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">label</span> <span class="n">start</span><span class="p">:</span>
<span class="k">$</span> <span class="n">bl_game</span> <span class="o">=</span> <span class="bp">False</span>
</pre></div>
</div>
<p>You can then change the flag in code that is chosen by menus:</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="k">label</span> <span class="n">hentai</span><span class="p">:</span>
<span class="k">$</span> <span class="n">bl_game</span> <span class="o">=</span> <span class="bp">True</span>
<span class="n">m</span> <span class="s">"Why it's a game with lots of sex."</span>
<span class="n">s</span> <span class="s">"You mean, like a boy's love game?"</span>
<span class="n">s</span> <span class="s">"I've always wanted to make one of those."</span>
<span class="n">s</span> <span class="s">"I'll get right on it!"</span>
<span class="k">jump</span> <span class="n">marry</span>
</pre></div>
</div>
<p>And check it later:</p>
<div class="highlight-renpy"><div class="highlight"><pre><span class="s">"And so, we became a visual novel creating team."</span>
<span class="s">"We made games and had a lot of fun making them."</span>
<span class="k">if</span> <span class="n">bl_game</span><span class="p">:</span>
<span class="s">"Well, apart from that boy's love game she insisted on making."</span>
<span class="s">"And one day..."</span>
</pre></div>
</div>
<p>Of course, python variables need not be simple True/False values. They
can be arbitrary python values. They can be used to store the player's
name, to store a points score, or for any other purpose. Since Ren'Py
includes the ability to use the full Python programming language, many
things are possible.</p>
</div>
<div class="section" id="releasing-your-game">
<h2>Releasing Your Game<a class="headerlink" href="#releasing-your-game" title="Permalink to this headline">¶</a></h2>
<p>Once you've made a game, there are a number of things you should do
before releasing it:</p>
<dl class="docutils">
<dt><strong>Edit options.rpy.</strong></dt>
<dd>The options.rpy file, created when you create a new game, contains
a number of settings that you may want to customize. Some of them,
like the screen height and screen width, should probably be set
before making the game. Others, like the window title, can be set
any time.</dd>
<dt><strong>Add a plug for Ren'Py.</strong></dt>
<dd><p class="first">This step is completely optional, but we do ask that if you have
credits in your game, you mention Ren'Py in them. We suggest using
something like "Made with the Ren'Py visual novel engine.", but
that's just a suggestion, and what you write is up to you.</p>
<p class="last">We think that the games people make are the best advertising for
Ren'Py, and we hope that by including this, you'll help more people
learn how to make visual novels in Ren'Py.</p>
</dd>
<dt><strong>Check for a new version of Ren'Py.</strong></dt>
<dd>New versions of Ren'Py are released on a regular basis, to fix bugs
and add new features. Before releasing, click update in the launcher
to update Ren'Py to the latest version. You can also download new
versions and view a list of changes at
<a class="reference external" href="http://www.renpy.org/latest.html">http://www.renpy.org/latest.html</a>.</dd>
<dt><strong>Check the Script.</strong></dt>
<dd>From the front page of the launcher, choose "Check Script
(Lint)". This will check your games for errors that may affect some
users. These errors can affect users on the Mac and Linux
platforms, so it's important to fix them all, even if you don't see
them on your computer.</dd>
<dt><strong>Build Distributions.</strong></dt>
<dd>From the front page of the launcher, choose "Build Distributions". Based
on the information contained in options.rpy, the launcher will build one
or more archive files containing your game.</dd>
<dt><strong>Test.</strong></dt>
<dd>Lint is not a substitute for thorough testing. It's your
responsibility to check your game before it is released. Consider asking
friends to help beta-test your game, as often a tester can find problems
you can't.</dd>
<dt><strong>Release.</strong></dt>
<dd><p class="first">You should post the generated files (for Windows, Mac, and Linux) up
on the web somewhere, and tell people where to download them
from. Congratulations, you've released a game!</p>
<p class="last">Please also add your released game to our <a class="reference external" href="http://games.renpy.org">games database</a>,
so we can keep track of the Ren'Py games being made.</p>
</dd>
</dl>
</div>
<div class="section" id="script-of-the-question">
<h2>Script of The Question<a class="headerlink" href="#script-of-the-question" title="Permalink to this headline">¶</a></h2>
<p>You can view the full script of ''The Question'' <a class="reference internal" href="thequestion.html#thequestion"><em>here</em></a>.</p>
</div>
<div class="section" id="where-do-we-go-from-here">
<h2>Where do we go from here?<a class="headerlink" href="#where-do-we-go-from-here" title="Permalink to this headline">¶</a></h2>
<p>This Quickstart has barely scratched the surface of what Ren'Py is
capable of. For simplicity's sake, we've omitted many features Ren'Py
supports. To get a feel for what Ren'Py is capable of, we suggest
playing through the Tutorial, and having Eileen demonstrate these features
to you.</p>
<p>You may also want to read the rest of this (complex) manual, as it's
the definitive guide to Ren'Py.</p>
<p>On the Ren'Py website, there's the a <a class="reference external" href="http://www.renpy.org/wiki/renpy/doc/FAQ">FAQ</a> giving answers to
common questions, and a <a class="reference external" href="http://www.renpy.org/wiki/renpy/doc/cookbook/Cookbook">Cookbook</a> giving
useful code snippets. If you have questions, we suggest asking them at
the <a class="reference external" href="http://lemmasoft.renai.us/forums/">Lemma Soft Forums</a>, the
official forum of Ren'Py. This is the central hub of the Ren'Py
community, where we welcome new users and the questions they bring.</p>
<p>Thank you for choosing the Ren'Py visual novel engine. We look forward
to seeing what you create with it!</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="language_basics.html" title="Language Basics"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to Ren'Py's documentation!"
>previous</a> |</li>
<li> <img src="_static/logo.png" width=19 height=21 align=center>
<li> <a href="http://www.renpy.org/">Ren'Py Home</a> |
<li><a href="index.html">Ren'Py Documentation</a></li>
</ul>
</div>
</body>
</html>
|