evennia/docs/1.0-dev/Contribs/Contrib-Extended-Room.html
Evennia docbuilder action d339a9deb3 Updated HTML docs.
2022-11-15 20:00:58 +00:00

222 lines
No EOL
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Extended Room &#8212; Evennia 1.0-dev documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Basic Map" href="Contrib-Ingame-Map-Display.html" />
<link rel="prev" title="Turn based battle system framework" href="Contrib-Turnbattle.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<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="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Ingame-Map-Display.html" title="Basic Map"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="Contrib-Turnbattle.html" title="Turn based battle system framework"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" accesskey="U">Contribs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Extended Room</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Extended Room</a><ul>
<li><a class="reference internal" href="#installation-testing">Installation/testing:</a></li>
<li><a class="reference internal" href="#features">Features</a><ul>
<li><a class="reference internal" href="#time-changing-description-slots">Time-changing description slots</a></li>
<li><a class="reference internal" href="#in-description-changing-tags">In-description changing tags</a></li>
<li><a class="reference internal" href="#details">Details</a></li>
<li><a class="reference internal" href="#extra-commands">Extra commands</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="Contrib-Turnbattle.html"
title="previous chapter">Turn based battle system framework</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="Contrib-Ingame-Map-Display.html"
title="next chapter">Basic Map</a></p>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="../_sources/Contribs/Contrib-Extended-Room.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li>
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
<a href="https://evennia.blogspot.com/">Blog</a>
</li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="Contrib-Extended-Room.html">1.0-dev (develop branch)</a></li>
<ul>
<li><a href="../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="bodywrapper">
<div class="body" role="main">
<section class="tex2jax_ignore mathjax_ignore" id="extended-room">
<h1>Extended Room<a class="headerlink" href="#extended-room" title="Permalink to this headline"></a></h1>
<p>Contribution - Griatch 2012, vincent-lg 2019</p>
<p>This extends the normal <code class="docutils literal notranslate"><span class="pre">Room</span></code> typeclass to allow its description to change
with time-of-day and/or season. It also adds details for the player to look at
in the room (without having to create a new in-game object for each). The room is
supported by new <code class="docutils literal notranslate"><span class="pre">look</span></code> and <code class="docutils literal notranslate"><span class="pre">desc</span></code> commands.</p>
<section id="installation-testing">
<h2>Installation/testing:<a class="headerlink" href="#installation-testing" title="Permalink to this headline"></a></h2>
<p>Adding the <code class="docutils literal notranslate"><span class="pre">ExtendedRoomCmdset</span></code> to the default character cmdset will add all
new commands for use.</p>
<p>In more detail, in <code class="docutils literal notranslate"><span class="pre">mygame/commands/default_cmdsets.py</span></code>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="o">...</span>
<span class="kn">from</span> <span class="nn">evennia.contrib</span> <span class="kn">import</span> <span class="n">extended_room</span> <span class="c1"># &lt;---</span>
<span class="k">class</span> <span class="nc">CharacterCmdset</span><span class="p">(</span><span class="n">default_cmds</span><span class="o">.</span><span class="n">Character_CmdSet</span><span class="p">):</span>
<span class="o">...</span>
<span class="k">def</span> <span class="nf">at_cmdset_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="o">...</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">extended_room</span><span class="o">.</span><span class="n">ExtendedRoomCmdSet</span><span class="p">)</span> <span class="c1"># &lt;---</span>
</pre></div>
</div>
<p>Then reload to make the new commands available. Note that they only work
on rooms with the typeclass <code class="docutils literal notranslate"><span class="pre">ExtendedRoom</span></code>. Create new rooms with the right
typeclass or use the <code class="docutils literal notranslate"><span class="pre">typeclass</span></code> command to swap existing rooms.</p>
</section>
<section id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this headline"></a></h2>
<section id="time-changing-description-slots">
<h3>Time-changing description slots<a class="headerlink" href="#time-changing-description-slots" title="Permalink to this headline"></a></h3>
<p>This allows to change the full description text the room shows
depending on larger time variations. Four seasons (spring, summer,
autumn and winter) are used by default. The season is calculated
on-demand (no Script or timer needed) and updates the full text block.</p>
<p>There is also a general description which is used as fallback if
one or more of the seasonal descriptions are not set when their
time comes.</p>
<p>An updated <code class="docutils literal notranslate"><span class="pre">desc</span></code> command allows for setting seasonal descriptions.</p>
<p>The room uses the <code class="docutils literal notranslate"><span class="pre">evennia.utils.gametime.GameTime</span></code> global script. This is
started by default, but if you have deactivated it, you need to
supply your own time keeping mechanism.</p>
</section>
<section id="in-description-changing-tags">
<h3>In-description changing tags<a class="headerlink" href="#in-description-changing-tags" title="Permalink to this headline"></a></h3>
<p>Within each seasonal (or general) description text, you can also embed
time-of-day dependent sections. Text inside such a tag will only show
during that particular time of day. The tags looks like <code class="docutils literal notranslate"><span class="pre">&lt;timeslot&gt;</span> <span class="pre">...</span> <span class="pre">&lt;/timeslot&gt;</span></code>. By default there are four timeslots per day - morning,
afternoon, evening and night.</p>
</section>
<section id="details">
<h3>Details<a class="headerlink" href="#details" title="Permalink to this headline"></a></h3>
<p>The Extended Room can be “detailed” with special keywords. This makes
use of a special <code class="docutils literal notranslate"><span class="pre">Look</span></code> command. Details are “virtual” targets to look
at, without there having to be a database object created for it. The
Details are simply stored in a dictionary on the room and if the look
command cannot find an object match for a <code class="docutils literal notranslate"><span class="pre">look</span> <span class="pre">&lt;target&gt;</span></code> command it
will also look through the available details at the current location
if applicable. The <code class="docutils literal notranslate"><span class="pre">detail</span></code> command is used to change details.</p>
</section>
<section id="extra-commands">
<h3>Extra commands<a class="headerlink" href="#extra-commands" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">CmdExtendedRoomLook</span></code> - look command supporting room details</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">CmdExtendedRoomDesc</span></code> - desc command allowing to add seasonal descs,</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">CmdExtendedRoomDetail</span></code> - command allowing to manipulate details in this room
as well as listing them</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">CmdExtendedRoomGameTime</span></code> - A simple <code class="docutils literal notranslate"><span class="pre">time</span></code> command, displaying the current
time and season.</p></li>
</ul>
<hr class="docutils" />
<p><small>This document page is generated from <code class="docutils literal notranslate"><span class="pre">evennia/contrib/grid/extended_room/README.md</span></code>. Changes to this
file will be overwritten, so edit that file rather than this one.</small></p>
</section>
</section>
</section>
</div>
</div>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<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="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="Contrib-Ingame-Map-Display.html" title="Basic Map"
>next</a> |</li>
<li class="right" >
<a href="Contrib-Turnbattle.html" title="Turn based battle system framework"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" >Contribs</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Extended Room</a></li>
</ul>
<div class="develop">develop branch</div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2022, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>