mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 05:46:31 +01:00
375 lines
No EOL
32 KiB
HTML
375 lines
No EOL
32 KiB
HTML
|
||
<!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>1. Using Commands and Building Stuff — Evennia latest 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="2. The Tutorial World" href="Beginner-Tutorial-Tutorial-World.html" />
|
||
<link rel="prev" title="Part 1: What We Have" href="Beginner-Tutorial-Part1-Overview.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="Beginner-Tutorial-Tutorial-World.html" title="2. The Tutorial World"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Beginner-Tutorial-Part1-Overview.html" title="Part 1: What We Have"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../../../index.html">Evennia latest</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="../../Howtos-Overview.html" >Tutorials and How-To’s</a> »</li>
|
||
<li class="nav-item nav-item-2"><a href="../Beginner-Tutorial-Overview.html" >Beginner Tutorial</a> »</li>
|
||
<li class="nav-item nav-item-3"><a href="Beginner-Tutorial-Part1-Overview.html" accesskey="U">Part 1: What We Have</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href=""><span class="section-number">1. </span>Using Commands and Building Stuff</a></li>
|
||
</ul>
|
||
</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="#">1. Using Commands and Building Stuff</a><ul>
|
||
<li><a class="reference internal" href="#getting-help">1.1. Getting Help</a></li>
|
||
<li><a class="reference internal" href="#looking-around">1.2. Looking Around</a></li>
|
||
<li><a class="reference internal" href="#stepping-down-from-godhood">1.3. Stepping Down from Godhood</a></li>
|
||
<li><a class="reference internal" href="#creating-an-object">1.4. Creating an Object</a></li>
|
||
<li><a class="reference internal" href="#get-a-personality">1.5. Get a Personality</a></li>
|
||
<li><a class="reference internal" href="#pushing-your-buttons">1.6. Pushing Your Buttons</a></li>
|
||
<li><a class="reference internal" href="#making-yourself-a-house">1.7. Making Yourself a House</a></li>
|
||
<li><a class="reference internal" href="#reshuffling-the-world">1.8. Reshuffling the World</a></li>
|
||
<li><a class="reference internal" href="#adding-a-help-entry">1.9. Adding a Help Entry</a></li>
|
||
<li><a class="reference internal" href="#adding-a-world">1.10. Adding a World</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="Beginner-Tutorial-Part1-Overview.html"
|
||
title="previous chapter">Part 1: What We Have</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="Beginner-Tutorial-Tutorial-World.html"
|
||
title="next chapter"><span class="section-number">2. </span>The Tutorial World</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../../../_sources/Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Building-Quickstart.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com/docs/latest/index.html">Documentation Top</a> </li>
|
||
<li><a href="https://www.evennia.com">Evennia Home</a> </li>
|
||
<li><a href="https://github.com/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>
|
||
</div>
|
||
</div>
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section class="tex2jax_ignore mathjax_ignore" id="using-commands-and-building-stuff">
|
||
<h1><span class="section-number">1. </span>Using Commands and Building Stuff<a class="headerlink" href="#using-commands-and-building-stuff" title="Permalink to this headline">¶</a></h1>
|
||
<p>In this lesson, we will test out what we can do in-game out-of-the-box. Evennia ships with
|
||
<a class="reference internal" href="../../../Components/Default-Commands.html"><span class="doc std std-doc">around 90 default commands</span></a> and, while you can override those as you please, the defaults can be quite useful.</p>
|
||
<p>Connect and login to your new game. You will find yourself in the “Limbo” location. This
|
||
is the only room in the game at this point. Let’s explore the default commands a little.</p>
|
||
<p>The default commands have syntax <a class="reference internal" href="../../../Coding/Default-Command-Syntax.html"><span class="doc std std-doc">similar to MUX</span></a>:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> command[/switch/switch...] [arguments ...]
|
||
</pre></div>
|
||
</div>
|
||
<p>An example would be:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> create/drop box
|
||
</pre></div>
|
||
</div>
|
||
<p>A <em>/switch</em> is a special, optional flag to make a command behave differently. A switch is always put directly after the command name, and begins with a forward slash (<code class="docutils literal notranslate"><span class="pre">/</span></code>). The <em>arguments</em> are one or more inputs to the commands. It’s common to use an equal sign (<code class="docutils literal notranslate"><span class="pre">=</span></code>) when assigning something to an object.</p>
|
||
<blockquote>
|
||
<div><p>Are you used to commands starting with @, like @create? That will work, too. Evennia simply ignores the preceeding @.</p>
|
||
</div></blockquote>
|
||
<section id="getting-help">
|
||
<h2><span class="section-number">1.1. </span>Getting Help<a class="headerlink" href="#getting-help" title="Permalink to this headline">¶</a></h2>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>help
|
||
</pre></div>
|
||
</div>
|
||
<p>Will give you a list of all commands available to you. Use</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>help <commandname>
|
||
</pre></div>
|
||
</div>
|
||
<p>to see the in-game help for that command.</p>
|
||
</section>
|
||
<section id="looking-around">
|
||
<h2><span class="section-number">1.2. </span>Looking Around<a class="headerlink" href="#looking-around" title="Permalink to this headline">¶</a></h2>
|
||
<p>The most common command is</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>look
|
||
</pre></div>
|
||
</div>
|
||
<p>This will show you the description of the current location. <code class="docutils literal notranslate"><span class="pre">l</span></code> is an alias for the look command.</p>
|
||
<p>When targeting objects in commands, you have two special labels you can use: <code class="docutils literal notranslate"><span class="pre">here</span></code> for the current room, or <code class="docutils literal notranslate"><span class="pre">me</span></code>/<code class="docutils literal notranslate"><span class="pre">self</span></code> to point back to yourself. Thus,</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>look me
|
||
</pre></div>
|
||
</div>
|
||
<p>will give you your own description. <code class="docutils literal notranslate"><span class="pre">look</span> <span class="pre">here</span></code> is, in this case, the same as just plain <code class="docutils literal notranslate"><span class="pre">look</span></code>.</p>
|
||
</section>
|
||
<section id="stepping-down-from-godhood">
|
||
<h2><span class="section-number">1.3. </span>Stepping Down from Godhood<a class="headerlink" href="#stepping-down-from-godhood" title="Permalink to this headline">¶</a></h2>
|
||
<p>If you just installed Evennia, your very first player account is called user #1 — also known as the <em>superuser</em> or <em>god user</em>. This user is very powerful — so powerful that it will override many game restrictions (such as locks). This can be useful, but it also hides some functionality that you might want to test.</p>
|
||
<p>To step down temporarily from your superuser position, you may use the <code class="docutils literal notranslate"><span class="pre">quell</span></code> command in-game:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>quell
|
||
</pre></div>
|
||
</div>
|
||
<p>This will make you start using the permission of your current character’s level instead of your superuser level. If you didn’t change any settings, your initial game Character should have <em>Developer</em> level permission — as high as can be without bypassing locks like the superuser does. This will work fine for the examples on this page. Use</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>unquell
|
||
</pre></div>
|
||
</div>
|
||
<p>to get superuser status again when you are done.</p>
|
||
</section>
|
||
<section id="creating-an-object">
|
||
<h2><span class="section-number">1.4. </span>Creating an Object<a class="headerlink" href="#creating-an-object" title="Permalink to this headline">¶</a></h2>
|
||
<p>Basic objects can be anything — swords, flowers, and non-player characters. They are created using the <code class="docutils literal notranslate"><span class="pre">create</span></code> command. For example:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>create box
|
||
</pre></div>
|
||
</div>
|
||
<p>This creates a new ‘box’ (of the default object type) in your inventory. Use the command <code class="docutils literal notranslate"><span class="pre">inventory</span></code> (or <code class="docutils literal notranslate"><span class="pre">i</span></code>) to see it. Now, ‘box’ is a rather short name, so let’s rename it and tack on a few aliases:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>name box = very large box;box;very;crate
|
||
</pre></div>
|
||
</div>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Warning</p>
|
||
<p>MUD Clients and Semi-Colons:
|
||
Some traditional MUD clients use the semi-colon <code class="docutils literal notranslate"><span class="pre">;</span></code> to separate client inputs. If so, the above line will give an error and you’ll need to change your client to use another command-separator or put it in ‘verbatim’ mode. If you still have trouble, use the Evennia web client instead.</p>
|
||
</div>
|
||
<p>We have now renamed the box as <em>very large box</em> — and this is what we will see when looking at it. However, we will also recognize it by any of the other names we have offered as arguments to the name command above (i.e., <em>crate</em> or simply <em>box</em> as before). We also could have given these aliases directly after the name in the initial <code class="docutils literal notranslate"><span class="pre">create</span></code> object command. This is true for all creation commands — you can always provide a list of <code class="docutils literal notranslate"><span class="pre">;</span></code>-separated aliases to the name of your new object. In our example, if you had not wanted to change the box object’s name itself, but to add aliases only, you could use the <code class="docutils literal notranslate"><span class="pre">alias</span></code> command.</p>
|
||
<p>At this point in the building tutorial, our Character is currently carrying the box. Let’s drop it:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>drop box
|
||
</pre></div>
|
||
</div>
|
||
<p>Hey presto, — there it is on the ground, in all its normality. There is also a shortcut to both create and drop an object in one go by using the <code class="docutils literal notranslate"><span class="pre">/drop</span></code> switch (e.g, <code class="docutils literal notranslate"><span class="pre">create/drop</span> <span class="pre">box</span></code>).</p>
|
||
<p>Let us take a closer look at our new box:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>examine box
|
||
</pre></div>
|
||
</div>
|
||
<p>The examine command will show some technical details about the box object. For now, we will ignore what this
|
||
information means.</p>
|
||
<p>Try to <code class="docutils literal notranslate"><span class="pre">look</span></code> at the box to see the (default) description:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>> look box
|
||
You see nothing special.
|
||
</pre></div>
|
||
</div>
|
||
<p>The default description is not very exciting. Let’s add some flavor:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>desc box = This is a large and very heavy box.
|
||
</pre></div>
|
||
</div>
|
||
<p>If you try the <code class="docutils literal notranslate"><span class="pre">get</span></code> command, we will pick up the box. So far so good. But, if we really want this to be a large and heavy box, people should <em>not</em> be able to run off with it so easily. To prevent this, we must lock it down. This is done by assigning a <em>lock</em> to it. TO do so, first make sure the box was dropped in the room, then use the lock command:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lock box = get:false()
|
||
</pre></div>
|
||
</div>
|
||
<p>Locks represent a rather <a class="reference internal" href="../../../Components/Locks.html"><span class="doc std std-doc">big topic</span></a> but, for now, this will do what we want. The above command will lock the box so no one can lift it — with one exception. Remember that superusers override all locks and will pick it up anyway. Make sure you are quelling your superuser powers, and try to get it again:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>> get box
|
||
You can't get that.
|
||
</pre></div>
|
||
</div>
|
||
<p>Think this default error message looks dull? The <code class="docutils literal notranslate"><span class="pre">get</span></code> command looks for an <a class="reference internal" href="../../../Components/Attributes.html"><span class="doc std std-doc">Attribute</span></a> named <code class="docutils literal notranslate"><span class="pre">get_err_msg</span></code> to return as a custom error message. We set attributes using the <code class="docutils literal notranslate"><span class="pre">set</span></code> command:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>set box/get_err_msg = It's way too heavy for you to lift.
|
||
</pre></div>
|
||
</div>
|
||
<p>Now try to get the box and you should see a more pertinent error message echoed back to you. To see what this message string is in the future, you can use ‘examine’.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>examine box/get_err_msg
|
||
</pre></div>
|
||
</div>
|
||
<p><code class="docutils literal notranslate"><span class="pre">Examine</span></code> will return the value of attributes, including color codes. For instance, <code class="docutils literal notranslate"><span class="pre">examine</span> <span class="pre">here/desc</span></code> would return the raw description of the current room (including color codes), so that you can copy-and-paste to set its description to something else.</p>
|
||
<p>You create new Commands — or modify existing ones — in Python code outside the game. We explore doing so later in the <a class="reference internal" href="Beginner-Tutorial-Adding-Commands.html"><span class="doc std std-doc">Commands tutorial</span></a>.</p>
|
||
</section>
|
||
<section id="get-a-personality">
|
||
<h2><span class="section-number">1.5. </span>Get a Personality<a class="headerlink" href="#get-a-personality" title="Permalink to this headline">¶</a></h2>
|
||
<p><a class="reference internal" href="../../../Components/Scripts.html"><span class="doc std std-doc">Scripts</span></a> are powerful out-of-character objects useful for many “under the hood” things. One of their optional abilities is to do things on a timer. To try out our first script, let’s apply one to ourselves. There is an example script in <code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials/bodyfunctions/bodyfunctions.py</span></code> that is called <code class="docutils literal notranslate"><span class="pre">BodyFunctions</span></code>. To add this to our self, we may use the <code class="docutils literal notranslate"><span class="pre">script</span></code> command:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>script self = tutorials.bodyfunctions.BodyFunctions
|
||
</pre></div>
|
||
</div>
|
||
<p>The above string tells Evennia to dig up the Python code at the place we indicate. It already knows to look in the <code class="docutils literal notranslate"><span class="pre">contrib/</span></code> folder, so we don’t have to give the full path.</p>
|
||
<blockquote>
|
||
<div><p>Note also how we use <code class="docutils literal notranslate"><span class="pre">.</span></code> instead of <code class="docutils literal notranslate"><span class="pre">/</span></code> (or <code class="docutils literal notranslate"><span class="pre">\</span></code> on Windows). This convention is a so-called “Python-path.” In a Python-path, you separate the parts of the path with <code class="docutils literal notranslate"><span class="pre">.</span></code> and skip the <code class="docutils literal notranslate"><span class="pre">.py</span></code> file-ending. Importantly, it also allows you to point to Python code <em>inside</em> files as in our example where the <code class="docutils literal notranslate"><span class="pre">BodyFunctions</span></code> class is inside the <code class="docutils literal notranslate"><span class="pre">bodyfunctions.py</span></code> file. We’ll get to classes later. These “Python-paths” are used extensively throughout Evennia.</p>
|
||
</div></blockquote>
|
||
<p>Wait a while and you will notice yourself starting to make random observations…</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>script self =
|
||
</pre></div>
|
||
</div>
|
||
<p>The above command will show details about scripts on the given object, in this case your self. The <code class="docutils literal notranslate"><span class="pre">examine</span></code> command also includes such details.</p>
|
||
<p>You will see how long it is until it “fires” next. Don’t be alarmed if nothing happens when the countdown reaches zero — this particular script has a randomizer to determine if it will say something or not. So you will not see output every time it fires.</p>
|
||
<p>When you are tired of your character’s “insights,” stop the script with:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>script/stop self = tutorials.bodyfunctions.BodyFunctions
|
||
</pre></div>
|
||
</div>
|
||
<p>You may create your own scripts in Python, outside the game; the path you give to <code class="docutils literal notranslate"><span class="pre">script</span></code> is literally the Python path to your script file. The <a class="reference internal" href="../../../Components/Scripts.html"><span class="doc std std-doc">Scripts</span></a> page explains more details.</p>
|
||
</section>
|
||
<section id="pushing-your-buttons">
|
||
<h2><span class="section-number">1.6. </span>Pushing Your Buttons<a class="headerlink" href="#pushing-your-buttons" title="Permalink to this headline">¶</a></h2>
|
||
<p>If we get back to the box we made, there is only so much fun you can have with it at this point. It’s just a dumb generic object. If you renamed it to <code class="docutils literal notranslate"><span class="pre">stone</span></code> and changed its description, no one would be the wiser. However, with the combined use of custom <a class="reference internal" href="../../../Components/Typeclasses.html"><span class="doc std std-doc">Typeclasses</span></a>, <a class="reference internal" href="../../../Components/Scripts.html"><span class="doc std std-doc">Scripts</span></a> and object-based <a class="reference internal" href="../../../Components/Commands.html"><span class="doc std std-doc">Commands</span></a>, you can expand it — and other items — to be as unique, complex, and interactive as you want.</p>
|
||
<p>So, let’s work though just such an example. So far, we have only created objects that use the default object typeclass named simply <code class="docutils literal notranslate"><span class="pre">Object</span></code>. Let’s create an object that is a little more interesting. Under
|
||
<code class="docutils literal notranslate"><span class="pre">evennia/contrib/tutorials</span></code> there is a module <code class="docutils literal notranslate"><span class="pre">red_button.py</span></code>. It contains the enigmatic <code class="docutils literal notranslate"><span class="pre">RedButton</span></code> class.</p>
|
||
<p>Let’s make us one of <em>those</em>!</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>create/drop button:tutorials.red_button.RedButton
|
||
</pre></div>
|
||
</div>
|
||
<p>Enter the above command with Python-path and there you go — one red button! Just as in the Script example earlier, we have specified a Python-path to the Python code that we want Evennia to use for creating the object.</p>
|
||
<p>The RedButton is an example object intended to show off a few of Evennia’s 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"><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 don’t you try to push it…?</p>
|
||
<p>Surely a big red button is meant to be pushed.</p>
|
||
<p>You know you want to.</p>
|
||
<div class="admonition warning">
|
||
<p class="admonition-title">Warning</p>
|
||
<p>Don’t press the invitingly blinking red button.</p>
|
||
</div>
|
||
</section>
|
||
<section id="making-yourself-a-house">
|
||
<h2><span class="section-number">1.7. </span>Making Yourself a House<a class="headerlink" href="#making-yourself-a-house" title="Permalink to this headline">¶</a></h2>
|
||
<p>The main command for shaping your game world is <code class="docutils literal notranslate"><span class="pre">dig</span></code>. For example, if you are standing in Limbo, you can dig a route to your new house location like this:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>dig house = large red door;door;in,to the outside;out
|
||
</pre></div>
|
||
</div>
|
||
<p>The above command will create a new room named “house.” It will also create an exit from your current location named ‘large red door’ and a corresponding exit named ‘to the outside’ in the new house room leading back to Limbo. In above, we also define a few aliases to those exits so that players don’t need to type the full exit name.</p>
|
||
<p>If you wanted to use regular compass directions (north, west, southwest, etc.), you could do that with <code class="docutils literal notranslate"><span class="pre">dig</span></code>, too. However, Evennia also has a specialized version of <code class="docutils literal notranslate"><span class="pre">dig</span></code> that helps with cardinal directions (as well as up/down and in/out). It’s called <code class="docutils literal notranslate"><span class="pre">tunnel</span></code>:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>tunnel sw = cliff
|
||
</pre></div>
|
||
</div>
|
||
<p>This will create a new room named “cliff” with a “southwest” exit leading there, and a “northeast” path leading back from the cliff to your current location.</p>
|
||
<p>You can create new exits from where you are standing, using the <code class="docutils literal notranslate"><span class="pre">open</span></code> command:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>open north;n = house
|
||
</pre></div>
|
||
</div>
|
||
<p>This opens an exit <code class="docutils literal notranslate"><span class="pre">north</span></code> (with an alias <code class="docutils literal notranslate"><span class="pre">n</span></code>) to the previously created room <code class="docutils literal notranslate"><span class="pre">house</span></code>.</p>
|
||
<p>If you have many rooms named <code class="docutils literal notranslate"><span class="pre">house</span></code>, you will get a list of matches and must select to which specific one you want to link.</p>
|
||
<p>Next, follow the northern exit to your “house” by walking north. You can also <code class="docutils literal notranslate"><span class="pre">teleport</span></code> to it:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>north
|
||
</pre></div>
|
||
</div>
|
||
<p>or:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>teleport house
|
||
</pre></div>
|
||
</div>
|
||
<p>To open an exit back to Limbo manually (in case you didn’t do so automatically by using the <code class="docutils literal notranslate"><span class="pre">dig</span></code> command):</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>open door = limbo
|
||
</pre></div>
|
||
</div>
|
||
<p>(You can also use the <code class="docutils literal notranslate"><span class="pre">#dbref</span></code> of Limbo, which you can find by using <code class="docutils literal notranslate"><span class="pre">examine</span> <span class="pre">here</span></code> when standing in Limbo.)</p>
|
||
</section>
|
||
<section id="reshuffling-the-world">
|
||
<h2><span class="section-number">1.8. </span>Reshuffling the World<a class="headerlink" href="#reshuffling-the-world" title="Permalink to this headline">¶</a></h2>
|
||
<p>Assuming you are back at <code class="docutils literal notranslate"><span class="pre">Limbo</span></code>, let’s teleport the <em>large box</em> to our <code class="docutils literal notranslate"><span class="pre">house</span></code>:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>teleport box = house
|
||
very large box is leaving Limbo, heading for house.
|
||
Teleported very large box -> house.
|
||
</pre></div>
|
||
</div>
|
||
<p>You can find things in the game world, such as our <code class="docutils literal notranslate"><span class="pre">box</span></code>, by using the <code class="docutils literal notranslate"><span class="pre">find</span></code> command:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>find box
|
||
One Match(#1-#8):
|
||
very large box(#8) - src.objects.objects.Object
|
||
</pre></div>
|
||
</div>
|
||
<p>Knowing the <code class="docutils literal notranslate"><span class="pre">#dbref</span></code> of the box (#8 in this example), you can grab the box and get it back here without actually going to the <code class="docutils literal notranslate"><span class="pre">house</span></code> first:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>teleport #8 = here
|
||
</pre></div>
|
||
</div>
|
||
<p>As mentioned, <code class="docutils literal notranslate"><span class="pre">here</span></code> is an alias for “your current location.” The box should now be back in Limbo with you.</p>
|
||
<p>We are getting tired of the box. Let’s destroy it:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>destroy box
|
||
</pre></div>
|
||
</div>
|
||
<p>Issuing the `destroy`` command will ask you for confirmation. Once you confirm, the box will be gone.</p>
|
||
<p>You can <code class="docutils literal notranslate"><span class="pre">destroy</span></code> many objects in one go by providing a comma-separated list of objects (or a range of <code class="docutils literal notranslate"><span class="pre">#dbrefs</span></code>, if they are not in the same location) to the command.</p>
|
||
</section>
|
||
<section id="adding-a-help-entry">
|
||
<h2><span class="section-number">1.9. </span>Adding a Help Entry<a class="headerlink" href="#adding-a-help-entry" title="Permalink to this headline">¶</a></h2>
|
||
<p>Command-related <code class="docutils literal notranslate"><span class="pre">help</span></code> entries are something that you modify in Python code — we’ll cover that when we explain how to add Commands — but you may also add non-command-related help entries. For example, to explain something about the history of your game world:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>sethelp History = At the dawn of time ...
|
||
</pre></div>
|
||
</div>
|
||
<p>You will now find your new <code class="docutils literal notranslate"><span class="pre">History</span></code> entry in the <code class="docutils literal notranslate"><span class="pre">help</span></code> list, and can read your help-text with <code class="docutils literal notranslate"><span class="pre">help</span> <span class="pre">History</span></code>.</p>
|
||
</section>
|
||
<section id="adding-a-world">
|
||
<h2><span class="section-number">1.10. </span>Adding a World<a class="headerlink" href="#adding-a-world" title="Permalink to this headline">¶</a></h2>
|
||
<p>After this brief introduction to building and using in-game commands, you may be ready to see a more fleshed-out example. Fortunately, Evennia comes with an tutorial world for you to explore — which we will try in the next lesson.</p>
|
||
</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="Beginner-Tutorial-Tutorial-World.html" title="2. The Tutorial World"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Beginner-Tutorial-Part1-Overview.html" title="Part 1: What We Have"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../../../index.html">Evennia latest</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="../../Howtos-Overview.html" >Tutorials and How-To’s</a> »</li>
|
||
<li class="nav-item nav-item-2"><a href="../Beginner-Tutorial-Overview.html" >Beginner Tutorial</a> »</li>
|
||
<li class="nav-item nav-item-3"><a href="Beginner-Tutorial-Part1-Overview.html" >Part 1: What We Have</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href=""><span class="section-number">1. </span>Using Commands and Building Stuff</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2023, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |