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
|
<html><head><title>TheQuestionScript - Ren'Py Visual Novel Engine</title><link href="../shared.css" rel="stylesheet"><link href="../monobook.css" rel="stylesheet"><link href="../common.css" rel="stylesheet"><link href="../monobook2.css" rel="stylesheet"><link href="../docs.css" rel="stylesheet" /></link></link></link></link></head><body><div id="bodyContent">
<p class="docnav"><a href="../index.html">documentation index</a></p><p><a id="The_Question_-_Script" name="The_Question_-_Script"></a></p>
<h1><span class="mw-headline">The Question - Script</span></h1>
<p>The script is divided over two files.</p>
<ul>
<li><a href="#script.rpy" title="">script.rpy</a> contains the main body of the game.</li>
<li><a href="#options.rpy" title="">options.rpy</a> contains options which customize the display of parts of the game.</li>
</ul>
<p><a id="script.rpy" name="script.rpy"></a></p>
<h2><span class="mw-headline">script.rpy</span></h2>
<pre>
<span class="slc"># Declare images used by this game.</span>
<span class="kwa">image</span> bg lecturehall <span class="sym">=</span> <span class="str">"lecturehall.jpg"</span>
<span class="kwa">image</span> bg uni <span class="sym">=</span> <span class="str">"uni.jpg"</span>
<span class="kwa">image</span> bg meadow <span class="sym">=</span> <span class="str">"meadow.jpg"</span>
<span class="kwa">image</span> bg club <span class="sym">=</span> <span class="str">"club.jpg"</span>
<span class="kwa">image</span> sylvie normal <span class="sym">=</span> <span class="str">"sylvie_normal.png"</span>
<span class="kwa">image</span> sylvie giggle <span class="sym">=</span> <span class="str">"sylvie_giggle.png"</span>
<span class="kwa">image</span> sylvie smile <span class="sym">=</span> <span class="str">"sylvie_smile.png"</span>
<span class="kwa">image</span> sylvie surprised <span class="sym">=</span> <span class="str">"sylvie_surprised.png"</span>
<span class="kwa">image</span> sylvie2 normal <span class="sym">=</span> <span class="str">"sylvie2_normal.png"</span>
<span class="kwa">image</span> sylvie2 giggle <span class="sym">=</span> <span class="str">"sylvie2_giggle.png"</span>
<span class="kwa">image</span> sylvie2 smile <span class="sym">=</span> <span class="str">"sylvie2_smile.png"</span>
<span class="kwa">image</span> sylvie2 surprised <span class="sym">=</span> <span class="str">"sylvie2_surprised.png"</span>
<span class="slc"># Define characters used by this game.</span>
<span class="kwa">define</span> s <span class="sym">=</span> <span class="kwd">Character</span><span class="sym">(</span><span class="str">'Sylvie'</span><span class="sym">,</span> color<span class="sym">=</span><span class="str">"#c8ffc8"</span><span class="sym">)</span>
<span class="kwa">define</span> m <span class="sym">=</span> <span class="kwd">Character</span><span class="sym">(</span><span class="str">'Me'</span><span class="sym">,</span> color<span class="sym">=</span><span class="str">"#c8c8ff"</span><span class="sym">)</span>
<span class="slc"># The game starts here.</span>
<span class="kwa">label</span> start<span class="sym">:</span>
$ bl_game <span class="sym">=</span> <span class="kwa">False</span>
play music <span class="str">"illurock.ogg"</span>
<span class="kwa">scene</span> bg lecturehall
<span class="kwa">with</span> fade
<span class="str">"Well, professor Eileen's lecture was interesting."</span>
<span class="str">"But to be honest, I couldn't concentrate on it very much."</span>
<span class="str">"I had a lot of other thoughts on my mind."</span>
<span class="str">"And they all ended up with a question."</span>
<span class="str">"A question, I've been meaning to ask someone."</span>
<span class="kwa">scene</span> bg uni
<span class="kwa">with</span> fade
<span class="str">"When we came out of the university, I saw her."</span>
<span class="kwa">show</span> sylvie normal
<span class="kwa">with</span> dissolve
<span class="str">"She was a wonderful person."</span>
<span class="str">"I've known her ever since we were children."</span>
<span class="str">"And she's always been a good friend."</span>
<span class="str">"But..."</span>
<span class="str">"Recently..."</span>
<span class="str">"I think..."</span>
<span class="str">"... that I wanted more."</span>
<span class="str">"More just talking... more than just walking home together when our classes ended."</span>
<span class="str">"And I decided..."</span>
<span class="kwa">menu</span><span class="sym">:</span>
<span class="str">"... to ask her right away."</span><span class="sym">:</span>
<span class="kwa">jump</span> rightaway
<span class="str">"... to ask her later."</span><span class="sym">:</span>
<span class="kwa">jump</span> later
<span class="kwa">label</span> rightaway<span class="sym">:</span>
<span class="kwa">show</span> sylvie smile
s <span class="str">"Oh, hi, do we walk home together?"</span>
m <span class="str">"Yes..."</span>
<span class="str">"I said and my voice was already shaking."</span>
<span class="kwa">scene</span> bg meadow
<span class="kwa">with</span> fade
<span class="str">"We reached the meadows just outside our hometown."</span>
<span class="str">"Autumn was so beautiful here."</span>
<span class="str">"When we were children, we often played here."</span>
m <span class="str">"Hey... ummm..."</span>
<span class="kwa">show</span> sylvie smile
<span class="kwa">with</span> dissolve
<span class="str">"She turned to me and smiled."</span>
<span class="str">"I'll ask her..."</span>
m <span class="str">"Ummm... will you..."</span>
m <span class="str">"Will you be my artist for a visual novel?"</span>
<span class="kwa">show</span> sylvie surprised
<span class="str">"Silence."</span>
<span class="str">"She is shocked. And then..."</span>
<span class="kwa">show</span> sylvie smile
s <span class="str">"Sure, but what is a</span> <span class="esc">\"</span><span class="str">visual novel?</span><span class="esc">\"</span><span class="str">"</span>
<span class="kwa">menu</span><span class="sym">:</span>
<span class="str">"It's a story with pictures."</span><span class="sym">:</span>
<span class="kwa">jump</span> vn
<span class="str">"It's a hentai game."</span><span class="sym">:</span>
<span class="kwa">jump</span> hentai
<span class="kwa">label</span> vn<span class="sym">:</span>
m <span class="str">"It's a story with pictures and music."</span>
m <span class="str">"And you'll be able to make choices that influence the outcome of the story."</span>
s <span class="str">"So it's like those choose-your-adventure books?"</span>
m <span class="str">"Exactly! I plan on making a small romantic story."</span>
m <span class="str">"And I figured you could help me... since I know how you like to draw."</span>
<span class="kwa">show</span> sylvie normal
s <span class="str">"Well, I can try. I hope I don't disappoint you."</span>
m <span class="str">"You can't disappoint me, you know that."</span>
<span class="kwa">jump</span> marry
<span class="kwa">label</span> hentai<span class="sym">:</span>
$ bl_game <span class="sym">=</span> <span class="kwa">True</span>
m <span class="str">"Why it's a game with lots of sex."</span>
s <span class="str">"You mean, like a boy's love game?"</span>
s <span class="str">"I've always wanted to make one of those."</span>
s <span class="str">"I'll get right on it!"</span>
<span class="kwa">hide</span> sylvie
<span class="kwa">with</span> dissolve
<span class="str">"..."</span>
m <span class="str">"That wasn't what I meant!"</span>
<span class="kwa">jump</span> marry
<span class="kwa">label</span> marry<span class="sym">:</span>
<span class="kwa">scene</span> black
<span class="kwa">with</span> dissolve
<span class="str">"--- years later ---"</span>
<span class="kwa">scene</span> bg club
<span class="kwa">with</span> dissolve
<span class="str">"And so, we became a visual novel creating team."</span>
<span class="str">"We made games and had a lot of fun making them."</span>
<span class="kwa">if</span> bl_game<span class="sym">:</span>
<span class="str">"Well, apart from that Boy's Love game she insisted on making."</span>
<span class="str">"And one day..."</span>
<span class="kwa">show</span> sylvie2 normal
<span class="kwa">with</span> dissolve
s <span class="str">"Hey..."</span>
m <span class="str">"Yes?"</span>
<span class="kwa">show</span> sylvie2 giggle
s <span class="str">"Marry me!"</span>
m <span class="str">"What???"</span>
<span class="kwa">show</span> sylvie2 surprised
s <span class="str">"Well, don't you love me?"</span>
m <span class="str">"I do, actually."</span>
<span class="kwa">show</span> sylvie2 smile
s <span class="str">"See? We've been making romantic visual novels, spending time together, helping each other...."</span>
s <span class="str">"... and when you give love to others, love will come to you."</span>
m <span class="str">"Hmmm, that's a nice thought."</span>
<span class="kwa">show</span> sylvie2 giggle
s <span class="str">"I just made that up."</span>
m <span class="str">"But it's good."</span>
<span class="kwa">show</span> sylvie2 normal
s <span class="str">"I know. So, will you marry me?"</span>
m <span class="str">"Ummm, of course I will. I've actually been meaning to ask you, but since you brought it up..."</span>
s <span class="str">"I know, but you are so indecisive, that I thought I'd take the initiative. "</span>
m <span class="str">"I guess... It's all all about asking the right question... at the right time."</span>
<span class="kwa">show</span> sylvie2 giggle
s <span class="str">"It is. But now, stop being theoretical, and give me a kiss!"</span>
<span class="kwa">scene</span> black
<span class="kwa">with</span> dissolve
<span class="str">"And we got married shortly after that."</span>
<span class="str">"In fact, we made many more visual novels."</span>
<span class="str">"And together, we lived happily ever after."</span>
<span class="str">".:. Good Ending."</span>
<span class="kwa">return</span>
<span class="kwa">label</span> later<span class="sym">:</span>
<span class="kwa">scene</span> black
<span class="kwa">with</span> dissolve
<span class="str">"And so I decided to ask her later."</span>
<span class="str">"But I was indecisive."</span>
<span class="str">"I couldn't ask her that day, and I couldn't ask her later."</span>
<span class="str">"I guess I will never know now."</span>
<span class="str">".:. Bad Ending."</span>
<span class="kwa">return</span>
</pre>
<p><a id="options.rpy" name="options.rpy"></a></p>
<h2><span class="mw-headline">options.rpy</span></h2>
<pre>
<span class="slc">## This file contains some of the options that can be changed to customize</span>
<span class="slc">## your Ren'Py game. It only contains the most common options... there</span>
<span class="slc">## is quite a bit more customization you can do.</span>
<span class="slc">##</span>
<span class="slc">## Lines beginning with two '#' marks are comments, and you shouldn't</span>
<span class="slc">## uncomment them. Lines beginning with a single '#' mark are</span>
<span class="slc">## commented-out code, and you may want to uncomment them when</span>
<span class="slc">## appropriate.</span>
<span class="kwa">init</span> <span class="sym">-</span><span class="num">1</span><span class="sym">:</span>
<span class="kwa">python hide</span><span class="sym">:</span>
<span class="slc">## Should we enable the use of developer tools? This should be</span>
<span class="slc">## set to False before the game is released, so the user can't</span>
<span class="slc">## cheat using developer tools.</span>
config<span class="sym">.</span>developer <span class="sym">=</span> <span class="kwa">True</span>
<span class="slc">## These control the width and height of the screen.</span>
config<span class="sym">.</span>screen_width <span class="sym">=</span> <span class="num">800</span>
config<span class="sym">.</span>screen_height <span class="sym">=</span> <span class="num">600</span>
<span class="slc">## This controls the title of the window, when Ren'Py is</span>
<span class="slc">## running in a window.</span>
config<span class="sym">.</span>window_title <span class="sym">=</span> u<span class="str">"The Question"</span>
<span class="slc">## We then want to call a theme function. themes.roundrect is</span>
<span class="slc">## a theme that features the use of rounded rectangles. It's</span>
<span class="slc">## the only theme we currently support.</span>
<span class="slc">##</span>
<span class="slc">## The theme function takes a number of parameters that can</span>
<span class="slc">## customize the color scheme.</span>
theme<span class="sym">.</span><span class="kwd">roundrect</span><span class="sym">(</span>
<span class="slc">## The color of an idle widget face.</span>
widget <span class="sym">=</span> <span class="str">"#F8AD00"</span><span class="sym">,</span>
<span class="slc">## The color of a focused widget face.</span>
widget_hover <span class="sym">=</span> <span class="str">"#E97F00"</span><span class="sym">,</span>
<span class="slc">## The color of the text in a widget.</span>
widget_text <span class="sym">=</span> <span class="str">"#581A00"</span><span class="sym">,</span>
<span class="slc">## The color of the text in a selected widget. (For</span>
<span class="slc">## example, the current value of a preference.)</span>
widget_selected <span class="sym">=</span> <span class="str">"#58A1FF"</span><span class="sym">,</span>
<span class="slc">## The color of a disabled widget face.</span>
disabled <span class="sym">=</span> <span class="str">"#404040"</span><span class="sym">,</span>
<span class="slc">## The color of disabled widget text.</span>
disabled_text <span class="sym">=</span> <span class="str">"#FFC89A"</span><span class="sym">,</span>
<span class="slc">## The color of informational labels.</span>
<span class="kwa">label</span> <span class="sym">=</span> <span class="str">"#ffffff"</span><span class="sym">,</span>
<span class="slc">## The color of a frame containing widgets.</span>
frame <span class="sym">=</span> <span class="str">"#95850F"</span><span class="sym">,</span>
<span class="slc">## If this is True, in-game menus are placed in the center</span>
<span class="slc">## the screen. If False, they are placed inside a window</span>
<span class="slc">## at the bottom of the screen.</span>
button_menu <span class="sym">=</span> <span class="kwa">True</span><span class="sym">,</span>
<span class="slc">## The background of the main menu. This can be a color</span>
<span class="slc">## beginning with '#', or an image filename. The latter</span>
<span class="slc">## should take up the full height and width of the screen.</span>
mm_root <span class="sym">=</span> <span class="str">"menu.jpg"</span><span class="sym">,</span>
<span class="slc">## The background of the game menu. This can be a color</span>
<span class="slc">## beginning with '#', or an image filename. The latter</span>
<span class="slc">## should take up the full height and width of the screen.</span>
gm_root <span class="sym">=</span> <span class="str">"menu2.jpg"</span><span class="sym">,</span>
<span class="slc">## And we're done with the theme. The theme will customize</span>
<span class="slc">## various styles, so if we want to change them, we should</span>
<span class="slc">## do so below.</span>
<span class="sym">)</span>
<span class="slc">#########################################</span>
<span class="slc">## These settings let you customize the window containing the</span>
<span class="slc">## dialogue and narration, by replacing it with an image.</span>
<span class="slc">## The background of the window. In a Frame, the two numbers</span>
<span class="slc">## are the size of the left/right and top/bottom borders,</span>
<span class="slc">## respectively.</span>
<span class="slc"># style.window.background = Frame("frame.png", 12, 12)</span>
<span class="slc">## Margin is space surrounding the window, where the background</span>
<span class="slc">## is not drawn.</span>
<span class="slc"># style.window.left_margin = 6</span>
<span class="slc"># style.window.right_margin = 6</span>
<span class="slc"># style.window.top_margin = 6</span>
<span class="slc"># style.window.bottom_margin = 6</span>
<span class="slc">## Padding is space inside the window, where the background is</span>
<span class="slc">## drawn.</span>
<span class="slc"># style.window.left_padding = 6</span>
<span class="slc"># style.window.right_padding = 6</span>
<span class="slc"># style.window.top_padding = 6</span>
<span class="slc"># style.window.bottom_padding = 6</span>
<span class="slc">## This is the minimum height of the window, including the margins</span>
<span class="slc">## and padding.</span>
<span class="slc"># style.window.yminimum = 250</span>
<span class="slc">#########################################</span>
<span class="slc">## This lets you change the placement of the main menu.</span>
<span class="slc">## The way placement works is that we find an anchor point</span>
<span class="slc">## inside a displayable, and a position (pos) point on the</span>
<span class="slc">## screen. We then place the displayable so the two points are</span>
<span class="slc">## at the same place.</span>
<span class="slc">## An anchor/pos can be given as an integer or a floating point</span>
<span class="slc">## number. If an integer, the number is interpreted as a number</span>
<span class="slc">## of pixels from the upper-left corner. If a floating point,</span>
<span class="slc">## the number is interpreted as a fraction of the size of the</span>
<span class="slc">## displayable or screen.</span>
<span class="slc"># style.mm_menu_frame.xpos = 0.5</span>
<span class="slc"># style.mm_menu_frame.xanchor = 0.5</span>
<span class="slc"># style.mm_menu_frame.ypos = 0.75</span>
<span class="slc"># style.mm_menu_frame.yanchor = 0.5</span>
<span class="slc">#########################################</span>
<span class="slc">## These let you customize the default font used for text in Ren'Py.</span>
<span class="slc">## The file containing the default font.</span>
<span class="slc"># style.default.font = "DejaVuSans.ttf"</span>
<span class="slc">## The default size of text.</span>
<span class="slc"># style.default.size = 22</span>
<span class="slc">## Note that these only change the size of some of the text. Other</span>
<span class="slc">## buttons have their own styles.</span>
<span class="slc">#########################################</span>
<span class="slc">## These settings let you change some of the sounds that are used by</span>
<span class="slc">## Ren'Py.</span>
<span class="slc">## Set this to False if the game does not have any sound effects.</span>
config<span class="sym">.</span>has_sound <span class="sym">=</span> <span class="kwa">True</span>
<span class="slc">## Set this to False if the game does not have any music.</span>
config<span class="sym">.</span>has_music <span class="sym">=</span> <span class="kwa">True</span>
<span class="slc">## Set this to False if the game does not have voicing.</span>
config<span class="sym">.</span>has_voice <span class="sym">=</span> <span class="kwa">True</span>
<span class="slc">## Sounds that are used when button and imagemaps are clicked.</span>
<span class="slc"># style.button.activate_sound = "click.wav"</span>
<span class="slc"># style.imagemap.activate_sound = "click.wav"</span>
<span class="slc">## Sounds that are used when entering and exiting the game menu.</span>
<span class="slc"># config.enter_sound = "click.wav"</span>
<span class="slc"># config.exit_sound = "click.wav"</span>
<span class="slc">## A sample sound that can be played to check the sound volume.</span>
<span class="slc"># config.sample_sound = "click.wav"</span>
<span class="slc">## Music that is played while the user is at the main menu.</span>
<span class="slc"># config.main_menu_music = "main_menu_theme.ogg"</span>
<span class="slc">#########################################</span>
<span class="slc">## Miscellaneous customizations</span>
<span class="slc">## These let you change the transitions that are used when entering</span>
<span class="slc">## and exiting the game menu.</span>
config<span class="sym">.</span>enter_transition <span class="sym">=</span> dissolve
config<span class="sym">.</span>exit_transition <span class="sym">=</span> dissolve
</pre>
<div class="visualClear" />
<hr /><p class="docnav"><a href="../index.html">documentation index</a></p></div>
</body></html>
|