<h1>Planning the use of some useful contribs<aclass="headerlink"href="#planning-the-use-of-some-useful-contribs"title="Permalink to this headline">¶</a></h1>
<p>Evennia is deliberately bare-bones out of the box. The idea is that you should be as unrestricted as possible
in designing your game. This is why you can easily replace the few defaults we have and why we don’t try to
prescribe any major game systems on you.</p>
<p>That said, Evennia <em>does</em> offer some more game-opinionated <em>optional</em> stuff. These are referred to as <em>Contribs</em>
and is an ever-growing treasure trove of code snippets, concepts and even full systems you can pick and choose
from to use, tweak or take inspiration from when you make your game.</p>
<p>The <aclass="reference internal"href="../../../Contribs/Contrib-Overview.html"><spanclass="doc">Contrib overview</span></a> page gives the full list of the current roster of contributions. On
this page we will review a few contribs we will make use of for our game. We will do the actual installation
of them when we start coding in the next part of this tutorial series. While we will introduce them here, you
are wise to read their doc-strings yourself for the details.</p>
<p>This is the things we know we need:</p>
<ulclass="simple">
<li><p>A barter system</p></li>
<li><p>Character generation</p></li>
<li><p>Some concept of wearing armor</p></li>
<li><p>The ability to roll dice</p></li>
<li><p>Rooms with awareness of day, night and season</p></li>
<li><p>Roleplaying with short-descs, poses and emotes</p></li>
<li><p>Quests</p></li>
<li><p>Combat (with players and against monsters)</p></li>
</ul>
<divclass="section"id="barter-contrib">
<h2>Barter contrib<aclass="headerlink"href="#barter-contrib"title="Permalink to this headline">¶</a></h2>
<p>Reviewing this contrib suggests that it allows for safe trading between two parties. The basic principle
is that the parties puts up the stuff they want to sell and the system will guarantee that these systems are
exactly what is being offered. Both sides can modify their offers (bartering) until both mark themselves happy
with the deal. Only then the deal is sealed and the objects are exchanged automatically. Interestingly, this
works just fine for money too - just put coin objects on one side of the transaction.</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span>Sue > trade Tom: Hi, I have a necklace to sell; wanna trade for a healing potion?
Tom > trade Sue: Hm, I could use a necklace ...
<both accepted trade. Start trade>
Sue > offer necklace: This necklace is really worth it.
Tom > evaluate necklace:
<Tom sees necklace stats>
Tom > offer ration: I don't have a healing potion, but I'll trade you an iron ration!
Sue > Hey, this is a nice necklace, I need more than a ration for it...
Tom > offer ration, 10gold: Ok, a ration and 10 gold as well.
Sue > accept: Ok, that sounds fair!
Tom > accept: Good! Nice doing business with you.
<p>Arguably, in a small game you are just fine to just talk to people and use <codeclass="docutils literal notranslate"><spanclass="pre">give</span></code> to do the exchange. The
barter system guarantees trading safety if you don’t trust your counterpart to try to give you the wrong thing or
to run away with your money.</p>
<p>We will use the barter contrib as an optional feature for player-player bartering. More importantly we can
add it for NPC shopkeepers and expand it with a little AI, which allows them to potentially trade in other
<p>This contrib is an example module for creating characters. Since we will be using <codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE=3</span></code> we will
get a selection screen like this automatically. We also plan to use a proper menu to build our character, so
we will <em>not</em> be using this contrib.</p>
</div>
<divclass="section"id="clothing-contrib">
<h2>Clothing contrib<aclass="headerlink"href="#clothing-contrib"title="Permalink to this headline">¶</a></h2>
<p>The contrib also has a python function for producing these results in-code. However, while
we will emulate rolls for our rule system, we’ll do this as simply as possible with Python’s <codeclass="docutils literal notranslate"><spanclass="pre">random</span></code>
module.</p>
<p>So while this contrib is fun to have around for GMs or for players who want to get a random result
or play a game, we will not need it for the core of our game.</p>
</div>
<divclass="section"id="extended-room-contrib">
<h2>Extended room contrib<aclass="headerlink"href="#extended-room-contrib"title="Permalink to this headline">¶</a></h2>
<p>This is a custom Room typeclass that changes its description based on time of day and season.</p>
<p>For example, at night, in wintertime you could show the room as being dark and frost-covered while in daylight
at summer it could describe a flowering meadow. The description can also contain special markers, so
<codeclass="docutils literal notranslate"><spanclass="pre"><morning></span><spanclass="pre">...</span><spanclass="pre"></morning></span></code> would include text only visible at morning.</p>
<p>The extended room also supports <em>details</em>, which are things to “look at” in the room without there having
to be a separate database object created for it. For example, a player in a church may do <codeclass="docutils literal notranslate"><spanclass="pre">look</span><spanclass="pre">window</span></code> and
get a description of the windows without there needing to be an actual <codeclass="docutils literal notranslate"><spanclass="pre">window</span></code> object in the room.</p>
<p>Adding all those extra descriptions can be a lot of work, so they are optional; if not given the room works
like a normal room.</p>
<p>The contrib is simple to add and provides a lot of optional flexibility, so we’ll add it to our
game, why not!</p>
</div>
<divclass="section"id="rp-system-contrib">
<h2>RP-System contrib<aclass="headerlink"href="#rp-system-contrib"title="Permalink to this headline">¶</a></h2>
<spanclass="n">Tom</span><spanclass="o">></span><spanclass="n">emote</span><spanclass="n">Leaning</span><spanclass="n">forward</span><spanclass="p">,</span><spanclass="o">/</span><spanclass="n">me</span><spanclass="n">says</span><spanclass="p">,</span><spanclass="s2">"Well hello, what's yer name?"</span>
<spanclass="n">Sue</span><spanclass="p">:</span><spanclass="n">Leaning</span><spanclass="n">forward</span><spanclass="p">,</span><spanclass="n">A</span><spanclass="n">tall</span><spanclass="n">man</span><spanclass="n">says</span><spanclass="p">,</span><spanclass="s2">"Well hello, what's yer name?"</span>
<spanclass="n">Tom</span><spanclass="o">></span><spanclass="n">emote</span><spanclass="o">/</span><spanclass="n">me</span><spanclass="n">nods</span><spanclass="n">to</span><spanclass="o">/</span><spanclass="n">angelica</span><spanclass="p">:</span><spanclass="s2">"I have a message for you ..."</span>
<spanclass="n">Tom</span><spanclass="p">:</span><spanclass="n">Tom</span><spanclass="n">nods</span><spanclass="n">to</span><spanclass="n">Angelica</span><spanclass="p">:</span><spanclass="s2">"I have a message for you ..."</span>
<spanclass="n">Sue</span><spanclass="p">:</span><spanclass="n">A</span><spanclass="n">tall</span><spanclass="n">man</span><spanclass="n">nods</span><spanclass="n">to</span><spanclass="n">Sue</span><spanclass="p">:</span><spanclass="s2">"I have a message for you ..."</span>
</pre></div>
</div>
<p>Above, Sue introduces herself as “Angelica” and Tom uses this info to <codeclass="docutils literal notranslate"><spanclass="pre">recoc</span></code> her as “Angelica” hereafter. He
could have <codeclass="docutils literal notranslate"><spanclass="pre">recoc</span></code>-ed her with whatever name he liked - it’s only for his own benefit. There is no separate
<codeclass="docutils literal notranslate"><spanclass="pre">say</span></code>, the spoken words are embedded in the emotes in quotes <codeclass="docutils literal notranslate"><spanclass="pre">"..."</span></code>.</p>
<p>The RPSystem module also includes options for <codeclass="docutils literal notranslate"><spanclass="pre">poses</span></code>, which help to establish your position in the room
<p>You can also wear a mask to hide your identity; your sdesc will then be changed to the sdesc of the mask,
like <codeclass="docutils literal notranslate"><spanclass="pre">a</span><spanclass="pre">person</span><spanclass="pre">with</span><spanclass="pre">a</span><spanclass="pre">mask</span></code>.</p>
<p>The RPSystem gives a lot of roleplaying power out of the box, so we will add it. There is also a separate
<aclass="reference external"href="../../../api/evennia.contrib.rplanguage.html">rplanguage</a> module that integrates with the spoken words in your emotes and garbles them if you don’t understand
the language spoken. In order to restrict the scope we will not include languages for the tutorial game.</p>
</div>
<divclass="section"id="talking-npc-contrib">
<h2>Talking NPC contrib<aclass="headerlink"href="#talking-npc-contrib"title="Permalink to this headline">¶</a></h2>
<spanclass="o">></span><spanclass="n">py</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">traits</span><spanclass="o">.</span><spanclass="n">hp</span><spanclass="o">.</span><spanclass="n">reset</span><spanclass="p">()</span><spanclass="c1"># drink a potion</span>
<spanclass="o">></span><spanclass="n">py</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">traits</span><spanclass="o">.</span><spanclass="n">hp</span><spanclass="o">.</span><spanclass="n">ratetarget</span><spanclass="o">=</span><spanclass="mi">50</span><spanclass="c1"># stop at 50 hp</span>
<spanclass="mi">50</span><spanclass="c1"># stopped at 50</span>
<spanclass="o">></span><spanclass="n">py</span><spanclass="bp">self</span><spanclass="o">.</span><spanclass="n">traits</span><spanclass="o">.</span><spanclass="n">hp</span><spanclass="o">.</span><spanclass="n">rate</span><spanclass="o">=</span><spanclass="mi">0</span><spanclass="c1"># no more poison</span>