Updated HTML docs

This commit is contained in:
Evennia docbuilder action 2022-11-09 20:52:30 +00:00
parent 7bc41338de
commit 14d035bab3
97 changed files with 533 additions and 750 deletions

View file

@ -111,21 +111,21 @@
<section class="tex2jax_ignore mathjax_ignore" id="beginner-tutorial">
<h1>Beginner Tutorial<a class="headerlink" href="#beginner-tutorial" title="Permalink to this headline"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">Tutorial Parts</p>
<dl class="simple">
<dt><strong>Introduction</strong></dt><dd><p>Getting set up.</p>
</dd>
<dt>Part 1: <a class="reference external" href="Part1/Beginner-Tutorial-Part1-Intro.html">What we have</a></dt><dd><p>A tour of Evennia and how to use the tools, including an introduction to Python.</p>
</dd>
<dt>Part 2: <a class="reference external" href="Part2/Beginner-Tutorial-Part2-Intro.html">What we want</a></dt><dd><p>Planning our tutorial game and what to think about when planning your own in the future.</p>
</dd>
<dt>Part 3: <a class="reference external" href="Part3/Beginner-Tutorial-Part3-Intro.html">How we get there</a></dt><dd><p>Getting down to the meat of extending Evennia to make our game</p>
</dd>
<dt>Part 4: <a class="reference external" href="Part4/Beginner-Tutorial-Part4-Intro.html">Using what we created</a></dt><dd><p>Building a tech-demo and world content to go with our code</p>
</dd>
<dt>Part 5: <a class="reference external" href="Part5/Beginner-Tutorial-Part5-Intro.html">Showing the world</a></dt><dd><p>Taking our new game online and let players try it out</p>
</dd>
</dl>
<p class="sidebar-title">Beginner Tutorial Parts</p>
<ul class="simple">
<li><p><strong><a class="reference internal" href="#"><span class="doc std std-doc">Introduction</span></a></strong>
<br>Getting set up.</p></li>
<li><p>Part 1: <a class="reference internal" href="Part1/Beginner-Tutorial-Part1-Intro.html"><span class="doc std std-doc">What we have</span></a>
<br>A tour of Evennia and how to use the tools, including an introduction to Python.</p></li>
<li><p>Part 2: <a class="reference internal" href="Part2/Beginner-Tutorial-Part2-Intro.html"><span class="doc std std-doc">What we want</span></a>
<br>Planning our tutorial game and what to think about when planning your own in the future.</p></li>
<li><p>Part 3: <a class="reference internal" href="Part3/Beginner-Tutorial-Part3-Intro.html"><span class="doc std std-doc">How we get there</span></a>
<br>Getting down to the meat of extending Evennia to make our game</p></li>
<li><p>Part 4: <a class="reference internal" href="Part4/Beginner-Tutorial-Part4-Intro.html"><span class="doc std std-doc">Using what we created</span></a>
<br>Building a tech-demo and world content to go with our code</p></li>
<li><p>Part 5: <a class="reference internal" href="Part5/Beginner-Tutorial-Part5-Intro.html"><span class="doc std std-doc">Showing the world</span></a>
<br>Taking our new game online and let players try it out</p></li>
</ul>
</aside>
<p>Welcome to Evennia! This multi-part Beginner Tutorial will help you get off the ground. It consists
of five parts, each with several lessons. You can pick what seems interesting, but if you

View file

@ -111,8 +111,7 @@
<section class="tex2jax_ignore mathjax_ignore" id="adding-custom-commands">
<h1><span class="section-number">8. </span>Adding custom commands<a class="headerlink" href="#adding-custom-commands" title="Permalink to this headline"></a></h1>
<p>In this lesson well learn how to create our own Evennia <em>Commands</em>. If you are new to Python youll
also learn some more basics about how to manipulate strings and get information out of Evennia.</p>
<p>In this lesson well learn how to create our own Evennia <em>Commands</em>. If you are new to Python youll also learn some more basics about how to manipulate strings and get information out of Evennia.</p>
<p>A Command is something that handles the input from a user and causes a result to happen.
An example is <code class="docutils literal notranslate"><span class="pre">look</span></code>, which examines your current location and tells how it looks like and
what is in it.</p>
@ -419,12 +418,14 @@ have the whitespace and is not the same as <code class="docutils literal notrans
<aside class="sidebar">
<p class="sidebar-title">if-statements</p>
<p>The full form of the if statement is</p>
<p>if condition:
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>if condition:
...
elif othercondition:
...
else:
</p>
...
</pre></div>
</div>
<p>There can be any number of <code class="docutils literal notranslate"><span class="pre">elifs</span></code> to mark when different branches of the code should run. If
the <code class="docutils literal notranslate"><span class="pre">else</span></code> condition is given, it will run if none of the other conditions was truthy. In Python
the <code class="docutils literal notranslate"><span class="pre">if..elif..else</span></code> structure also serves the same function as <code class="docutils literal notranslate"><span class="pre">case</span></code> in some other languages.</p>

View file

@ -309,7 +309,7 @@ named simply <code class="docutils literal notranslate"><span class="pre">Object
to use for creating the object. There you go - one red button.</p>
<p>The RedButton is an example object intended to show off a few of Evennias features. You will find
that the <a class="reference internal" href="../../../Components/Typeclasses.html"><span class="doc std std-doc">Typeclass</span></a> and <a class="reference internal" href="../../../Components/Commands.html"><span class="doc std std-doc">Commands</span></a> controlling it are
inside <a class="reference internal" href="../../../api/evennia.contrib.tutorials.red_button.html#evennia-contrib-tutorials-red-button"><span class="std std-ref">evennia/contrib/tutorials/red_button</span></a></p>
inside <a class="reference internal" href="../../../api/evennia.contrib.tutorials.red_button.html"><span class="doc std std-doc">evennia/contrib/tutorials/red_button</span></a></p>
<p>If you wait for a while (make sure you dropped it!) the button will blink invitingly.</p>
<p>Why dont you try to push it …?</p>
<p>Surely a big red button is meant to be pushed.</p>

View file

@ -109,10 +109,7 @@
<h1><span class="section-number">6. </span>Overview of the Evennia library<a class="headerlink" href="#overview-of-the-evennia-library" title="Permalink to this headline"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">API</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>API stands for `Application Programming Interface`, a description for how to access
the resources of a program or library.
</pre></div>
</div>
<p>API stands for <code class="docutils literal notranslate"><span class="pre">Application</span> <span class="pre">Programming</span> <span class="pre">Interface</span></code>, a description for how to access the resources of a program or library.</p>
</aside>
<p>A good place to start exploring Evennia is the <a class="reference internal" href="../../../Evennia-API.html"><span class="doc std std-doc">Evenia-API frontpage</span></a>.
This page sums up the main components of Evennia with a short description of each. Try clicking through
@ -186,12 +183,7 @@ from here to <code class="docutils literal notranslate"><span class="pre">mygame
</ul>
<aside class="sidebar">
<p class="sidebar-title"><strong>init</strong>.py</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>The `__init__.py` file is a special Python filename used to represent a Python &#39;package&#39;.
When you import `evennia` on its own, you import this file. When you do `evennia.foo` Python will
first look for a property `.foo` in `__init__.py` and then for a module or folder of that name
in the same location.
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">__init__.py</span></code> file is a special Python filename used to represent a Python package. When you import <code class="docutils literal notranslate"><span class="pre">evennia</span></code> on its own, you import this file. When you do <code class="docutils literal notranslate"><span class="pre">evennia.foo</span></code> Python will first look for a property <code class="docutils literal notranslate"><span class="pre">.foo</span></code> in <code class="docutils literal notranslate"><span class="pre">__init__.py</span></code> and then for a module or folder of that name in the same location.</p>
</aside>
<p>While all the actual Evennia code is found in the various folders, the <code class="docutils literal notranslate"><span class="pre">__init__.py</span></code> represents the entire
package <code class="docutils literal notranslate"><span class="pre">evennia</span></code>. It contains “shortcuts” to code that is actually located elsewhere. Most of these shortcuts
@ -213,12 +205,7 @@ are actually importing from <code class="docutils literal notranslate"><span cla
</div>
<aside class="sidebar">
<p class="sidebar-title">Relative and absolute imports</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>The first full-stop in `from .objects.objects ...` means that
we are importing from the current location. This is called a `relative import`.
By comparison, `from evennia.objects.objects` is an `absolute import`. In this particular
case, the two would give the same result.
</pre></div>
</div>
<p>The first full-stop in <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">.objects.objects</span> <span class="pre">...</span></code> means that we are importing from the current location. This is called a <code class="docutils literal notranslate"><span class="pre">relative</span> <span class="pre">import</span></code>. By comparison, <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">evennia.objects.objects</span></code> is an <code class="docutils literal notranslate"><span class="pre">absolute</span> <span class="pre">import</span></code>. In this particular case, the two would give the same result.</p>
</aside>
<blockquote>
<div><p>You can also look at <a class="reference internal" href="../../../Evennia-API.html#typeclasses"><span class="std std-doc">the right section of the API frontpage</span></a> and click through
@ -230,7 +217,7 @@ it as <code class="docutils literal notranslate"><span class="pre">from</span> <
to look it up in the docs:</p>
<ol class="simple">
<li><p>Open the <a class="reference internal" href="../../../Evennia-API.html"><span class="doc std std-doc">API frontpage</span></a></p></li>
<li><p>Locate the link to <a class="reference internal" href="../../../api/evennia.objects.objects.html#evennia-objects-objects"><span class="std std-ref">evennia.objects.objects</span></a> and click on it.
<li><p>Locate the link to <a class="reference internal" href="../../../api/evennia.objects.objects.html"><span class="doc std std-doc">evennia.objects.objects</span></a> and click on it.
3 You are now in the python module. Scroll down (or search in your web browser) to find the <code class="docutils literal notranslate"><span class="pre">DefaultObject</span></code> class.
4 You can now read what this does and what methods are on it. If you want to see the full source, click the
[source] link next to it.</p></li>

View file

@ -129,16 +129,7 @@ Python package management).</p>
“python paths”, such as</p>
<aside class="sidebar">
<p class="sidebar-title">Python-paths</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>A &#39;python path&#39; uses &#39;.&#39; instead of &#39;/&#39; or &#39;`\\`&#39; and
skips the `.py` ending of files. It can also point to
the code contents of python files. Since Evennia is already
looking for code in your game dir, your python paths can start
from there.
So a path `/home/foo/devel/mygame/commands/command.py`
would translate to a Python-path `commands.command`.
</pre></div>
</div>
<p>A python path uses . instead of / or <code class="docutils literal notranslate"><span class="pre">\\</span></code> and skips the <code class="docutils literal notranslate"><span class="pre">.py</span></code> ending of files. It can also point to the code contents of python files. Since Evennia is already looking for code in your game dir, your python paths can start from there. So a path <code class="docutils literal notranslate"><span class="pre">/home/foo/devel/mygame/commands/command.py</span></code> would translate to a Python-path <code class="docutils literal notranslate"><span class="pre">commands.command</span></code>.</p>
</aside>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>create/drop button:tutorial_examples.red_button.RedButton
</pre></div>
@ -182,11 +173,7 @@ to update Evennias default settings to point to the right places in the new s
of Evennia. These manifest in game like the server understanding input like <code class="docutils literal notranslate"><span class="pre">look</span></code> or <code class="docutils literal notranslate"><span class="pre">dig</span></code>.</p>
<aside class="sidebar">
<p class="sidebar-title">Classes</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>A `class` is template for creating object-instances of a particular type
in Python. We will explain classes in more detail in the next
`python overview &lt;Python-basic-tutorial-part-two&gt;`_.
</pre></div>
</div>
<p>A <code class="docutils literal notranslate"><span class="pre">class</span></code> is template for creating object-instances of a particular type in Python. We will explain classes in more detail in the next lesson.</p>
</aside>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/evennia/evennia/blob/master/evennia/game_template/commands/command.py">command.py</a> (Python-path: <code class="docutils literal notranslate"><span class="pre">commands.command</span></code>) - this contain the

View file

@ -224,12 +224,7 @@ from <code class="docutils literal notranslate"><span class="pre">DefaultObject<
<p>First reload the server as usual. We will need to create the dragon a little differently this time:</p>
<aside class="sidebar">
<p class="sidebar-title">Keyword arguments</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Keyword arguments (like `db_key=&quot;Smaug&quot;`) is a way to
name the input arguments to a function or method. They make
things easier to read but also allows for conveniently setting
defaults for values not given explicitly.
</pre></div>
</div>
<p>Keyword arguments (like <code class="docutils literal notranslate"><span class="pre">db_key=&quot;Smaug&quot;</span></code>) is a way to name the input arguments to a function or method. They make things easier to read but also allows for conveniently setting defaults for values not given explicitly.</p>
</aside>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; py
&gt; from typeclasses.monsters import Dragon
@ -412,12 +407,7 @@ in <a class="reference external" href="https://github.com/evennia/evennia/blob/m
with the name <code class="docutils literal notranslate"><span class="pre">BASE_OBJECT_TYPECLASS</span></code>, which is set to <code class="docutils literal notranslate"><span class="pre">typeclasses.objects.Object</span></code>.</p>
<aside class="sidebar">
<p class="sidebar-title">Changing things</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>While it&#39;s tempting to change folders around to your liking, this can
make it harder to follow tutorials and may confuse if
you are asking others for help. So don&#39;t overdo it unless you really
know what you are doing.
</pre></div>
</div>
<p>While its tempting to change folders around to your liking, this can make it harder to follow tutorials and may confuse if you are asking others for help. So dont overdo it unless you really know what you are doing.</p>
</aside>
<p>So if you wanted the creation commands and methods to default to some other class you could
add your own <code class="docutils literal notranslate"><span class="pre">BASE_OBJECT_TYPECLASS</span></code> line to <code class="docutils literal notranslate"><span class="pre">mygame/server/conf/settings.py</span></code>. The same is true for all the other
@ -508,10 +498,10 @@ So if we modify this class well also modify ourselves.</p>
</div>
<aside class="sidebar">
<p class="sidebar-title">Tuples and lists</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>- A `list` is written `[a, b, c, d, ...]`. It can be modified after creation.
- A `tuple` is written `(a, b, c, ...)`. It cannot be modified once created.
</pre></div>
</div>
<ul class="simple">
<li><p>A <code class="docutils literal notranslate"><span class="pre">list</span></code> is written <code class="docutils literal notranslate"><span class="pre">[a,</span> <span class="pre">b,</span> <span class="pre">c,</span> <span class="pre">d,</span> <span class="pre">...]</span></code>. It can be modified after creation.</p></li>
<li><p>A <code class="docutils literal notranslate"><span class="pre">tuple</span></code> is written <code class="docutils literal notranslate"><span class="pre">(a,</span> <span class="pre">b,</span> <span class="pre">c,</span> <span class="pre">...)</span></code>. It cannot be modified once created.</p></li>
</ul>
</aside>
<p>We made a new method, gave it a docstring and had it <code class="docutils literal notranslate"><span class="pre">return</span></code> the RP-esque values we set. It comes back as a
<em>tuple</em> <code class="docutils literal notranslate"><span class="pre">(10,</span> <span class="pre">12,</span> <span class="pre">15)</span></code>. To get a specific value you could specify the <em>index</em> of the value you want,
@ -567,11 +557,7 @@ same <code class="docutils literal notranslate"><span class="pre">str</span></co
</div>
<aside class="sidebar">
<p class="sidebar-title">Spaces in Attribute name?</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>What if you want spaces in your Attribute name? Or you want to assign the
name of the Attribute on-the fly? Then you can use `.attributes.add(name, value)` instead,
for example `self.attributes.add(&quot;str&quot;, 10)`.
</pre></div>
</div>
<p>What if you want spaces in your Attribute name? Or you want to assign the name of the Attribute on-the fly? Then you can use <code class="docutils literal notranslate"><span class="pre">.attributes.add(name,</span> <span class="pre">value)</span></code> instead, for example <code class="docutils literal notranslate"><span class="pre">self.attributes.add(&quot;str&quot;,</span> <span class="pre">10)</span></code>.</p>
</aside>
<p>We removed the hard-coded stats and added added <code class="docutils literal notranslate"><span class="pre">.db</span></code> for every stat. The <code class="docutils literal notranslate"><span class="pre">.db</span></code> handler makes the stat
into an an Evennia <code class="docutils literal notranslate"><span class="pre">Attribute</span></code>.</p>
@ -620,12 +606,7 @@ in more detail. For now, lets give every new character some random stats to s
is called <code class="docutils literal notranslate"><span class="pre">at_object_creation</span></code>.</p>
<aside class="sidebar">
<p class="sidebar-title"><strong>init</strong> vs at_object_creation</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>For the `Monster` class we used `__init__` to set up the class. We can&#39;t use this
for a typeclass because it will be called more than once, at the very least after
every reload and maybe more depending on caching. Even if you are familiar with Python,
avoid touching `__init__` for typeclasses, the results will not be what you expect.
</pre></div>
</div>
<p>For the <code class="docutils literal notranslate"><span class="pre">Monster</span></code> class we used <code class="docutils literal notranslate"><span class="pre">__init__</span></code> to set up the class. We cant use this for a typeclass because it will be called more than once, at the very least after every reload and maybe more depending on caching. Even if you are familiar with Python, avoid touching <code class="docutils literal notranslate"><span class="pre">__init__</span></code> for typeclasses, the results will not be what you expect.</p>
</aside>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># up by the other imports</span>
<span class="kn">import</span> <span class="nn">random</span>
@ -695,13 +676,7 @@ this is done (still in python multi-line mode):</p>
</div>
<aside class="sidebar">
<p class="sidebar-title">Database queries</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>`Character.objects.all()` is an example of a database query expressed in Python. This will be converted
into a database query under the hood. This syntax is part of
`Django&#39;s query language &lt;https://docs.djangoproject.com/en/3.0/topics/db/queries/&gt;`_. You don&#39;t need to
know Django to use Evennia, but if you ever need more specific database queries, this is always available
when you need it.
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">Character.objects.all()</span></code> is an example of a database query expressed in Python. This will be converted into a database query under the hood. This syntax is part of <a class="reference external" href="https://docs.djangoproject.com/en/4.1/topics/db/queries/">Djangos query language</a>. You dont need to know Django to use Evennia, but if you ever need more specific database queries, this is always available when you need it.</p>
</aside>
<p>We import the <code class="docutils literal notranslate"><span class="pre">Character</span></code> class and then we use <code class="docutils literal notranslate"><span class="pre">.objects.all()</span></code> to get all <code class="docutils literal notranslate"><span class="pre">Character</span></code> instances. Simplified,
<code class="docutils literal notranslate"><span class="pre">.objects</span></code> is a resource from which one can <em>query</em> for all <code class="docutils literal notranslate"><span class="pre">Characters</span></code>. Using <code class="docutils literal notranslate"><span class="pre">.all()</span></code> gets us a listing

View file

@ -187,10 +187,10 @@ your parsing - if you wanted some other Command to also understand input on the
from this class and just implement the <code class="docutils literal notranslate"><span class="pre">func</span></code> needed for that command without implementing <code class="docutils literal notranslate"><span class="pre">parse</span></code> anew.</p>
<aside class="sidebar">
<p class="sidebar-title">Tuples and Lists</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>- A `list` is written as `[a, b, c, d, ...]`. You can add and grow/shrink a list after it was first created.
- A `tuple` is written as `(a, b, c, d, ...)`. A tuple cannot be modified once it is created.
</pre></div>
</div>
<ul class="simple">
<li><p>A <code class="docutils literal notranslate"><span class="pre">list</span></code> is written as <code class="docutils literal notranslate"><span class="pre">[a,</span> <span class="pre">b,</span> <span class="pre">c,</span> <span class="pre">d,</span> <span class="pre">...]</span></code>. You can add and grow/shrink a list after it was first created.</p></li>
<li><p>A <code class="docutils literal notranslate"><span class="pre">tuple</span></code> is written as <code class="docutils literal notranslate"><span class="pre">(a,</span> <span class="pre">b,</span> <span class="pre">c,</span> <span class="pre">d,</span> <span class="pre">...)</span></code>. A tuple cannot be modified once it is created.</p></li>
</ul>
</aside>
<ul>
<li><p><strong>Line 14</strong> - We do the stripping of <code class="docutils literal notranslate"><span class="pre">self.args</span></code> once and for all here. We also store the stripped version back
@ -282,14 +282,7 @@ hit-2
</div>
<aside class="sidebar">
<p class="sidebar-title">Multi-matches</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Some game engines will just pick the first hit when finding more than one.
Evennia will always give you a choice. The reason for this is that Evennia
cannot know if `hit` and `hit` are different or the same - maybe it behaves
differently depending on the object it sits on? Besides, imagine if you had
a red and a blue button both with the command `push` on it. Now you just write
`push`. Wouldn&#39;t you prefer to be asked `which` button you really wanted to push?
</pre></div>
</div>
<p>Some game engines will just pick the first hit when finding more than one. Evennia will always give you a choice. The reason for this is that Evennia cannot know if <code class="docutils literal notranslate"><span class="pre">hit</span></code> and <code class="docutils literal notranslate"><span class="pre">hit</span></code> are different or the same - maybe it behaves differently depending on the object it sits on? Besides, imagine if you had a red and a blue button both with the command <code class="docutils literal notranslate"><span class="pre">push</span></code> on it. Now you just write <code class="docutils literal notranslate"><span class="pre">push</span></code>. Wouldnt you prefer to be asked <code class="docutils literal notranslate"><span class="pre">which</span></code> button you really wanted to push?</p>
</aside>
<p>Woah, that didnt go as planned. Evennia actually found <em>two</em> <code class="docutils literal notranslate"><span class="pre">hit</span></code> commands to didnt know which one to use
(<em>we</em> know they are the same, but Evennia cant be sure of that). As we can see, <code class="docutils literal notranslate"><span class="pre">hit-1</span></code> is the one found on
@ -328,12 +321,7 @@ for limiting the kind of things you can do with an object, including limiting ju
it.</p>
<aside class="sidebar">
<p class="sidebar-title">Locks</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Evennia Locks are defined as a mini-language defined in `lockstrings`. The lockstring
is on a form `&lt;situation&gt;:&lt;lockfuncs&gt;`, where `situation` determines when this
lock applies and the `lockfuncs` (there can be more than one) are run to determine
if the lock-check passes or not depending on circumstance.
</pre></div>
</div>
<p>Evennia Locks are defined as a mini-language defined in <code class="docutils literal notranslate"><span class="pre">lockstrings</span></code>. The lockstring is on a form <code class="docutils literal notranslate"><span class="pre">&lt;situation&gt;:&lt;lockfuncs&gt;</span></code>, where <code class="docutils literal notranslate"><span class="pre">situation</span></code> determines when this lock applies and the <code class="docutils literal notranslate"><span class="pre">lockfuncs</span></code> (there can be more than one) are run to determine if the lock-check passes or not depending on circumstance.</p>
</aside>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; py self.search(&quot;sword&quot;).locks.add(&quot;call:holds()&quot;)
</pre></div>
@ -344,12 +332,7 @@ this object if you are <em>holding</em> the object (that is, its in your inve
first:</p>
<aside class="sidebar">
<p class="sidebar-title">quell/unquell</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Quelling allows you as a developer to take on the role of players with less
priveleges. This is useful for testing and debugging, in particular since a
superuser has a little `too` much power sometimes.
Use `unquell` to get back to your normal self.
</pre></div>
</div>
<p>Quelling allows you as a developer to take on the role of players with less priveleges. This is useful for testing and debugging, in particular since a superuser has a little <code class="docutils literal notranslate"><span class="pre">too</span></code> much power sometimes. Use <code class="docutils literal notranslate"><span class="pre">unquell</span></code> to get back to your normal self.</p>
</aside>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; quell
</pre></div>
@ -440,10 +423,7 @@ All these commands are in just loaded on the default objects that Evennia provid
</div>
<aside class="sidebar">
<p class="sidebar-title">super()</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>The `super()` function refers to the parent of the current class and is commonly
used to call same-named methods on the parent.
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">super()</span></code> function refers to the parent of the current class and is commonly used to call same-named methods on the parent.</p>
</aside>
<p><code class="docutils literal notranslate"><span class="pre">evennia.default_cmds</span></code> is a container that holds all of Evennias default commands and cmdsets. In this module
we can see that this was imported and then a new child class was made for each cmdset. Each class looks familiar
@ -585,11 +565,7 @@ has a special function <code class="docutils literal notranslate"><span class="p
</div>
<aside class="sidebar">
<p class="sidebar-title">Another way</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Instead of adding `MyCmdGet` explicitly in default_cmdset.py,
you could also add it to `mycommands.MyCmdSet` and let it be
added automatically for you.
</pre></div>
</div>
<p>Instead of adding <code class="docutils literal notranslate"><span class="pre">MyCmdGet</span></code> explicitly in default_cmdset.py, you could also add it to <code class="docutils literal notranslate"><span class="pre">mycommands.MyCmdSet</span></code> and let it be added automatically here for you.</p>
</aside>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; reload
&gt; get

View file

@ -108,20 +108,20 @@
<h1>Part 1: What we have<a class="headerlink" href="#part-1-what-we-have" title="Permalink to this headline"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">Beginner Tutorial Parts</p>
<dl class="simple">
<dt><a class="reference external" href="../Beginner-Tutorial-Intro.html">Introduction</a></dt><dd><p>Getting set up.</p>
</dd>
<dt><strong>Part 1: What we have</strong></dt><dd><p>A tour of Evennia and how to use the tools, including an introduction to Python.</p>
</dd>
<dt>Part 2: <a class="reference external" href="../Part2/Beginner-Tutorial-Part2-Intro.html">What we want</a></dt><dd><p>Planning our tutorial game and what to think about when planning your own in the future.</p>
</dd>
<dt>Part 3: <a class="reference external" href="../Part3/Beginner-Tutorial-Part3-Intro.html">How we get there</a></dt><dd><p>Getting down to the meat of extending Evennia to make our game</p>
</dd>
<dt>Part 4: <a class="reference external" href="../Part4/Beginner-Tutorial-Part4-Intro.html">Using what we created</a></dt><dd><p>Building a tech-demo and world content to go with our code</p>
</dd>
<dt>Part 5: <a class="reference external" href="../Part5/Beginner-Tutorial-Part5-Intro.html">Showing the world</a></dt><dd><p>Taking our new game online and let players try it out</p>
</dd>
</dl>
<ul class="simple">
<li><p><a class="reference internal" href="../Beginner-Tutorial-Intro.html"><span class="doc std std-doc">Introduction</span></a>
<br>Getting set up.</p></li>
<li><p>Part 1: <strong><a class="reference internal" href="#"><span class="doc std std-doc">What we have</span></a></strong>
<br>A tour of Evennia and how to use the tools, including an introduction to Python.</p></li>
<li><p>Part 2: <a class="reference internal" href="../Part2/Beginner-Tutorial-Part2-Intro.html"><span class="doc std std-doc">What we want</span></a>
<br>Planning our tutorial game and what to think about when planning your own in the future.</p></li>
<li><p>Part 3: <a class="reference internal" href="../Part3/Beginner-Tutorial-Part3-Intro.html"><span class="doc std std-doc">How we get there</span></a>
<br>Getting down to the meat of extending Evennia to make our game</p></li>
<li><p>Part 4: <a class="reference internal" href="../Part4/Beginner-Tutorial-Part4-Intro.html"><span class="doc std std-doc">Using what we created</span></a>
<br>Building a tech-demo and world content to go with our code</p></li>
<li><p>Part 5: <a class="reference internal" href="../Part5/Beginner-Tutorial-Part5-Intro.html"><span class="doc std std-doc">Showing the world</span></a>
<br>Taking our new game online and let players try it out</p></li>
</ul>
</aside>
<p>In this first part well focus on what we get out of the box in Evennia - well get used to the tools,
and how to find things we are looking for. We will also dive into some of things youll

View file

@ -195,13 +195,10 @@ This is a good idea!
</div>
<aside class="sidebar">
<p class="sidebar-title">Functions and Methods</p>
<dl class="simple">
<dt>Function:</dt><dd><p>Something that performs and action when you <cite>call</cite> it with zero or more <cite>arguments</cite>. A function
is stand-alone in a python module, like <cite>print()</cite></p>
</dd>
<dt>Method:</dt><dd><p>A function that sits “on” an object, like <cite>&lt;string&gt;.format()</cite>.</p>
</dd>
</dl>
<ul class="simple">
<li><p>Function: Something that performs and action when you <code class="docutils literal notranslate"><span class="pre">call</span></code> it with zero or more <code class="docutils literal notranslate"><span class="pre">arguments</span></code>. A function is stand-alone in a python module, like <code class="docutils literal notranslate"><span class="pre">print()</span></code></p></li>
<li><p>Method: A function that sits “on” an object, like <code class="docutils literal notranslate"><span class="pre">obj.msg()</span></code>.</p></li>
</ul>
</aside>
<p>A method can be thought of as a resource “on” another object. The method knows on which object it
sits and can thus affect it in various ways. You access it with the period <code class="docutils literal notranslate"><span class="pre">.</span></code>. In this case, the

View file

@ -145,13 +145,13 @@ not, make it so):</p>
</pre></div>
</div>
<aside class="sidebar">
<p class="sidebar-title">Remember:</p>
<p class="sidebar-title">Whitespace matters in Python!</p>
<ul class="simple">
<li><p>Indentation matters in Python</p></li>
<li><p>So does capitalization</p></li>
<li><p>Use 4 <cite>spaces</cite> to indent, not tabs</p></li>
<li><p>Use 4 <code class="docutils literal notranslate"><span class="pre">spaces</span></code> to indent, not tabs</p></li>
<li><p>Empty lines are fine</p></li>
<li><p>Anything on a line after a <cite>#</cite> is a <cite>comment</cite>, ignored by Python</p></li>
<li><p>Anything on a line after a <code class="docutils literal notranslate"><span class="pre">#</span></code> is a <code class="docutils literal notranslate"><span class="pre">comment</span></code>, ignored by Python</p></li>
</ul>
</aside>
<p>The <em>python_path</em> describes the relation between Python resources, both between and inside
@ -244,11 +244,7 @@ imports at the top, resources that are then used by all code in that module.</p>
</div>
<aside class="sidebar">
<p class="sidebar-title">Docstrings vs Comments</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>A docstring is not the same as a comment (created by `#`). A
docstring is not ignored by Python but is an integral part of the thing
it is documenting (the module and the class in this case).
</pre></div>
</div>
<p>A docstring is not the same as a comment (created by <code class="docutils literal notranslate"><span class="pre">#</span></code>). A docstring is not ignored by Python but is an integral part of the thing it is documenting (the module and the class in this case).</p>
</aside>
<p>The real file is much longer but we can ignore the multi-line strings (<code class="docutils literal notranslate"><span class="pre">&quot;&quot;&quot;</span> <span class="pre">...</span> <span class="pre">&quot;&quot;&quot;</span></code>). These serve
as documentation-strings, or <em>docstrings</em> for the module (at the top) and the <code class="docutils literal notranslate"><span class="pre">class</span></code> below.</p>
@ -263,10 +259,7 @@ little detour to understand what a class, an object or instance
things to understand before you can use Evennia efficiently.</p>
<aside class="sidebar">
<p class="sidebar-title">OOP</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Classes, objects, instances and inheritance are fundamental to Python. This and some
other concepts are often clumped together under the term Object-Oriented-Programming (OOP).
</pre></div>
</div>
<p>Classes, objects, instances and inheritance are fundamental to Python. This and some other concepts are often clumped together under the term Object-Oriented-Programming (OOP).</p>
</aside>
<section id="classes-and-instances">
<h3><span class="section-number">5.2.1. </span>Classes and instances<a class="headerlink" href="#classes-and-instances" title="Permalink to this headline"></a></h3>
@ -292,8 +285,8 @@ back to the <code class="docutils literal notranslate"><span class="pre">key</sp
<aside class="sidebar">
<p class="sidebar-title">Terms</p>
<ul class="simple">
<li><p>A <cite>class</cite> is a code template describing a type of something</p></li>
<li><p>An <cite>object</cite> is an <cite>instance</cite> of a <cite>class</cite>. Like using a mold to cast tin soldiers, one class can be <cite>instantiated</cite> into any number of object-instances.</p></li>
<li><p>A <code class="docutils literal notranslate"><span class="pre">class</span></code> is a code template describing a type of something</p></li>
<li><p>An <code class="docutils literal notranslate"><span class="pre">object</span></code> is an <code class="docutils literal notranslate"><span class="pre">instance</span></code> of a <code class="docutils literal notranslate"><span class="pre">class</span></code>. Like using a mold to cast in soldiers, one class can be <code class="docutils literal notranslate"><span class="pre">instantiated</span></code> into any number of object-instances.</p></li>
</ul>
</aside>
<p>A class is just a template. Before it can be used, we must create an <em>instance</em> of the class. If
@ -350,12 +343,7 @@ Python Console is closing.
<p>Or you can use a separate terminal and restart from outside the game:</p>
<aside class="sidebar">
<p class="sidebar-title">On reloading</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Reloading with the python mode gets a little annoying since you need to redo everything
after every reload. Just keep in mind that during regular development you will not be
working this way. The in-game python mode is practical for quick fixes and experiments like
this, but actual code is normally written externally, in python modules.
</pre></div>
</div>
<p>Reloading with the python mode gets a little annoying since you need to redo everything after every reload. Just keep in mind that during regular development you will not be working this way. The in-game python mode is practical for quick fixes and experiments like this, but actual code is normally written externally, in python modules.</p>
</aside>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ evennia reload (or restart)
</pre></div>
@ -441,11 +429,7 @@ as exemplified for the new <code class="docutils literal notranslate"><span clas
the parent in parenthesis. <code class="docutils literal notranslate"><span class="pre">class</span> <span class="pre">Classname(Parent)</span></code> is the way to do this.</p>
<aside class="sidebar">
<p class="sidebar-title">Multi-inheritance</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>It&#39;s possible to add more comma-separated parents to a class. You should usually avoid
this until you `really` know what you are doing. A single parent will be enough for almost
every case you&#39;ll need.
</pre></div>
</div>
<p>Its possible to add more comma-separated parents to a class. You should usually avoid this until you <code class="docutils literal notranslate"><span class="pre">really</span></code> know what you are doing. A single parent will be enough for almost every case youll need.</p>
</aside>
<p>Lets try out our new class. First <code class="docutils literal notranslate"><span class="pre">reload</span></code> the server and the do</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; py

View file

@ -130,11 +130,7 @@ if we cannot find and use it afterwards.</p>
</div>
<aside class="sidebar">
<p class="sidebar-title">Querysets</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>What is returned from the main search functions is actually a `queryset`. They can be
treated like lists except that they can&#39;t modified in-place. We&#39;ll discuss querysets in
the `next lesson` &lt;Django-queries&gt;`_.
</pre></div>
</div>
<p>What is returned from the main search functions is actually a <code class="docutils literal notranslate"><span class="pre">queryset</span></code>. They can be treated like lists except that they cant modified in-place. Well discuss querysets in the <code class="docutils literal notranslate"><span class="pre">next</span> <span class="pre">lesson</span></code> <Django-queries>`_.</p>
</aside>
<p>Strings are always case-insensitive, so searching for <code class="docutils literal notranslate"><span class="pre">&quot;rose&quot;</span></code>, <code class="docutils literal notranslate"><span class="pre">&quot;Rose&quot;</span></code> or <code class="docutils literal notranslate"><span class="pre">&quot;rOsE&quot;</span></code> give the same results.
Its important to remember that what is returned from these search methods is a <em>listing</em> of 0, one or more

View file

@ -194,7 +194,7 @@ Either way you should now be back in Limbo, able to reflect on the experience.</
<p>If you have previous programming experience (or after you have gone
through this Starter tutorial) it may be instructive to dig a little deeper into the Tutorial-world
code to learn how it achieves what it does. The code is heavily documented.
You can find all the code in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.tutorial_world.html#evennia-contrib-tutorials-tutorial-world"><span class="std std-ref">evennia/contrib/tutorials/tutorial_world</span></a>.
You can find all the code in <a class="reference internal" href="../../../api/evennia.contrib.tutorials.tutorial_world.html"><span class="doc std std-doc">evennia/contrib/tutorials/tutorial_world</span></a>.
The build-script is <a class="reference external" href="https://github.com/evennia/evennia/blob/master/evennia/contrib/tutorials/tutorial_world/build.ev">here</a>.</p>
<p>When reading the code, remember that the Tutorial World was designed to install easily and to not permanently modify
the rest of the game. It therefore makes sure to only use temporary solutions and to clean up after itself. This is

View file

@ -243,12 +243,7 @@ release. Make a list. Keep future expansions in mind but limit yourself.</p>
build a little “tech demo” along the way.</p>
<aside class="sidebar">
<p class="sidebar-title">Tech demo</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>With &quot;tech demo&quot; we mean a small example of your code in-action: A room with a mob,
a way to jump into and test character-creation etc. The tech demo need not be pretty, it&#39;s
there to test functionality. It&#39;s not the beginning of your game world (unless you find that
to be more fun).
</pre></div>
</div>
<p>With “tech demo” we mean a small example of your code in-action: A room with a mob, a way to jump into and test character-creation etc. The tech demo need not be pretty, its there to test functionality. Its not the beginning of your game world (unless you find that to be more fun).</p>
</aside>
<p>Try to avoid going wild with building a huge game world before you have a tech-demo showing off all parts
you expect to have in the first version of your game. Otherwise you run the risk of having to redo it all

View file

@ -108,23 +108,22 @@
<h1>Part 2: What we want<a class="headerlink" href="#part-2-what-we-want" title="Permalink to this headline"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">Beginner Tutorial Parts</p>
<dl class="simple">
<dt><a class="reference external" href="../Beginner-Tutorial-Intro.html">Introduction</a></dt><dd><p>Getting set up.</p>
</dd>
<dt>Part 1: <a class="reference external" href="../Part1/Beginner-Tutorial-Part1-Intro.html">What we have</a></dt><dd><p>A tour of Evennia and how to use the tools, including an introduction to Python.</p>
</dd>
<dt><strong>Part 2: What we want</strong></dt><dd><p>Planning our tutorial game and what to think about when planning your own in the future.</p>
</dd>
<dt>Part 3: <a class="reference external" href="../Part3/Beginner-Tutorial-Part3-Intro.html">How we get there</a></dt><dd><p>Getting down to the meat of extending Evennia to make our game</p>
</dd>
<dt>Part 4: <a class="reference external" href="../Part4/Beginner-Tutorial-Part4-Intro.html">Using what we created</a></dt><dd><p>Building a tech-demo and world content to go with our code</p>
</dd>
<dt>Part 5: <a class="reference external" href="../Part5/Beginner-Tutorial-Part5-Intro.html">Showing the world</a></dt><dd><p>Taking our new game online and let players try it out</p>
</dd>
</dl>
<ul class="simple">
<li><p><a class="reference internal" href="../Beginner-Tutorial-Intro.html"><span class="doc std std-doc">Introduction</span></a>
<br>Getting set up.</p></li>
<li><p>Part 1: <a class="reference internal" href="../Part1/Beginner-Tutorial-Part1-Intro.html"><span class="doc std std-doc">What we have</span></a>
<br>A tour of Evennia and how to use the tools, including an introduction to Python.</p></li>
<li><p><strong>Part 2: <a class="reference internal" href="#"><span class="doc std std-doc">What we want</span></a></strong>
<br>Planning our tutorial game and what to think about when planning your own in the future.</p></li>
<li><p>Part 3: <a class="reference internal" href="../Part3/Beginner-Tutorial-Part3-Intro.html"><span class="doc std std-doc">How we get there</span></a>
<br>Getting down to the meat of extending Evennia to make our game</p></li>
<li><p>Part 4: <a class="reference internal" href="../Part4/Beginner-Tutorial-Part4-Intro.html"><span class="doc std std-doc">Using what we created</span></a>
<br>Building a tech-demo and world content to go with our code</p></li>
<li><p>Part 5: <a class="reference internal" href="../Part5/Beginner-Tutorial-Part5-Intro.html"><span class="doc std std-doc">Showing the world</span></a>
<br>Taking our new game online and let players try it out</p></li>
</ul>
</aside>
<p>In Part two of the Beginner Tutorial well take a step back and plan out the kind of tutorial
game we want to make. This is a more theoretical part where we wont do any hands-on
<p>In Part two of the Evennia Beginner Tutorial well take a step back and plan out the kind of tutorial game we want to make. This is a more theoretical part where we wont do any hands-on
programming.</p>
<p>In the process well go through the common questions of “where to start”
and “what to think about” when creating a multiplayer online text game.</p>

View file

@ -187,7 +187,7 @@ class to put it on. So instead well use the concept of a <em>mixin</em> class
</pre></div>
</div>
<aside class="sidebar">
<p>In <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.characters.html#evennia-contrib-tutorials-evadventure-characters"><span class="std std-ref">evennia/contrib/tutorials/evadventure/characters.py</span></a>
<p>In <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.characters.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/characters.py</span></a>
is an example of a character class structure.</p>
</aside>
<p>Above, the <code class="docutils literal notranslate"><span class="pre">LivingMixin</span></code> class cannot work on its own - it just patches the other classes with some

View file

@ -200,7 +200,7 @@ and youll leave the menu;</p>
<h2>Random tables<a class="headerlink" href="#random-tables" title="Permalink to this headline"></a></h2>
<aside class="sidebar">
<p>Full Knave random tables are found in
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.random_tables.html#evennia-contrib-tutorials-evadventure-random-tables"><span class="std std-ref">evennia/contrib/tutorials/evadventure/random_tables.py</span></a>.</p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.random_tables.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/random_tables.py</span></a>.</p>
</aside>
<blockquote>
<div><p>Make a new module <code class="docutils literal notranslate"><span class="pre">mygame/evadventure/random_tables.py</span></code>.</p>
@ -231,7 +231,7 @@ keep in here.</p>
<h2>Storing state of the menu<a class="headerlink" href="#storing-state-of-the-menu" title="Permalink to this headline"></a></h2>
<aside class="sidebar">
<p>There is a full implementation of the chargen in
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.chargen.html#evennia-contrib-tutorials-evadventure-chargen"><span class="std std-ref">evennia/contrib/tutorials/evadventure/chargen.py</span></a>.</p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.chargen.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/chargen.py</span></a>.</p>
</aside>
<blockquote>
<div><p>create a new module <code class="docutils literal notranslate"><span class="pre">mygame/evadventure/chargen.py</span></code>.</p>

View file

@ -618,7 +618,7 @@ can be added:</p>
<li><p>Get all usable items (items with a use-location of <code class="docutils literal notranslate"><span class="pre">BACKPACK</span></code>) from the backpack</p></li>
</ul>
<p>Experiment with adding those. A full example is found in
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.equipment.html#evennia-contrib-tutorials-evadventure-equipment"><span class="std std-ref">evennia/contrib/tutorials/evadventure/equipment.py</span></a>.</p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.equipment.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/equipment.py</span></a>.</p>
</section>
<section id="unit-testing">
<h2>Unit Testing<a class="headerlink" href="#unit-testing" title="Permalink to this headline"></a></h2>
@ -626,7 +626,7 @@ can be added:</p>
<div><p>Create a new module <code class="docutils literal notranslate"><span class="pre">mygame/evadventure/tests/test_equipment.py</span></code>.</p>
</div></blockquote>
<aside class="sidebar">
<p>See <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_equipment.html#evennia-contrib-tutorials-evadventure-tests-test-equipment"><span class="std std-ref">evennia/contrib/tutorials/evadventure/tests/test_equipment.py</span></a>
<p>See <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_equipment.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/tests/test_equipment.py</span></a>
for a finished testing example.</p>
</aside>
<p>To test the <code class="docutils literal notranslate"><span class="pre">EquipmentHandler</span></code>, easiest is create an <code class="docutils literal notranslate"><span class="pre">EvAdventureCharacter</span></code> (this should by now

View file

@ -167,7 +167,7 @@ Before we continue, lets expand with enums for use-slots and object types.</p
<div><p>Create a new module <code class="docutils literal notranslate"><span class="pre">mygame/evadventure/objects.py</span></code></p>
</div></blockquote>
<aside class="sidebar">
<p><a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.objects.html#evennia-contrib-tutorials-evadventure-objects"><span class="std std-ref">evennia/contrib/tutorials/evadventure/objects.py</span></a> has
<p><a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.objects.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/objects.py</span></a> has
a full set of objects implemented.</p>
</aside>
<div style="clear: right;"></div>

View file

@ -114,20 +114,20 @@ from it at this time.</p>
</div>
<aside class="sidebar">
<p class="sidebar-title">Beginner Tutorial Parts</p>
<dl class="simple">
<dt><a class="reference external" href="../Beginner-Tutorial-Intro.html">Introduction</a></dt><dd><p>Getting set up.</p>
</dd>
<dt>Part 1: <a class="reference external" href="../Part1/Beginner-Tutorial-Part1-Intro.html">What we have</a></dt><dd><p>A tour of Evennia and how to use the tools, including an introduction to Python.</p>
</dd>
<dt>Part 2: <a class="reference external" href="../Part2/Beginner-Tutorial-Part2-Intro.html">What we want</a></dt><dd><p>Planning our tutorial game and what to think about when planning your own in the future.</p>
</dd>
<dt><strong>Part 3: How we get there</strong></dt><dd><p>Getting down to the meat of extending Evennia to make our game</p>
</dd>
<dt>Part 4: <a class="reference external" href="../Part4/Beginner-Tutorial-Part4-Intro.html">Using what we created</a></dt><dd><p>Building a tech-demo and world content to go with our code</p>
</dd>
<dt>Part 5: <a class="reference external" href="../Part5/Beginner-Tutorial-Part5-Intro.html">Showing the world</a></dt><dd><p>Taking our new game online and let players try it out</p>
</dd>
</dl>
<ul class="simple">
<li><p><a class="reference internal" href="../Beginner-Tutorial-Intro.html"><span class="doc std std-doc">Introduction</span></a>
<br>Getting set up.</p></li>
<li><p>Part 1: <a class="reference internal" href="../Part1/Beginner-Tutorial-Part1-Intro.html"><span class="doc std std-doc">What we have</span></a>
<br>A tour of Evennia and how to use the tools, including an introduction to Python.</p></li>
<li><p>Part 2: <a class="reference internal" href="../Part2/Beginner-Tutorial-Part2-Intro.html"><span class="doc std std-doc">What we want</span></a>
<br>Planning our tutorial game and what to think about when planning your own in the future.</p></li>
<li><p><strong>Part 3: <a class="reference internal" href="#"><span class="doc std std-doc">How we get there</span></a></strong>
<br>Getting down to the meat of extending Evennia to make our game</p></li>
<li><p>Part 4: <a class="reference internal" href="../Part4/Beginner-Tutorial-Part4-Intro.html"><span class="doc std std-doc">Using what we created</span></a>
<br>Building a tech-demo and world content to go with our code</p></li>
<li><p>Part 5: <a class="reference internal" href="../Part5/Beginner-Tutorial-Part5-Intro.html"><span class="doc std std-doc">Showing the world</span></a>
<br>Taking our new game online and let players try it out</p></li>
</ul>
</aside>
<p>In part three of the Evennia Beginner tutorial we will go through the actual creation of
our tutorial game <em>EvAdventure</em>, based on the <a class="reference external" href="https://www.drivethrurpg.com/product/250888/Knave">Knave</a>
@ -140,7 +140,7 @@ create.</p>
<p>Even if this is not the game-style you are interested in, following along will give you a lot
of experience using Evennia and be really helpful for doing your own thing later!</p>
<p>Fully coded examples of all code we make in this part can be found in the
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.html#evennia-contrib-tutorials-evadventure"><span class="std std-ref">evennia/contrib/tutorials/evadventure</span></a> package.</p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure</span></a> package.</p>
<section id="lessons">
<h2>Lessons<a class="headerlink" href="#lessons" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">

View file

@ -169,7 +169,7 @@ hitting 0. Death, if it happens, is permanent.</p></li>
</div></blockquote>
<aside class="sidebar">
<p>A complete version of the rule module is found in
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.rules.html#evennia-contrib-tutorials-evadventure-rules"><span class="std std-ref">evennia/contrib/tutorials/evadventure/rules.py</span></a>.</p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.rules.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/rules.py</span></a>.</p>
</aside>
<p>There are three broad sets of rules for most RPGS:</p>
<ul class="simple">
@ -726,7 +726,7 @@ character!</p>
<section id="mocking-and-patching">
<h3>Mocking and patching<a class="headerlink" href="#mocking-and-patching" title="Permalink to this headline"></a></h3>
<aside class="sidebar">
<p>In <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_rules.html#evennia-contrib-tutorials-evadventure-tests-test-rules"><span class="std std-ref">evennia/contrib/tutorials/evadventure/tests/test_rules.py</span></a>
<p>In <a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.tests.test_rules.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/tests/test_rules.py</span></a>
has a complete example of rule testing.</p>
</aside>
<p>The <code class="docutils literal notranslate"><span class="pre">setUp</span></code> method is a special method of the testing class. It will be run before every

View file

@ -156,7 +156,7 @@ folders into packages Python understands to import from.</p>
<h2>Enums<a class="headerlink" href="#enums" title="Permalink to this headline"></a></h2>
<aside class="sidebar">
<p>A full example of the enum module is found in
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.enums.html#evennia-contrib-tutorials-evadventure-enums"><span class="std std-ref">evennia/contrib/tutorials/evadventure/enums.py</span></a>.</p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.enums.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/enums.py</span></a>.</p>
</aside>
<p>Create a new file <code class="docutils literal notranslate"><span class="pre">mygame/evadventure/enums.py</span></code>.</p>
<p>An <a class="reference external" href="https://docs.python.org/3/library/enum.html">enum</a> (enumeration) is a way to establish constants
@ -231,7 +231,7 @@ likely gradually expand on your enums as you figure out what youll need).</p>
</div></blockquote>
<aside class="sidebar">
<p>An example of the utility module is found in
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.utils.html#evennia-contrib-tutorials-evadventure-utils"><span class="std std-ref">evennia/contrib/tutorials/evadventure/utils.py</span></a></p>
<a class="reference internal" href="../../../api/evennia.contrib.tutorials.evadventure.utils.html"><span class="doc std std-doc">evennia/contrib/tutorials/evadventure/utils.py</span></a></p>
</aside>
<p>This is for general functions we may need from all over. In this case we only picture one utility,
a function that produces a pretty display of any object we pass to it.</p>

View file

@ -106,23 +106,23 @@
<section class="tex2jax_ignore mathjax_ignore" id="part-4-using-what-we-created">
<h1>Part 4: Using what we created<a class="headerlink" href="#part-4-using-what-we-created" title="Permalink to this headline"></a></h1>
<p>..sidebar:: Beginner Tutorial Parts</p>
<blockquote>
<div><dl class="simple">
<dt><a class="reference external" href="../Beginner-Tutorial-Intro.html">Introduction</a></dt><dd><p>Getting set up.</p>
</dd>
<dt>Part 1: <a class="reference external" href="../Part1/Beginner-Tutorial-Part1-Intro.html">What we have</a></dt><dd><p>A tour of Evennia and how to use the tools, including an introduction to Python.</p>
</dd>
<dt>Part 2: <a class="reference external" href="../Part2/Beginner-Tutorial-Part2-Intro.html">What we want</a></dt><dd><p>Planning our tutorial game and what to think about when planning your own in the future.</p>
</dd>
<dt>Part 3: <a class="reference external" href="../Part3/Beginner-Tutorial-Part3-Intro.html">How we get there</a></dt><dd><p>Getting down to the meat of extending Evennia to make our game to make a tech-demo</p>
</dd>
<dt><strong>Part 4: Using what we created</strong></dt><dd><p>Using the tech-demo and world content to go with our code</p>
</dd>
<dt>Part 5: <a class="reference external" href="../Part5/Beginner-Tutorial-Part5-Intro.html">Showing the world</a></dt><dd><p>Taking our new game online and let players try it out</p>
</dd>
</dl>
</div></blockquote>
<aside class="sidebar">
<p class="sidebar-title">Beginner Tutorial Parts</p>
<ul class="simple">
<li><p><a class="reference internal" href="../Beginner-Tutorial-Intro.html"><span class="doc std std-doc">Introduction</span></a>
<br>Getting set up.</p></li>
<li><p>Part 1: <a class="reference internal" href="../Part1/Beginner-Tutorial-Part1-Intro.html"><span class="doc std std-doc">What we have</span></a>
<br>A tour of Evennia and how to use the tools, including an introduction to Python.</p></li>
<li><p>Part 2: <a class="reference internal" href="../Part2/Beginner-Tutorial-Part2-Intro.html"><span class="doc std std-doc">What we want</span></a>
<br>Planning our tutorial game and what to think about when planning your own in the future.</p></li>
<li><p>Part 3: <a class="reference internal" href="../Part3/Beginner-Tutorial-Part3-Intro.html"><span class="doc std std-doc">How we get there</span></a>
<br>Getting down to the meat of extending Evennia to make our game</p></li>
<li><p><strong>Part 4: <a class="reference internal" href="#"><span class="doc std std-doc">Using what we created</span></a></strong>
<br>Building a tech-demo and world content to go with our code</p></li>
<li><p>Part 5: <a class="reference internal" href="../Part5/Beginner-Tutorial-Part5-Intro.html"><span class="doc std std-doc">Showing the world</span></a>
<br>Taking our new game online and let players try it out</p></li>
</ul>
</aside>
<p>We now have the code underpinnings of everything we need. We have also tested the various components
and has a simple tech-demo to show it all works together. But there is no real coherence to it at this
point - we need to actually make a world.

View file

@ -108,20 +108,20 @@
<h1>Part 5: Showing the world<a class="headerlink" href="#part-5-showing-the-world" title="Permalink to this headline"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">Beginner Tutorial Parts</p>
<dl class="simple">
<dt><a class="reference external" href="../Beginner-Tutorial-Intro.html">Introduction</a></dt><dd><p>Getting set up.</p>
</dd>
<dt>Part 1: <a class="reference external" href="../Part1/Beginner-Tutorial-Part1-Intro.html">What we have</a></dt><dd><p>A tour of Evennia and how to use the tools, including an introduction to Python.</p>
</dd>
<dt>Part 2: <a class="reference external" href="../Part2/Beginner-Tutorial-Part2-Intro.html">What we want</a></dt><dd><p>Planning our tutorial game and what to think about when planning your own in the future.</p>
</dd>
<dt>Part 3: <a class="reference external" href="../Part3/Beginner-Tutorial-Part3-Intro.html">How we get there</a></dt><dd><p>Getting down to the meat of extending Evennia to make our game</p>
</dd>
<dt>Part 4: <a class="reference external" href="../Part4/Beginner-Tutorial-Part4-Intro.html">Using what we created</a></dt><dd><p>Building a tech-demo and world content to go with our code</p>
</dd>
<dt><strong>Part 5: Showing the world</strong></dt><dd><p>Taking our new game online and let players try it out</p>
</dd>
</dl>
<ul class="simple">
<li><p><a class="reference internal" href="../Beginner-Tutorial-Intro.html"><span class="doc std std-doc">Introduction</span></a>
<br>Getting set up.</p></li>
<li><p>Part 1: <a class="reference internal" href="../Part1/Beginner-Tutorial-Part1-Intro.html"><span class="doc std std-doc">What we have</span></a>
<br>A tour of Evennia and how to use the tools, including an introduction to Python.</p></li>
<li><p>Part 2: <a class="reference internal" href="../Part2/Beginner-Tutorial-Part2-Intro.html"><span class="doc std std-doc">What we want</span></a>
<br>Planning our tutorial game and what to think about when planning your own in the future.</p></li>
<li><p>Part 3: <a class="reference internal" href="../Part3/Beginner-Tutorial-Part3-Intro.html"><span class="doc std std-doc">How we get there</span></a>
<br>Getting down to the meat of extending Evennia to make our game</p></li>
<li><p>Part 4: <a class="reference internal" href="../Part4/Beginner-Tutorial-Part4-Intro.html"><span class="doc std std-doc">Using what we created</span></a>
<br>Building a tech-demo and world content to go with our code</p></li>
<li><p><strong>Part 5: <a class="reference internal" href="#"><span class="doc std std-doc">Showing the world</span></a></strong>
<br>Taking our new game online and let players try it out</p></li>
</ul>
</aside>
<p>You have a working game! In part five we will look at the web-components of Evennia and how to modify them
to fit your game. We will also look at hosting your game and if you feel up to it well also go through how