Updated HTML docs.

This commit is contained in:
Evennia docbuilder action 2023-01-07 23:14:56 +00:00
parent b454c9fde4
commit d92575639c
43 changed files with 124 additions and 124 deletions

View file

@ -397,7 +397,7 @@ presentational string out of it using the <code class="docutils literal notransl
</pre></div>
</div>
<p>Obviously this method of generating maps doesnt take into account of any doors or exits that are hidden… etc… but hopefully it serves as a good base to start with. Like previously mentioned, it is very important to have a solid foundation on rooms before implementing this. You can try this on vanilla evennia by using &#64;tunnel and essentially you can just create a long straight/edgy non- looping rooms that will show on your in-game map.</p>
<p>The above example will display the map above the room description. You could also use an <a class="reference external" href="https://github.com/evennia/evennia/blob/master/evennia.utils.evtable">EvTable</a> to place description and map next to each other. Some other things you can do is to have a <a class="reference internal" href="../Components/Commands.html"><span class="doc std std-doc">Command</span></a> that displays with a larger radius, maybe with a legend and other features.</p>
<p>The above example will display the map above the room description. You could also use an <a class="reference external" href="https://github.com/evennia/evennia/blob/main/evennia.utils.evtable">EvTable</a> to place description and map next to each other. Some other things you can do is to have a <a class="reference internal" href="../Components/Commands.html"><span class="doc std std-doc">Command</span></a> that displays with a larger radius, maybe with a legend and other features.</p>
<p>Below is the whole <code class="docutils literal notranslate"><span class="pre">map.py</span></code> for your reference. You need to update your <code class="docutils literal notranslate"><span class="pre">Room</span></code> typeclass (see above) to actually call it. Remember that to see different symbols for a location you also need to set the <code class="docutils literal notranslate"><span class="pre">sector_type</span></code> Attribute on the room to one of the keys in the <code class="docutils literal notranslate"><span class="pre">SYMBOLS</span></code> dictionary. So in this example, to make a room be mapped as <code class="docutils literal notranslate"><span class="pre">[.]</span></code> you would set the rooms <code class="docutils literal notranslate"><span class="pre">sector_type</span></code> to <code class="docutils literal notranslate"><span class="pre">&quot;SECT_INSIDE&quot;</span></code>. Try it out with <code class="docutils literal notranslate"><span class="pre">&#64;set</span> <span class="pre">here/sector_type</span> <span class="pre">=</span> <span class="pre">&quot;SECT_INSIDE&quot;</span></code>. If you wanted all new rooms to have a given sector symbol, you could change the default in the <code class="docutils literal notranslate"><span class="pre">SYMBOLS</span></code> dictionary below, or you could add the Attribute in the Rooms <code class="docutils literal notranslate"><span class="pre">at_object_creation</span></code> method.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># mygame/world/map.py</span>