806 lines
55 KiB
HTML
806 lines
55 KiB
HTML
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<title>Dialogue and Narration — Ren'Py Documentation</title>
|
||
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
|
||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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>
|
||
<script type="text/javascript" src="_static/language_data.js"></script>
|
||
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
|
||
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
|
||
<script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
|
||
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="Displaying Images" href="displaying_images.html" />
|
||
<link rel="prev" title="Labels & Control Flow" href="label.html" />
|
||
<meta charset='utf-8'>
|
||
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
|
||
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
|
||
</head><body>
|
||
|
||
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
|
||
<div class="container">
|
||
<div class="navbar-header">
|
||
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
|
||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
<span class="icon-bar"></span>
|
||
</button>
|
||
<a class="navbar-brand" href="index.html">
|
||
Ren'Py Documentation</a>
|
||
<span class="navbar-text navbar-version pull-left"><b>7.5.3</b></span>
|
||
</div>
|
||
|
||
<div class="collapse navbar-collapse nav-collapse">
|
||
<ul class="nav navbar-nav">
|
||
|
||
<li><a href="https://www.renpy.org">Home Page</a></li>
|
||
<li><a href="https://www.renpy.org/doc/html/">Online Documentation</a></li>
|
||
|
||
|
||
<li class="dropdown globaltoc-container">
|
||
<a role="button"
|
||
id="dLabelGlobalToc"
|
||
data-toggle="dropdown"
|
||
data-target="#"
|
||
href="index.html">Site <b class="caret"></b></a>
|
||
<ul class="dropdown-menu globaltoc"
|
||
role="menu"
|
||
aria-labelledby="dLabelGlobalToc"><ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="gui.html">GUI Customization Guide</a></li>
|
||
</ul>
|
||
<ul class="current">
|
||
<li class="toctree-l1"><a class="reference internal" href="language_basics.html">Language Basics</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="label.html">Labels & Control Flow</a></li>
|
||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Dialogue and Narration</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="displaying_images.html">Displaying Images</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="menus.html">In-Game Menus</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="python.html">Python Statements</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="conditional.html">Conditional Statements</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="audio.html">Audio</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="movie.html">Movie</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="voice.html">Voice</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="text.html">Text</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="translation.html">Translation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="displayables.html">Displayables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="transforms.html">Transforms</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="transitions.html">Transitions</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="atl.html">Animation and Transformation Language</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="matrixcolor.html">Matrixcolor</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="layeredimage.html">Layered Images</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="3dstage.html">3D Stage</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="live2d.html">Live2D Cubism</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="style.html">Styles</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="style_properties.html">Style Properties</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="screens.html">Screens and Screen Language</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="screen_actions.html">Screen Actions, Values, and Functions</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="screen_special.html">Special Screen Names</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="screen_optimization.html">Screen Language Optimization</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="config.html">Configuration Variables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="preferences.html">Preference Variables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="store_variables.html">Store Variables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="mouse.html">Custom Mouse Cursors</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="launcher.html">Launcher</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="director.html">Interactive Director</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="nvl_mode.html">NVL-Mode Tutorial</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="input.html">Text Input</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="side_image.html">Side Images</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="rooms.html">Image Gallery, Music Room, and Replay Actions</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="drag_drop.html">Drag and Drop</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="sprites.html">Sprites</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="keymap.html">Customizing the Keymap</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="achievement.html">Achievements</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="history.html">Dialogue History</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="multiple.html">Multiple Character Dialogue</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="splashscreen_presplash.html">Splashscreen and Presplash</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="statement_equivalents.html">Statement Equivalents</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="save_load_rollback.html">Saving, Loading, and Rollback</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="persistent.html">Persistent Data</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="trans_trans_python.html">Transforms and Transitions in Python</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="gui_advanced.html">Advanced GUI</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="screen_python.html">Screens and Python</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="modes.html">Modes</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="cdd.html">Creator-Defined Displayables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="cds.html">Creator-Defined Statements</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="custom_text_tags.html">Custom Text Tags</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="character_callbacks.html">Character Callbacks</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="file_python.html">File Access</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="color_class.html">Color Class</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="matrix.html">Matrix</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="model.html">Model-Based Rendering</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="other.html">Other Functions and Variables</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="build.html">Building Distributions</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="updater.html">Web Updater</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="android.html">Android</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="chromeos.html">Chrome OS/Chromebook</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="ios.html">iOS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="iap.html">In-App Purchasing</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="gesture.html">Gestures</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="raspi.html">Raspberry Pi</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="security.html">Security</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="problems.html">Dealing with Problems</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="environment_variables.html">Environment Variables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="self_voicing.html">Self-Voicing</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="editor.html">Text Editor Integration</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="skins.html">Skins</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="translating_renpy.html">Translating Ren'Py</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog (Ren'Py 7.x-)</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="changelog6.html">Changelog (Ren'Py 6.11 - 6.99)</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="incompatible.html">Incompatible Changes</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="distributor.html">Distributor Notes</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="sponsors.html">Ren'Py Development Sponsors</a></li>
|
||
</ul>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="thequestion.html">Script of The Question</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="thequestion_nvl.html">NVL-mode script for The Question</a></li>
|
||
</ul>
|
||
</ul>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
<form class="navbar-form navbar-right" action="search.html" method="get">
|
||
<div class="form-group">
|
||
<input type="text" name="q" class="form-control" placeholder="Search" />
|
||
</div>
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="container">
|
||
<div class="row">
|
||
<div class="col-md-3">
|
||
<div id="sidebar" class="bs-sidenav" role="complementary"><ul>
|
||
<li><a class="reference internal" href="#">Dialogue and Narration</a><ul>
|
||
<li><a class="reference internal" href="#say-statement">Say Statement</a></li>
|
||
<li><a class="reference internal" href="#defining-character-objects">Defining Character Objects</a></li>
|
||
<li><a class="reference internal" href="#say-with-image-attributes">Say with Image Attributes</a></li>
|
||
<li><a class="reference internal" href="#example-characters">Example Characters</a></li>
|
||
<li><a class="reference internal" href="#special-characters">Special Characters</a></li>
|
||
<li><a class="reference internal" href="#dialogue-window-management">Dialogue Window Management</a></li>
|
||
<li><a class="reference internal" href="#say-with-arguments">Say with Arguments</a></li>
|
||
<li><a class="reference internal" href="#monologue-mode">Monologue Mode</a></li>
|
||
<li><a class="reference internal" href="#python-equivalents">Python Equivalents</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="col-md-9 content">
|
||
|
||
<div class="section" id="dialogue-and-narration">
|
||
<h1>Dialogue and Narration<a class="headerlink" href="#dialogue-and-narration" title="Permalink to this headline"> link</a></h1>
|
||
<p>Text is fundamental to visual novels, and generally quite important to
|
||
storytelling-based games. This text may consist of dialogue labeled
|
||
with the character that is saying it, and narration, which does not
|
||
have a speaker. (For convenience, we will lump both dialogue and
|
||
narration together as dialogue, except where the differences are
|
||
important.) It's also important that the user be able to customize the
|
||
look of dialogue to suit their game.</p>
|
||
<p>In Ren'Py, most dialogue is written using say statements. The look of
|
||
dialogue may be customized on a per-character basis by using Character
|
||
objects.</p>
|
||
<div class="section" id="say-statement">
|
||
<span id="id1"></span><h2>Say Statement<a class="headerlink" href="#say-statement" title="Permalink to this headline"> link</a></h2>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">say</span></code> statement is used for dialogue and narration. Since it's
|
||
almost always the most frequently used statement in Ren'Py scripts,
|
||
the say statement has a syntax that minimizes the overhead in
|
||
writing it. Some example say statements are:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span>
|
||
<span class="s2">"This is narration."</span>
|
||
|
||
<span class="s2">"Eileen"</span> <span class="s2">"This is dialogue, with an explicit character name."</span>
|
||
|
||
<span class="n">e</span> <span class="s2">"This is dialogue, using a character object instead."</span>
|
||
|
||
<span class="s2">"Bam!!"</span> <span class="k">with</span> <span class="n">vpunch</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The first form of the say statement consists of a string by
|
||
itself. This form is used for narration, with the narration being the
|
||
contents of the string.</p>
|
||
<p>The second form consists of two strings. The first string is the name
|
||
of the character who is speaking, and the second is the dialogue being
|
||
spoken.</p>
|
||
<p>The third form consists of a simple expression followed by a
|
||
string. The simple expression should evaluate to either a string
|
||
giving a character name, or a Character object. In the latter case,
|
||
the character object is used to control how the dialogue is shown.</p>
|
||
<p>The final form consists of a string and a with clause which has a
|
||
transition. In this case, the string is shown and a screen is shaken
|
||
at the same time.</p>
|
||
<p>Although the precise details of what a say statement does is
|
||
controlled by the character object used, the usual effect of a say
|
||
statement is to display dialogue on the screen until the user clicks
|
||
to dismiss it, then to remove that dialogue on the screen.</p>
|
||
<p>Certain characters have special meaning to Ren'Py, and so can't be
|
||
used in dialogue strings. The <code class="docutils literal notranslate"><span class="pre">{</span></code> character begins a text tag, and
|
||
the <code class="docutils literal notranslate"><span class="pre">[</span></code> character begins a substitution. To use them in dialogue,
|
||
double them. It may also be necessary to precede a quote with a
|
||
backslash to prevent it from closing the string. For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="s2">"I walked past a sign saying, </span><span class="se">\"</span><span class="s2">Let's give it 100%!</span><span class="se">\"</span><span class="s2">"</span>
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="defining-character-objects">
|
||
<span id="id2"></span><h2>Defining Character Objects<a class="headerlink" href="#defining-character-objects" title="Permalink to this headline"> link</a></h2>
|
||
<p>By creating a Character object and using it in a say statement, you
|
||
can customize the look (and to some extent, the behavior) of
|
||
dialogue. Characters are created by using the <code class="docutils literal notranslate"><span class="pre">define</span></code> statement to
|
||
assign a Character to a variable. For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">,</span>
|
||
<span class="n">who_color</span><span class="o">=</span><span class="s2">"#c8ffc8"</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Once this is done, the character can be used in a say statement:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="s2">"Hello, world."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Character is a Python function that takes a large number of keyword
|
||
arguments. These keyword arguments control the behavior of the
|
||
character.</p>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">define</span></code> statement causes its expression to be evaluated, and assigned to the
|
||
supplied name. If not inside an <code class="docutils literal notranslate"><span class="pre">init</span></code> block, the <code class="docutils literal notranslate"><span class="pre">define</span></code> statement will
|
||
automatically be run with init priority 0.</p>
|
||
<dl class="function">
|
||
<dt id="Character">
|
||
<code class="descname">Character</code><span class="sig-paren">(</span><em>name=...</em>, <em>kind=adv</em>, <em>**args</em><span class="sig-paren">)</span><a class="headerlink" href="#Character" title="Permalink to this definition"> link</a></dt>
|
||
<dd><p>Creates and returns a Character object, which controls the look
|
||
and feel of dialogue and narration.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>name</cite></dt>
|
||
<dd>If a string, the name of the character for dialogue. When
|
||
<cite>name</cite> is None, display of the name is omitted, as for
|
||
narration. If no name is given, the name is taken from
|
||
<cite>kind</cite>, and otherwise defaults to None.</dd>
|
||
<dt><cite>kind</cite></dt>
|
||
<dd>The Character to base this Character off of. When used, the
|
||
default value of any argument not supplied to this Character
|
||
is the value of that argument supplied to <code class="docutils literal notranslate"><span class="pre">kind</span></code>. This can
|
||
be used to define a template character, and then copy that
|
||
character with changes.</dd>
|
||
</dl>
|
||
<p><strong>Linked Image.</strong>
|
||
An image tag may be associated with a Character. This allows a
|
||
say statement involving this character to display an image with
|
||
the tag, and also allows Ren'Py to automatically select a side
|
||
image to show when this character speaks.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>image</cite></dt>
|
||
<dd>A string giving the image tag that is linked with this
|
||
character.</dd>
|
||
</dl>
|
||
<p><strong>Voice Tag.</strong>
|
||
If a voice tag is assign to a Character, the voice files that are
|
||
associated with it, can be muted or played in the preference
|
||
screen.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>voice_tag</cite></dt>
|
||
<dd>A String that enables the voice file associated with the
|
||
Character to be muted or played in the 'voice' channel.</dd>
|
||
</dl>
|
||
<p><strong>Prefixes and Suffixes.</strong>
|
||
These allow a prefix and suffix to be applied to the name of the
|
||
character, and to the text being shown. This can be used, for
|
||
example, to add quotes before and after each line of dialogue.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>what_prefix</cite></dt>
|
||
<dd>A string that is prepended to the dialogue being spoken before
|
||
it is shown.</dd>
|
||
<dt><cite>what_suffix</cite></dt>
|
||
<dd>A string that is appended to the dialogue being spoken before
|
||
it is shown.</dd>
|
||
<dt><cite>who_prefix</cite></dt>
|
||
<dd>A string that is prepended to the name of the character before
|
||
it is shown.</dd>
|
||
<dt><cite>who_suffix</cite></dt>
|
||
<dd>A string that is appended to the name of the character before
|
||
it is shown.</dd>
|
||
</dl>
|
||
<p><strong>Changing Name Display.</strong>
|
||
These options help to control the display of the name.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>dynamic</cite></dt>
|
||
<dd>If true, then <cite>name</cite> should either be a string containing a Python
|
||
expression, a function, or a callable object. If it's a string,
|
||
That string will be evaluated before each line of dialogue, and
|
||
the result used as the name of the character. Otherwise, the
|
||
function or callable object will be called with no arguments
|
||
before each line of dialogue, and the return value of the call will
|
||
be used as the name of the character.</dd>
|
||
</dl>
|
||
<p><strong>Controlling Interactions.</strong>
|
||
These options control if the dialogue is displayed, if an
|
||
interaction occurs, and the mode that is entered upon display.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>condition</cite></dt>
|
||
<dd>If given, this should be a string containing a Python
|
||
expression. If the expression is false, the dialogue
|
||
does not occur, as if the say statement did not happen.</dd>
|
||
<dt><cite>interact</cite></dt>
|
||
<dd>If true, the default, an interaction occurs whenever the
|
||
dialogue is shown. If false, an interaction will not occur,
|
||
and additional elements can be added to the screen.</dd>
|
||
<dt><cite>advance</cite></dt>
|
||
<dd>If true, the default, the player can click to advance through
|
||
the statement, and other means of advancing (such as skip and
|
||
auto-forward mode) will also work. If false, the player will be
|
||
unable to move past the say statement unless an alternate means
|
||
(such as a jump hyperlink or screen) is provided.</dd>
|
||
<dt><cite>mode</cite></dt>
|
||
<dd>A string giving the mode to enter when this character
|
||
speaks. See the section on <a class="reference internal" href="modes.html#modes"><span class="std std-ref">modes</span></a> for more details.</dd>
|
||
<dt><cite>callback</cite></dt>
|
||
<dd>A function that is called when events occur while the
|
||
character is speaking. See the section on
|
||
<a class="reference internal" href="character_callbacks.html#character-callbacks"><span class="std std-ref">Character Callbacks</span></a> for more information.</dd>
|
||
</dl>
|
||
<p><strong>Click-to-continue.</strong>
|
||
A click-to-continue indicator is displayed once all the text has
|
||
finished displaying, to prompt the user to advance.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>ctc</cite></dt>
|
||
<dd>A displayable to use as the click-to-continue indicator, unless
|
||
a more specific indicator is used.</dd>
|
||
<dt><cite>ctc_pause</cite></dt>
|
||
<dd>A displayable to use a the click-to-continue indicator when the
|
||
display of text is paused by the {p} or {w} text tags.</dd>
|
||
<dt><cite>ctc_timedpause</cite></dt>
|
||
<dd>A displayable to use a the click-to-continue indicator when the
|
||
display of text is paused by the {p=} or {w=} text tags. When
|
||
None, this takes its default from <cite>ctc_pause</cite>, use <code class="docutils literal notranslate"><span class="pre">Null()</span></code>
|
||
when you want a <cite>ctc_pause</cite> but no <cite>ctc_timedpause</cite>.</dd>
|
||
<dt><cite>ctc_position</cite></dt>
|
||
<dd>Controls the location of the click-to-continue indicator. If
|
||
<code class="docutils literal notranslate"><span class="pre">"nestled"</span></code>, the indicator is displayed as part of the text
|
||
being shown, immediately after the last character. <code class="docutils literal notranslate"><span class="pre">"nestled-close"</span></code> is
|
||
similar, except a break is not allowed between the text and the CTC
|
||
indicator. If <code class="docutils literal notranslate"><span class="pre">"fixed"</span></code>,
|
||
the indicator is added to the screen, and its position is
|
||
controlled by the position style properties.</dd>
|
||
</dl>
|
||
<p><strong>Screens.</strong>
|
||
The display of dialogue uses a <a class="reference internal" href="screens.html#screens"><span class="std std-ref">screen</span></a>. These arguments
|
||
allow you to select that screen, and to provide arguments to it.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>screen</cite></dt>
|
||
<dd>The name of the screen that is used to display the dialogue.</dd>
|
||
</dl>
|
||
<p>Keyword arguments beginning with <code class="docutils literal notranslate"><span class="pre">show_</span></code> have the prefix
|
||
stripped off, and are passed to the screen as arguments. For
|
||
example, the value of <code class="docutils literal notranslate"><span class="pre">show_myflag</span></code> will become the value of
|
||
the <code class="docutils literal notranslate"><span class="pre">myflag</span></code> variable in the screen. (The <code class="docutils literal notranslate"><span class="pre">myflag</span></code> variable isn't
|
||
used by default, but can be used by a custom say screen.)</p>
|
||
<p>One show variable is, for historical reasons, handled by Ren'Py itself:</p>
|
||
<dl class="docutils">
|
||
<dt><cite>show_layer</cite></dt>
|
||
<dd>If given, this should be a string giving the name of the layer
|
||
to show the say screen on.</dd>
|
||
</dl>
|
||
<p><strong>Styling Text and Windows.</strong>
|
||
Keyword arguments beginning with <code class="docutils literal notranslate"><span class="pre">who_</span></code>, <code class="docutils literal notranslate"><span class="pre">what_</span></code>, and
|
||
<code class="docutils literal notranslate"><span class="pre">window_</span></code> have their prefix stripped, and are used to <a class="reference internal" href="style.html#styles"><span class="std std-ref">style</span></a> the character name, the spoken text, and the window
|
||
containing both, respectively.</p>
|
||
<p>For example, if a character is given the keyword argument
|
||
<code class="docutils literal notranslate"><span class="pre">who_color="#c8ffc8"</span></code>, the color of the character's name is
|
||
changed, in this case to green. <code class="docutils literal notranslate"><span class="pre">window_background="frame.png"</span></code>
|
||
sets the background of the window containing this character's
|
||
dialogue.</p>
|
||
<p>The style applied to the character name, spoken text, and window
|
||
can also be set this way, using the <code class="docutils literal notranslate"><span class="pre">who_style</span></code>, <code class="docutils literal notranslate"><span class="pre">what_style</span></code>, and
|
||
<code class="docutils literal notranslate"><span class="pre">window_style</span></code> arguments, respectively.</p>
|
||
<p>Setting <a class="reference internal" href="config.html#var-config.character_id_prefixes"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.character_id_prefixes</span></code></a> makes it possible to style
|
||
other displayables as well. For example, when the default GUI is used,
|
||
styles prefixed with <code class="docutils literal notranslate"><span class="pre">namebox_</span></code> are used to style the name of the
|
||
speaking character.</p>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="say-with-image-attributes">
|
||
<h2>Say with Image Attributes<a class="headerlink" href="#say-with-image-attributes" title="Permalink to this headline"> link</a></h2>
|
||
<p>When a character is defined with an associated image tag, say
|
||
statement involving that character may have image attributes
|
||
placed between the character name and the second string.</p>
|
||
<p>In this form, if an image with the given tag is showing, Ren'Py will
|
||
issue a show command involving the character tag and the
|
||
attributes. If the image is not shown, Ren'Py will store the
|
||
attributes for use by side images, but will not show an image.</p>
|
||
<p>For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">,</span> <span class="k">image</span><span class="o">=</span><span class="s2">"eileen"</span><span class="p">)</span>
|
||
|
||
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">mad</span>
|
||
<span class="n">e</span> <span class="s2">"I'm a little upset at you."</span>
|
||
|
||
<span class="n">e</span> <span class="n">happy</span> <span class="s2">"But it's just a passing thing."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>is equivalent to:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">)</span>
|
||
|
||
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">mad</span>
|
||
<span class="n">e</span> <span class="s2">"I'm a little upset at you."</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span>
|
||
<span class="n">e</span> <span class="s2">"But it's just a passing thing."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>In the above example, the <code class="docutils literal notranslate"><span class="pre">mad</span></code> and <code class="docutils literal notranslate"><span class="pre">happy</span></code> replace one another.
|
||
But it is possible to revert to a <code class="docutils literal notranslate"><span class="pre">happy</span></code>-less eileen without specifying
|
||
the <code class="docutils literal notranslate"><span class="pre">mad</span></code> attribute. An attribute name prepended with the minus sign ( - )
|
||
has that effect, just as it does with the <a class="reference internal" href="displaying_images.html#show-statement"><span class="std std-ref">show statement</span></a>.</p>
|
||
<p>For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">)</span>
|
||
|
||
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span>
|
||
<span class="n">e</span> <span class="n">mad</span> <span class="s2">"I'm a little upset at you."</span>
|
||
|
||
<span class="n">e</span> <span class="n">happy</span> <span class="s2">"That's funny."</span>
|
||
|
||
<span class="n">e</span> <span class="o">-</span><span class="n">happy</span> <span class="s2">"I'm not sure what to think now."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>When an @ is included in the list of attributes, any element placed after it
|
||
has an only temporary effect, and is reverted at the end of the line of dialogue.</p>
|
||
<p>For example, the following code is equivalent to the previous example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">,</span> <span class="k">image</span><span class="o">=</span><span class="s2">"eileen"</span><span class="p">)</span>
|
||
|
||
<span class="k">label</span> <span class="n">start</span><span class="p">:</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">mad</span>
|
||
<span class="n">e</span> <span class="s2">"I'm a little upset at you."</span>
|
||
|
||
<span class="n">e</span> <span class="o">@</span> <span class="n">happy</span> <span class="s2">"That's funny."</span>
|
||
|
||
<span class="n">e</span> <span class="s2">"I'm not sure what to think now."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>A single line can combine permanent changes coming before
|
||
the @, and temporary ones coming after.</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="n">happy</span> <span class="o">@</span> <span class="n">vhappy</span> <span class="s2">"Really! That changes everything."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The minus sign can also be used after the @ sign:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="o">@</span> <span class="n">right</span> <span class="o">-</span><span class="n">mad</span> <span class="s2">"My anger is temporarily suspended..."</span>
|
||
<span class="n">e</span> <span class="s2">"HOWEVER !"</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>To cause a transition to occur whenever the images are changed in this way, set
|
||
<a class="reference internal" href="config.html#var-config.say_attribute_transition"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.say_attribute_transition</span></code></a> to a transition. For more control,
|
||
use <a class="reference internal" href="config.html#var-config.say_attribute_transition_callback"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.say_attribute_transition_callback</span></code></a>.</p>
|
||
</div>
|
||
<div class="section" id="example-characters">
|
||
<h2>Example Characters<a class="headerlink" href="#example-characters" title="Permalink to this headline"> link</a></h2>
|
||
<p>Here are a few example characters:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># A character that has its dialogue enclosed in parenthesis.</span>
|
||
<span class="k">define</span> <span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">,</span> <span class="n">what_prefix</span><span class="o">=</span><span class="s1">'('</span><span class="p">,</span> <span class="n">what_suffix</span><span class="o">=</span><span class="s1">')'</span><span class="p">)</span>
|
||
|
||
<span class="c1"># A character that pulls its name from a variable.</span>
|
||
<span class="k">define</span> <span class="n">p</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"player_name"</span><span class="p">,</span> <span class="n">dynamic</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="special-characters">
|
||
<h2>Special Characters<a class="headerlink" href="#special-characters" title="Permalink to this headline"> link</a></h2>
|
||
<p>A few character names are defined by default, and are used
|
||
automatically in certain situations. Intentionally redefining these
|
||
characters can change the behavior of Ren'Py, but accidentally using
|
||
them can be a problem.</p>
|
||
<dl class="docutils">
|
||
<dt><code class="docutils literal notranslate"><span class="pre">adv</span></code></dt>
|
||
<dd>The default kind of character used by Character. This sets up a
|
||
character such that one line is displayed on the screen at a
|
||
time.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">nvl</span></code></dt>
|
||
<dd>A kind of Character that causes dialogue to be displayed in
|
||
<a class="reference internal" href="nvl_mode.html"><span class="doc">NVL-Mode Tutorial</span></a>, with multiple lines of text on the screen
|
||
at once.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">narrator</span></code></dt>
|
||
<dd>The character that's used to display narration, by say statements
|
||
without a character name.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">name_only</span></code></dt>
|
||
<dd>A character that is used to display dialogue in which the
|
||
character name is given as a string. This character is copied to a
|
||
new character with the given name, and then that new character is
|
||
used to display the dialogue.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">centered</span></code></dt>
|
||
<dd>A character that causes what it says to be displayed centered,
|
||
in the middle of the screen, outside of any window.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">vcentered</span></code></dt>
|
||
<dd>A character that causes what it says to be displayed centered
|
||
in vertically oriented text, in the middle of the screen,
|
||
outside of any window.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">extend</span></code></dt>
|
||
<dd><p class="first">A character that causes the last character to speak to say a line
|
||
of dialogue consisting of the last line of dialogue spoken, "{fast}",
|
||
and the dialogue given to extend. This can be used to have the screen
|
||
change over the course of dialogue.</p>
|
||
<p class="last">Extend is aware of NVL-mode and treats it correctly. Extend does not work
|
||
properly if the language preference changes between the initial say and
|
||
the extend.</p>
|
||
</dd>
|
||
</dl>
|
||
<p>For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># Show the first line of dialogue, wait for a click, change expression, and show</span>
|
||
<span class="c1"># the rest.</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">concerned</span>
|
||
<span class="n">e</span> <span class="s2">"Sometimes, I feel sad."</span>
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span>
|
||
<span class="n">extend</span> <span class="s2">" But I usually quickly get over it!"</span>
|
||
|
||
<span class="c1"># Similar, but automatically changes the expression when the first line is finished</span>
|
||
<span class="c1"># showing. This only makes sense when the user doesn't have text speed set all the</span>
|
||
<span class="c1"># way up.</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">concerned</span>
|
||
<span class="n">e</span> <span class="s2">"Sometimes, I feel sad.</span><span class="si">{nw}</span><span class="s2">"</span>
|
||
<span class="k">show</span> <span class="n">eileen</span> <span class="n">happy</span>
|
||
<span class="n">extend</span> <span class="s2">" But I usually quickly get over it!"</span>
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="dialogue-window-management">
|
||
<span id="id3"></span><h2>Dialogue Window Management<a class="headerlink" href="#dialogue-window-management" title="Permalink to this headline"> link</a></h2>
|
||
<p>Ren'Py includes several statements that allow for management of the
|
||
dialogue window. As dialogue window is always shown during dialogue,
|
||
these statements control the presence or absence of the window during
|
||
non-dialogue interactions.</p>
|
||
<dl class="docutils">
|
||
<dt><code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">show</span></code></dt>
|
||
<dd>The window show statement causes the window to be shown.
|
||
It takes as an argument an optional transition, which is used to show the
|
||
window. If the transition is omitted, <a class="reference internal" href="config.html#var-config.window_show_transition"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.window_show_transition</span></code></a>
|
||
is used.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">hide</span></code></dt>
|
||
<dd>The window hide statement causes the window to be hidden. It takes as an
|
||
argument an optional transition, which is used to hide the window. If
|
||
the transition is omitted, <a class="reference internal" href="config.html#var-config.window_hide_transition"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.window_hide_transition</span></code></a> is
|
||
used.</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span></code></dt>
|
||
<dd>This enables automatic management of the window. The window is shown
|
||
before statements listed in <a class="reference internal" href="config.html#var-config.window_auto_show"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.window_auto_show</span></code></a> – by default,
|
||
say statements. The window is hidden before statements listed in
|
||
<a class="reference internal" href="config.html#var-config.window_auto_hide"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.window_auto_hide</span></code></a> – by default, <code class="docutils literal notranslate"><span class="pre">scene</span></code> and <code class="docutils literal notranslate"><span class="pre">call</span> <span class="pre">screen</span></code>
|
||
statements, and <code class="docutils literal notranslate"><span class="pre">menu</span></code> statements without a caption.
|
||
(Only statements are considered, not statement equivalent
|
||
functions.)</dd>
|
||
<dt><code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span> <span class="pre">hide</span></code>, <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span> <span class="pre">show</span></code></dt>
|
||
<dd>These statements show or hide the window, with an optional transition,
|
||
like <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">show</span></code> or <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">hide</span></code> do. However, unlike those
|
||
statements, this keeps automatic management enabled.</dd>
|
||
</dl>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span></code> statement uses <a class="reference internal" href="config.html#var-config.window_show_transition"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.window_show_transition</span></code></a>
|
||
and <a class="reference internal" href="config.html#var-config.window_hide_transition"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.window_hide_transition</span></code></a> to show and hide the window,
|
||
respectively. <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span></code> is cancelled by <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">show</span></code> and <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">hide</span></code>.</p>
|
||
<p>For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">window</span> <span class="k">show</span> <span class="c1"># shows the window with the default transition, if any.</span>
|
||
<span class="k">pause</span> <span class="c1"># the window is shown during this pause.</span>
|
||
<span class="k">window</span> <span class="k">hide</span> <span class="c1"># hides the window.</span>
|
||
<span class="k">pause</span> <span class="c1"># the window is hidden during this pause.</span>
|
||
|
||
<span class="k">window</span> <span class="k">show</span> <span class="n">dissolve</span> <span class="c1"># shows the window with dissolve.</span>
|
||
<span class="k">pause</span> <span class="c1"># the window is shown during this pause.</span>
|
||
<span class="k">window</span> <span class="k">hide</span> <span class="n">dissolve</span> <span class="c1"># hides the window with dissolve.</span>
|
||
<span class="k">pause</span> <span class="c1"># the window is hidden during this pause.</span>
|
||
|
||
|
||
<span class="k">window</span> <span class="k">auto</span>
|
||
|
||
<span class="s2">"The window is automatically shown before this line of dialogue."</span>
|
||
<span class="k">pause</span> <span class="c1"># the window is shown during this pause.</span>
|
||
|
||
<span class="k">scene</span> <span class="n">bg</span> <span class="n">washington</span> <span class="c1"># the window is hidden before the scene change.</span>
|
||
<span class="k">with</span> <span class="n">dissolve</span>
|
||
|
||
<span class="k">window</span> <span class="k">auto</span> <span class="k">show</span> <span class="c1"># Shows the window before it normally would be shown.</span>
|
||
|
||
<span class="k">show</span> <span class="n">eileen</span>
|
||
<span class="k">with</span> <span class="n">dissolve</span>
|
||
|
||
<span class="s2">"Without window auto show, the window would have been shown here."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Dialogue window management is subject to the "show empty window"
|
||
<a class="reference internal" href="screen_actions.html#Preference" title="Preference"><code class="xref py py-func docutils literal notranslate"><span class="pre">Preference()</span></code></a>. If the preference is disabled, the statements above
|
||
have no effect.</p>
|
||
</div>
|
||
<div class="section" id="say-with-arguments">
|
||
<h2>Say with Arguments<a class="headerlink" href="#say-with-arguments" title="Permalink to this headline"> link</a></h2>
|
||
<p>Additional arguments can be passed to the say statement by including them
|
||
in parenthesis after the say statement. For example, one can write:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="s2">"Hello, world."</span> <span class="p">(</span><span class="n">what_color</span><span class="o">=</span><span class="s2">"#8c8"</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Arguments to the say statement are first processed by <a class="reference internal" href="config.html#var-config.say_arguments_callback"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.say_arguments_callback</span></code></a>,
|
||
if it is not None. If any remain, they are then passed to the character,
|
||
which treats them as if they were present when the character was defined.
|
||
So, the example above displays the dialogue in green.
|
||
Special keywords <cite>_mode</cite> and <cite>_with_node</cite> will override the ones set in
|
||
the character only for this interaction.</p>
|
||
</div>
|
||
<div class="section" id="monologue-mode">
|
||
<span id="id4"></span><h2>Monologue Mode<a class="headerlink" href="#monologue-mode" title="Permalink to this headline"> link</a></h2>
|
||
<p>Some visual novels have extended narration, or multiple blocks of dialogue
|
||
from the same character. In these cases, typing the name of the character
|
||
and the quotes multiple times is somewhat redundant.</p>
|
||
<p>To cover these cases, Ren'Py supports monologue mode. When dialogue is inside
|
||
triple-quoted strings, Ren'Py will break the dialogue up into blocks at blank
|
||
lines. Each block is then used to create its own say statement. Here's an
|
||
example, with three blocks of narration followed by three lines of dialogue:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="sd">"""</span>
|
||
<span class="sd">This is the first line of narration. It's longer than the other two</span>
|
||
<span class="sd">lines, so it has to wrap.</span>
|
||
|
||
<span class="sd">This is the second line of narration.</span>
|
||
|
||
<span class="sd">This is the third line of narration.</span>
|
||
<span class="sd">"""</span>
|
||
|
||
<span class="n">e</span> <span class="s2">"""</span>
|
||
<span class="s2">This is the first line of dialogue. It's longer than the other two</span>
|
||
<span class="s2">lines, so it has to wrap.</span>
|
||
|
||
<span class="s2">This is the second line of dialogue.</span>
|
||
|
||
<span class="s2">This is the third line of dialogue.</span>
|
||
<span class="s2">"""</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>While additional clauses like arguments or attributes are allowed, they are
|
||
passed to each line in the monologue, which may be less useful.</p>
|
||
<p>If you'd like to omit the spaces between the blocks, write
|
||
<code class="docutils literal notranslate"><span class="pre">rpy</span> <span class="pre">monologue</span> <span class="pre">single</span></code> at the top level of the file, before the first
|
||
monologue line.</p>
|
||
</div>
|
||
<div class="section" id="python-equivalents">
|
||
<h2>Python Equivalents<a class="headerlink" href="#python-equivalents" title="Permalink to this headline"> link</a></h2>
|
||
<div class="admonition note">
|
||
<p class="first admonition-title">Note</p>
|
||
<p class="last">This may only make sense if you've read the <a class="reference internal" href="python.html#python"><span class="std std-ref">Python Statements</span></a> section.</p>
|
||
</div>
|
||
<p>When the first parameter to a say statement is present and an expression,
|
||
the say statement is equivalent to calling that expressing with the dialogue
|
||
and an <code class="docutils literal notranslate"><span class="pre">interact</span></code> argument of True. For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="s2">"Hello, world."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>is equivalent to:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">$</span> <span class="n">e</span><span class="p">(</span><span class="s2">"Hello, world."</span><span class="p">,</span> <span class="n">interact</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The say statement will search the <code class="docutils literal notranslate"><span class="pre">character</span></code> named store before the default
|
||
store. If you want to have a character with the same name as a variable in
|
||
the default store, it can be defined using:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">define</span> <span class="n">character</span><span class="o">.</span><span class="n">e</span> <span class="o">=</span> <span class="n">Character</span><span class="p">(</span><span class="s2">"Eileen"</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>This character can then be used alongside a variable in the default store:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">label</span> <span class="n">start</span><span class="p">:</span>
|
||
|
||
<span class="c1"># This is a terrible variable name.</span>
|
||
<span class="k">$</span> <span class="n">e</span> <span class="o">=</span> <span class="mi">100</span>
|
||
|
||
<span class="n">e</span> <span class="s2">"Our starting energy is [e] units."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>A say with arguments sees the arguments passed to the function. For example:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">e</span> <span class="s2">"Hello, world."</span> <span class="p">(</span><span class="n">what_size</span><span class="o">=</span><span class="mi">32</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>is equivalent to:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">$</span> <span class="n">e</span><span class="p">(</span><span class="s2">"Hello, world."</span><span class="p">,</span> <span class="n">interact</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">what_size</span><span class="o">=</span><span class="mi">32</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>When e is a Character, this is further equivalent to:</p>
|
||
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="k">$</span> <span class="n">Character</span><span class="p">(</span><span class="n">kind</span><span class="o">=</span><span class="n">e</span><span class="p">,</span> <span class="n">what_size</span><span class="o">=</span><span class="mi">32</span><span class="p">)(</span><span class="s2">"Hello, world."</span><span class="p">,</span> <span class="n">interact</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>But it's possible to use <a class="reference internal" href="config.html#var-config.say_arguments_callback"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.say_arguments_callback</span></code></a> or
|
||
have <code class="docutils literal notranslate"><span class="pre">e</span></code> wrap a character to do things differently.</p>
|
||
<p>Window management is performed by setting the <a class="reference internal" href="store_variables.html#var-_window"><code class="xref std std-var docutils literal notranslate"><span class="pre">_window</span></code></a> and
|
||
<a class="reference internal" href="store_variables.html#var-_window_auto"><code class="xref std std-var docutils literal notranslate"><span class="pre">_window_auto</span></code></a> variables, and by using the following two functions:</p>
|
||
<dl class="function">
|
||
<dt id="_window_hide">
|
||
<code class="descname">_window_hide</code><span class="sig-paren">(</span><em>trans=False</em>, <em>auto=False</em><span class="sig-paren">)</span><a class="headerlink" href="#_window_hide" title="Permalink to this definition"> link</a></dt>
|
||
<dd><p>The Python equivalent of the <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">hide</span></code> statement.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>trans</cite></dt>
|
||
<dd>If False, the default window hide transition is used. If None,
|
||
no transition is used. Otherwise, the specified transition is
|
||
used.</dd>
|
||
<dt><cite>auto</cite></dt>
|
||
<dd>If True, this becomes the equivalent of the <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span> <span class="pre">hide</span></code>
|
||
statment.</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="_window_show">
|
||
<code class="descname">_window_show</code><span class="sig-paren">(</span><em>trans=False</em>, <em>auto=False</em><span class="sig-paren">)</span><a class="headerlink" href="#_window_show" title="Permalink to this definition"> link</a></dt>
|
||
<dd><p>The Python equivalent of the <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">show</span></code> statement.</p>
|
||
<dl class="docutils">
|
||
<dt><cite>trans</cite></dt>
|
||
<dd>If False, the default window show transition is used. If None,
|
||
no transition is used. Otherwise, the specified transition is
|
||
used.</dd>
|
||
<dt><cite>auto</cite></dt>
|
||
<dd>If True, this becomes the equivalent of the <code class="docutils literal notranslate"><span class="pre">window</span> <span class="pre">auto</span> <span class="pre">show</span></code>
|
||
statment.</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<footer class="footer">
|
||
<div class="container">
|
||
<p class="pull-right">
|
||
<a href="#">Back to top</a>
|
||
|
||
</p>
|
||
<p>
|
||
© Copyright 2012-2022, Tom Rothamel.<br/>
|
||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.6.<br/>
|
||
</p>
|
||
</div>
|
||
</footer>
|
||
</body>
|
||
</html> |