mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 22:17:17 +02:00
Updated HTML docs
This commit is contained in:
parent
f505351730
commit
a551188691
1002 changed files with 30387 additions and 9820 deletions
|
|
@ -7,11 +7,13 @@
|
|||
<title>Tutorial Searching For Objects — Evennia 0.9.1 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" />
|
||||
|
|
@ -25,7 +27,10 @@
|
|||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.1 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.1 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-last"><a href="#">Tutorial Searching For Objects</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -39,10 +44,10 @@
|
|||
<p>You will often want to operate on a specific object in the database. For example when a player attacks a named target you’ll need to find that target so it can be attacked. Or when a rain storm draws in you need to find all outdoor-rooms so you can show it raining in them. This tutorial explains Evennia’s tools for searching.</p>
|
||||
<div class="section" id="things-to-search-for">
|
||||
<h2>Things to search for<a class="headerlink" href="#things-to-search-for" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The first thing to consider is the base type of the thing you are searching for. Evennia organizes its database into a few main tables: <a class="reference internal" href="Objects.html"><span class="doc">Objects</span></a>, <a class="reference internal" href="Accounts.html"><span class="doc">Accounts</span></a>, <a class="reference internal" href="Scripts.html"><span class="doc">Scripts</span></a>, <a class="reference external" href="/Communications.html#channels">Channels</a>, <a class="reference external" href="Communication#Msg">Messages</a> and <a class="reference internal" href="Help-System.html"><span class="doc">Help Entries</span></a>. Most of the time you’ll likely spend your time searching for Objects and the occasional Accounts.</p>
|
||||
<p>The first thing to consider is the base type of the thing you are searching for. Evennia organizes its database into a few main tables: <a class="reference internal" href="Objects.html"><span class="doc">Objects</span></a>, <a class="reference internal" href="Accounts.html"><span class="doc">Accounts</span></a>, <a class="reference internal" href="Scripts.html"><span class="doc">Scripts</span></a>, <a class="reference external" href="Communications.html#channels">Channels</a>, <a class="reference external" href="Communication#Msg">Messages</a> and <a class="reference internal" href="Help-System.html"><span class="doc">Help Entries</span></a>. Most of the time you’ll likely spend your time searching for Objects and the occasional Accounts.</p>
|
||||
<p>So to find an entity, what can be searched for?</p>
|
||||
<ul class="simple">
|
||||
<li><p>The <code class="docutils literal notranslate"><span class="pre">key</span></code> is the name of the entity. While you can get this from <code class="docutils literal notranslate"><span class="pre">obj.key</span></code> the <em>database field</em> is actually named <code class="docutils literal notranslate"><span class="pre">obj.db_key</span></code> - this is useful to know only when you do <a class="reference external" href="/Tutorial-Searching-For-Objects.html#queries-in-django">direct database queries</a>. The one exception is <code class="docutils literal notranslate"><span class="pre">Accounts</span></code>, where the database field for <code class="docutils literal notranslate"><span class="pre">.key</span></code> is instead named <code class="docutils literal notranslate"><span class="pre">username</span></code> (this is a Django requirement). When you don’t specify search-type, you’ll usually search based on key. <em>Aliases</em> are extra names given to Objects using something like <code class="docutils literal notranslate"><span class="pre">@alias</span></code> or <code class="docutils literal notranslate"><span class="pre">obj.aliases.add('name')</span></code>. The main search functions (see below) will automatically search for aliases whenever you search by-key.</p></li>
|
||||
<li><p>The <code class="docutils literal notranslate"><span class="pre">key</span></code> is the name of the entity. While you can get this from <code class="docutils literal notranslate"><span class="pre">obj.key</span></code> the <em>database field</em> is actually named <code class="docutils literal notranslate"><span class="pre">obj.db_key</span></code> - this is useful to know only when you do <a class="reference external" href="Tutorial-Searching-For-Objects.html#queries-in-django">direct database queries</a>. The one exception is <code class="docutils literal notranslate"><span class="pre">Accounts</span></code>, where the database field for <code class="docutils literal notranslate"><span class="pre">.key</span></code> is instead named <code class="docutils literal notranslate"><span class="pre">username</span></code> (this is a Django requirement). When you don’t specify search-type, you’ll usually search based on key. <em>Aliases</em> are extra names given to Objects using something like <code class="docutils literal notranslate"><span class="pre">@alias</span></code> or <code class="docutils literal notranslate"><span class="pre">obj.aliases.add('name')</span></code>. The main search functions (see below) will automatically search for aliases whenever you search by-key.</p></li>
|
||||
<li><p><a class="reference internal" href="Tags.html"><span class="doc">Tags</span></a> are the main way to group and identify objects in Evennia. Tags can most often be used (sometimes together with keys) to uniquely identify an object. For example, even though you have two locations with the same name, you can separate them by their tagging (this is how Evennia implements ‘zones’ seen in other systems). Tags can also have categories, to further organize your data for quick lookups.</p></li>
|
||||
<li><p>An object’s <a class="reference internal" href="Attributes.html"><span class="doc">Attributes</span></a> can also used to find an object. This can be very useful but since Attributes can store almost any data they are far less optimized to search for than Tags or keys.</p></li>
|
||||
<li><p>The object’s <a class="reference internal" href="Typeclasses.html"><span class="doc">Typeclass</span></a> indicate the sub-type of entity. A Character, Flower or Sword are all types of Objects. A Bot is a kind of Account. The database field is called <code class="docutils literal notranslate"><span class="pre">typeclass_path</span></code> and holds the full Python-path to the class. You can usually specify the <code class="docutils literal notranslate"><span class="pre">typeclass</span></code> as an argument to Evennia’s search functions as well as use the class directly to limit queries.</p></li>
|
||||
|
|
@ -434,7 +439,10 @@ Next we filter on this annotation, using the name <code class="docutils literal
|
|||
<li class="right" >
|
||||
<a href="py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.1 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.1 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-last"><a href="#">Tutorial Searching For Objects</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue