mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 16:26:30 +01:00
290 lines
No EOL
20 KiB
HTML
290 lines
No EOL
20 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>evennia.game_template.commands package — Evennia 1.0-dev documentation</title>
|
||
<link rel="stylesheet" href="../_static/alabaster.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="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
|
||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head><body>
|
||
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
|
||
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="module-evennia.game_template.commands">
|
||
<span id="evennia-game-template-commands-package"></span><h1>evennia.game_template.commands package<a class="headerlink" href="#module-evennia.game_template.commands" title="Permalink to this headline">¶</a></h1>
|
||
<div class="section" id="submodules">
|
||
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
|
||
</div>
|
||
<div class="section" id="module-evennia.game_template.commands.command">
|
||
<span id="evennia-game-template-commands-command-module"></span><h2>evennia.game_template.commands.command module<a class="headerlink" href="#module-evennia.game_template.commands.command" title="Permalink to this headline">¶</a></h2>
|
||
<p>Commands</p>
|
||
<p>Commands describe the input the account can do to the game.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.game_template.commands.command.Command">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.game_template.commands.command.</code><code class="sig-name descname">Command</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/command.html#Command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.command.Command" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.html#evennia.commands.command.Command" title="evennia.commands.command.Command"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.command.Command</span></code></a></p>
|
||
<p>Inherit from this if you want to create your own command styles
|
||
from scratch. Note that Evennia’s default commands inherits from
|
||
MuxCommand instead.</p>
|
||
<p>Note that the class’s <cite>__doc__</cite> string (this text) is
|
||
used by Evennia to create the automatic help entry for
|
||
the command, so make sure to document consistently here.</p>
|
||
<p>Each Command implements the following methods, called
|
||
in this order (only func() is actually required):</p>
|
||
<blockquote>
|
||
<div><ul class="simple">
|
||
<li><p>at_pre_cmd(): If this returns anything truthy, execution is aborted.</p></li>
|
||
<li><dl class="simple">
|
||
<dt>parse(): Should perform any extra parsing needed on self.args</dt><dd><p>and store the result on self.</p>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
<li><p>func(): Performs the actual work.</p></li>
|
||
<li><dl class="simple">
|
||
<dt>at_post_cmd(): Extra actions, often things done after</dt><dd><p>every command, like prompts.</p>
|
||
</dd>
|
||
</dl>
|
||
</li>
|
||
</ul>
|
||
</div></blockquote>
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command._keyaliases">
|
||
<code class="sig-name descname">_keyaliases</code><em class="property"> = ('command',)</em><a class="headerlink" href="#evennia.game_template.commands.command.Command._keyaliases" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command._matchset">
|
||
<code class="sig-name descname">_matchset</code><em class="property"> = {'command'}</em><a class="headerlink" href="#evennia.game_template.commands.command.Command._matchset" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command.aliases">
|
||
<code class="sig-name descname">aliases</code><em class="property"> = []</em><a class="headerlink" href="#evennia.game_template.commands.command.Command.aliases" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command.help_category">
|
||
<code class="sig-name descname">help_category</code><em class="property"> = 'general'</em><a class="headerlink" href="#evennia.game_template.commands.command.Command.help_category" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'command'</em><a class="headerlink" href="#evennia.game_template.commands.command.Command.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command.lock_storage">
|
||
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.game_template.commands.command.Command.lock_storage" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.command.Command.search_index_entry">
|
||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': "\n Inherit from this if you want to create your own command styles\n from scratch. Note that Evennia's default commands inherits from\n MuxCommand instead.\n\n Note that the class's `__doc__` string (this text) is\n used by Evennia to create the automatic help entry for\n the command, so make sure to document consistently here.\n\n Each Command implements the following methods, called\n in this order (only func() is actually required):\n - at_pre_cmd(): If this returns anything truthy, execution is aborted.\n - parse(): Should perform any extra parsing needed on self.args\n and store the result on self.\n - func(): Performs the actual work.\n - at_post_cmd(): Extra actions, often things done after\n every command, like prompts.\n\n "}</em><a class="headerlink" href="#evennia.game_template.commands.command.Command.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
<div class="section" id="module-evennia.game_template.commands.default_cmdsets">
|
||
<span id="evennia-game-template-commands-default-cmdsets-module"></span><h2>evennia.game_template.commands.default_cmdsets module<a class="headerlink" href="#module-evennia.game_template.commands.default_cmdsets" title="Permalink to this headline">¶</a></h2>
|
||
<p>Command sets</p>
|
||
<p>All commands in the game must be grouped in a cmdset. A given command
|
||
can be part of any number of cmdsets and cmdsets can be added/removed
|
||
and merged onto entities at runtime.</p>
|
||
<p>To create new commands to populate the cmdset, see
|
||
<cite>commands/command.py</cite>.</p>
|
||
<p>This module wraps the default command sets of Evennia; overloads them
|
||
to add/remove commands from the default lineup. You can create your
|
||
own cmdsets by inheriting from them or directly from <cite>evennia.CmdSet</cite>.</p>
|
||
<dl class="class">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.AccountCmdSet">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.game_template.commands.default_cmdsets.</code><code class="sig-name descname">AccountCmdSet</code><span class="sig-paren">(</span><em class="sig-param">cmdsetobj=None</em>, <em class="sig-param">key=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#AccountCmdSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.AccountCmdSet" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.cmdset_account.AccountCmdSet" title="evennia.commands.default.cmdset_account.AccountCmdSet"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.cmdset_account.AccountCmdSet</span></code></a></p>
|
||
<p>This is the cmdset available to the Account at all times. It is
|
||
combined with the <cite>CharacterCmdSet</cite> when the Account puppets a
|
||
Character. It holds game-account-specific commands, channel
|
||
commands, etc.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.AccountCmdSet.at_cmdset_creation">
|
||
<code class="sig-name descname">at_cmdset_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#AccountCmdSet.at_cmdset_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.AccountCmdSet.at_cmdset_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Populates the cmdset</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.AccountCmdSet.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'DefaultAccount'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.AccountCmdSet.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.AccountCmdSet.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.game_template.commands.default_cmdsets.AccountCmdSet'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.AccountCmdSet.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.CharacterCmdSet">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.game_template.commands.default_cmdsets.</code><code class="sig-name descname">CharacterCmdSet</code><span class="sig-paren">(</span><em class="sig-param">cmdsetobj=None</em>, <em class="sig-param">key=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#CharacterCmdSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.CharacterCmdSet" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.cmdset_character.CharacterCmdSet" title="evennia.commands.default.cmdset_character.CharacterCmdSet"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.cmdset_character.CharacterCmdSet</span></code></a></p>
|
||
<p>The <cite>CharacterCmdSet</cite> contains general in-game commands like <cite>look</cite>,
|
||
<cite>get</cite>, etc available on in-game Character objects. It is merged with
|
||
the <cite>AccountCmdSet</cite> when an Account puppets a Character.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.CharacterCmdSet.at_cmdset_creation">
|
||
<code class="sig-name descname">at_cmdset_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#CharacterCmdSet.at_cmdset_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.CharacterCmdSet.at_cmdset_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Populates the cmdset</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.CharacterCmdSet.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'DefaultCharacter'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.CharacterCmdSet.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.CharacterCmdSet.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.game_template.commands.default_cmdsets.CharacterCmdSet'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.CharacterCmdSet.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.SessionCmdSet">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.game_template.commands.default_cmdsets.</code><code class="sig-name descname">SessionCmdSet</code><span class="sig-paren">(</span><em class="sig-param">cmdsetobj=None</em>, <em class="sig-param">key=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#SessionCmdSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.SessionCmdSet" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.cmdset_session.SessionCmdSet" title="evennia.commands.default.cmdset_session.SessionCmdSet"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.cmdset_session.SessionCmdSet</span></code></a></p>
|
||
<p>This cmdset is made available on Session level once logged in. It
|
||
is empty by default.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.SessionCmdSet.at_cmdset_creation">
|
||
<code class="sig-name descname">at_cmdset_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#SessionCmdSet.at_cmdset_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.SessionCmdSet.at_cmdset_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>This is the only method defined in a cmdset, called during
|
||
its creation. It should populate the set with command instances.</p>
|
||
<p>As and example we just add the empty base <cite>Command</cite> object.
|
||
It prints some info.</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.SessionCmdSet.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'DefaultSession'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.SessionCmdSet.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.SessionCmdSet.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.game_template.commands.default_cmdsets.SessionCmdSet'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.SessionCmdSet.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="class">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet">
|
||
<em class="property">class </em><code class="sig-prename descclassname">evennia.game_template.commands.default_cmdsets.</code><code class="sig-name descname">UnloggedinCmdSet</code><span class="sig-paren">(</span><em class="sig-param">cmdsetobj=None</em>, <em class="sig-param">key=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#UnloggedinCmdSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <a class="reference internal" href="evennia.commands.default.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet</span></code></a></p>
|
||
<p>Command set available to the Session before being logged in. This
|
||
holds commands like creating a new account, logging in, etc.</p>
|
||
<dl class="method">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet.at_cmdset_creation">
|
||
<code class="sig-name descname">at_cmdset_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/game_template/commands/default_cmdsets.html#UnloggedinCmdSet.at_cmdset_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet.at_cmdset_creation" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Populates the cmdset</p>
|
||
</dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet.key">
|
||
<code class="sig-name descname">key</code><em class="property"> = 'DefaultUnloggedin'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet.key" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet.path">
|
||
<code class="sig-name descname">path</code><em class="property"> = 'evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet'</em><a class="headerlink" href="#evennia.game_template.commands.default_cmdsets.UnloggedinCmdSet.path" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<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>
|
||
<p><h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">evennia.game_template.commands package</a><ul>
|
||
<li><a class="reference internal" href="#submodules">Submodules</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.game_template.commands.command">evennia.game_template.commands.command module</a></li>
|
||
<li><a class="reference internal" href="#module-evennia.game_template.commands.default_cmdsets">evennia.game_template.commands.default_cmdsets module</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="../index.html">Documentation overview</a><ul>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/api/evennia.game_template.commands.rst.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div>
|
||
<h3>Versions</h3>
|
||
<ul>
|
||
<li><a href="evennia.game_template.commands.html">1.0-dev (develop branch)</a></li>
|
||
<li><a href="../../../versions/0.9.1/api/evennia.game_template.commands.html">0.9.1 (master branch)</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2020, The Evennia developer community.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||
|
||
|
|
||
<a href="../_sources/api/evennia.game_template.commands.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |