<pclass="last">You are reading an old version of the Evennia documentation. <ahref="https://www.evennia.com/docs/latest/index.html">The latest version is here</a></p>.
<h1>Using the Arxcode game dir<aclass="headerlink"href="#using-the-arxcode-game-dir"title="Permalink to this headline">¶</a></h1>
<divclass="admonition warning">
<pclass="admonition-title">Warning</p>
<p>Arxcode is separately maintained.</p>
<p>While Arxcode uses Evennia, it is <em>not</em> part of Evennia itself; we include this documentation only as a service to users. Also, while Arxcode is still actively maintained (2022), these instructions are based on the Arx-code released as of <em>Aug 12, 2018</em>. They will probably not work 100% out of the box anymore.</p>
<p>Arxcode bugs should be directed to <aclass="reference external"href="https://github.com/Arx-Game/arxcode/issues">the Arxcode github issue tracker</a>.</p>
</div>
<p><aclass="reference external"href="https://play.arxmush.org/">Arx - After the Reckoning</a> is a big and very popular <aclass="reference external"href="https://www.evennia.com">Evennia</a>-based game. Arx is heavily roleplaying-centric, relying on game masters to drive the story. Technically it’s maybe best described as “a MUSH, but with more coded systems”. In August of 2018, the game’s developer, Tehom, generously released the <aclass="reference external"href="https://github.com/Arx-Game/arxcode">source code of Arx on github</a>. This is a treasure-trove for developers wanting to pick ideas or even get a starting game to build on.</p>
<p>It’s not too hard to run Arx from the sources (of course you’ll start with an empty database) but
since part of Arx has grown organically, it doesn’t follow standard Evennia paradigms everywhere.
This page covers one take on installing and setting things up while making your new Arx-based game better match with the vanilla Evennia install.</p>
<sectionid="installing-evennia">
<h2>Installing Evennia<aclass="headerlink"href="#installing-evennia"title="Permalink to this headline">¶</a></h2>
<p>Firstly, set aside a folder/directory on your drive for everything to follow.</p>
<p>You need to start by installing <aclass="reference external"href="https://www.evennia.com">Evennia</a> by following most of the <aclass="reference internal"href="../Setup/Installation-Git.html"><spanclass="doc std std-doc">Git-installation instructions</span></a> for your OS. The difference is that instead of cloning from upstream Evennia, you should do</p>
<p>This is because Arx uses TehomCD’s older Evennia 0.8 <aclass="reference external"href="https://github.com/TehomCD/evennia">fork</a>, notably still using Python2. This detail is important if referring to newer Evennia documentation.</p>
<p>If you are new to Evennia it’s <em>highly</em> recommended that you run through the normal install instructions in full - including initializing and starting a new empty game and connecting to it.
That way you can be sure Evennia works correctly as a baseline.</p>
<p>After installing you should have a <codeclass="docutils literal notranslate"><spanclass="pre">virtualenv</span></code> running and you should have the following file structure in your set-aside folder:</p>
<p>Here <codeclass="docutils literal notranslate"><spanclass="pre">mygame</span></code> is the empty game you created during the Evennia install, with <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">--init</span></code>. Go to
that and run <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">stop</span></code> to make sure your empty game is not running. We’ll instead let Evenna
run Arx, so in principle you could erase <codeclass="docutils literal notranslate"><spanclass="pre">mygame</span></code> - but it could also be good to have a clean game
to compare to.</p>
</section>
<sectionid="installing-arxcode">
<h2>Installing Arxcode<aclass="headerlink"href="#installing-arxcode"title="Permalink to this headline">¶</a></h2>
<p><codeclass="docutils literal notranslate"><spanclass="pre">cd</span></code> to the root of your directory and clone the released source code from github:</p>
<p>A new folder <codeclass="docutils literal notranslate"><spanclass="pre">myarx</span></code> should appear next to the ones you already had. You could rename this to
something else if you want.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">cd</span></code> into <codeclass="docutils literal notranslate"><spanclass="pre">myarx</span></code>. If you wonder about the structure of the game dir, you can <aclass="reference internal"href="Beginner-Tutorial/Part1/Beginner-Tutorial-Gamedir-Overview.html"><spanclass="doc std std-doc">read more about it here</span></a>.</p>
<sectionid="clean-up-settings">
<h3>Clean up settings<aclass="headerlink"href="#clean-up-settings"title="Permalink to this headline">¶</a></h3>
<p>Arx has split evennia’s normal settings into <codeclass="docutils literal notranslate"><spanclass="pre">base_settings.py</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">production_settings.py</span></code>. It
also has its own solution for managing ‘secret’ parts of the settings file. We’ll keep most of Arx
way but we’ll remove the secret-handling and replace it with the normal Evennia method.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">cd</span></code> into <codeclass="docutils literal notranslate"><spanclass="pre">myarx/server/conf/</span></code> and open the file <codeclass="docutils literal notranslate"><spanclass="pre">settings.py</span></code> in a text editor. The top part (within
<codeclass="docutils literal notranslate"><spanclass="pre">"""..."""</span></code>) is just help text. Wipe everything underneath that and make it look like this instead
<spanclass="nb">print</span><spanclass="p">(</span><spanclass="s2">"secret_settings.py file not found or failed to import."</span><spanclass="p">)</span>
</pre></div>
</div>
<blockquote>
<div><p>Note: Indents and capitalization matter in Python. Make indents 4 spaces (not tabs) for your own sanity. If you want a starter on Python in Evennia, [you can look here](Beginner-Tutorial-Python-basic- introduction).</p>
</div></blockquote>
<p>This will import Arx’ base settings and override them with the Evennia-default telnet port and give the game a name. The slogan changes the sub-text shown under the name of your game in the website header. You can tweak these to your own liking later.</p>
<p>Next, create a new, empty file <codeclass="docutils literal notranslate"><spanclass="pre">secret_settings.py</span></code> in the same location as the <codeclass="docutils literal notranslate"><spanclass="pre">settings.py</span></code> file.
<p>Replace the long random string with random ASCII characters of your own. The secret key should not be shared.</p>
<p>Next, open <codeclass="docutils literal notranslate"><spanclass="pre">myarx/server/conf/base_settings.py</span></code> in your text editor. We want to remove/comment out all mentions of the <codeclass="docutils literal notranslate"><spanclass="pre">decouple</span></code> package, which Evennia doesn’t use (we use <codeclass="docutils literal notranslate"><spanclass="pre">private_settings.py</span></code> to hide away settings that should not be shared).</p>
<p>Comment out <codeclass="docutils literal notranslate"><spanclass="pre">from</span><spanclass="pre">decouple</span><spanclass="pre">import</span><spanclass="pre">config</span></code> by adding a <codeclass="docutils literal notranslate"><spanclass="pre">#</span></code> to the start of the line: <codeclass="docutils literal notranslate"><spanclass="pre">#</span><spanclass="pre">from</span><spanclass="pre">decouple</span><spanclass="pre">import</span><spanclass="pre">config</span></code>. Then search for <codeclass="docutils literal notranslate"><spanclass="pre">config(</span></code> in the file and comment out all lines where this is used. Many of these are specific to the server environment where the original Arx runs, so is not that relevant to us.</p>
</section>
<sectionid="install-arx-dependencies">
<h3>Install Arx dependencies<aclass="headerlink"href="#install-arx-dependencies"title="Permalink to this headline">¶</a></h3>
<p>Arx has some further dependencies beyond vanilla Evennia. Start by <codeclass="docutils literal notranslate"><spanclass="pre">cd</span></code>:ing to the root of your
<div><p>If you run <em>Linux</em> or <em>Mac</em>: Edit <codeclass="docutils literal notranslate"><spanclass="pre">myarx/requirements.txt</span></code> and comment out the line
<codeclass="docutils literal notranslate"><spanclass="pre">pypiwin32==219</span></code> - it’s only needed on Windows and will give an error on other platforms.</p>
</div></blockquote>
<p>Make sure your <codeclass="docutils literal notranslate"><spanclass="pre">virtualenv</span></code> is active, then run</p>
<p>The needed Python packages will be installed for you.</p>
</section>
<sectionid="adding-logs-folder">
<h3>Adding logs/ folder<aclass="headerlink"href="#adding-logs-folder"title="Permalink to this headline">¶</a></h3>
<p>The Arx repo does not contain the <codeclass="docutils literal notranslate"><spanclass="pre">myarx/server/logs/</span></code> folder Evennia expects for storing server
<p>If all goes well Evennia will now start up, running Arx! You can connect to it on <codeclass="docutils literal notranslate"><spanclass="pre">localhost</span></code> (or <codeclass="docutils literal notranslate"><spanclass="pre">127.0.0.1</span></code> if your platform doesn’t alias <codeclass="docutils literal notranslate"><spanclass="pre">localhost</span></code>), port <codeclass="docutils literal notranslate"><spanclass="pre">4000</span></code> using a Telnet client. Alternatively, you can use your web browser to browse to <codeclass="docutils literal notranslate"><spanclass="pre">http://localhost:4001</span></code> to see the game’s website and get to the web client.</p>
<p>When you log in you’ll get the standard Evennia greeting (since the database is empty), but you can
try <codeclass="docutils literal notranslate"><spanclass="pre">help</span></code> to see that it’s indeed Arx that is running.</p>
</section>
<sectionid="additional-setup-steps">
<h3>Additional Setup Steps<aclass="headerlink"href="#additional-setup-steps"title="Permalink to this headline">¶</a></h3>
<p>The first time you start Evennia after creating the database with the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">migrate</span></code> step above,
it should create a few starting objects for you - your superuser account, which it will prompt you
to enter, a starting room (Limbo), and a character object for you. If for some reason this does not
occur, you may have to follow the steps below. For the first time Superuser login you may have to
run steps 7-8 and 10 to create and connect to your in-came Character.</p>
<olclass="simple">
<li><p>Login to the game website with your Superuser account.</p></li>
<li><p>Press the <codeclass="docutils literal notranslate"><spanclass="pre">Admin</span></code> button to get into the (Django-) Admin Interface.</p></li>
<li><p>Navigate to the <codeclass="docutils literal notranslate"><spanclass="pre">Accounts</span></code> section.</p></li>
<li><p>Add a new Account named for the new staffer. Use a place holder password and dummy e-mail
address.</p></li>
<li><p>Flag account as <codeclass="docutils literal notranslate"><spanclass="pre">Staff</span></code> and apply the <codeclass="docutils literal notranslate"><spanclass="pre">Admin</span></code> permission group (This assumes you have already set up an Admin Group in Django).</p></li>
<li><p>Add Tags named <codeclass="docutils literal notranslate"><spanclass="pre">player</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">developer</span></code>.</p></li>
<li><p>Log into the game using the web client (or a third-party telnet client) using your superuser account. Move to where you want the new staffer character to appear.</p></li>
<li><p>In the game client, run <codeclass="docutils literal notranslate"><spanclass="pre">@create/drop</span><spanclass="pre"><staffername>:typeclasses.characters.Character</span></code>, where <codeclass="docutils literal notranslate"><spanclass="pre"><staffername></span></code> is usually the same name you used for the Staffer account you created in the Admin earlier (if you are creating a Character for your superuser, use your superuser account name). This creates a new in-game Character and places it in your current location.</p></li>
<li><p>Have the new Admin player log into the game.</p></li>
<li><p>Have the new Admin puppet the character with <codeclass="docutils literal notranslate"><spanclass="pre">@ic</span><spanclass="pre">StafferName</span></code>.</p></li>
<li><p>Have the new Admin change their password - <codeclass="docutils literal notranslate"><spanclass="pre">@password</span><spanclass="pre"><old</span><spanclass="pre">password></span><spanclass="pre">=</span><spanclass="pre"><new</span><spanclass="pre">password></span></code>.</p></li>
</ol>
<p>Now that you have a Character and an Account object, there’s a few additional things you may need to do in order for some commands to function properly. You can either execute these as in-game commands while <codeclass="docutils literal notranslate"><spanclass="pre">ic</span></code> (controlling your character object).</p>
<divclass="highlight-none notranslate"><divclass="highlight"><pre><span></span>py from web.character.models import RosterEntry;RosterEntry.objects.create(player=self.player, character=self)
py from world.dominion.models import PlayerOrNpc, AssetOwner;dompc = PlayerOrNpc.objects.create(player=self.player);AssetOwner.objects.create(player=dompc)
</pre></div>
</div>
<p>Those steps will give you ‘RosterEntry’, ‘PlayerOrNpc’, and ‘AssetOwner’ objects. RosterEntry
explicitly connects a character and account object together, even while offline, and contains
additional information about a character’s current presence in game (such as which ‘roster’ they’re
in, if you choose to use an active roster of characters). PlayerOrNpc are more character extensions, as well as support for npcs with no in-game presence and just represented by a name which can be offscreen members of a character’s family. It also allows for membership in Organizations. AssetOwner holds information about a character or organization’s money and resources.</p>
</section>
</section>
<sectionid="alternate-windows-install-guide">
<h2>Alternate Windows install guide<aclass="headerlink"href="#alternate-windows-install-guide"title="Permalink to this headline">¶</a></h2>
<p><em>Contributed by Pax</em></p>
<p>If for some reason you cannot use the Windows Subsystem for Linux (which would use instructions identical to the ones above), it’s possible to get Evennia/Arx running under Anaconda for Windows. The process is a little bit trickier.</p>
<p>Make sure you have:</p>
<ul>
<li><p>Git for Windows <aclass="reference external"href="https://git-scm.com/download/win">https://git-scm.com/download/win</a></p></li>
<li><p>Anaconda for Windows <aclass="reference external"href="https://www.anaconda.com/distribution/">https://www.anaconda.com/distribution/</a></p></li>
<li><p>VC++ Compiler for Python 2.7 <aclass="reference external"href="https://aka.ms/vcpython27">https://aka.ms/vcpython27</a></p>
<p>conda update conda
conda create -n arx python=2.7
source activate arx</p>
</li>
</ul>
<p>Set up a convenient repository place for things.</p>
<p>Now hit <aclass="reference external"href="https://github.com/evennia/evennia/wiki/Arxcode-installing-help">https://github.com/evennia/evennia/wiki/Arxcode-installing-help</a> and
change the setup stuff as in the ‘Clean up settings’ section.</p>
<pclass="last">You are reading an old version of the Evennia documentation. <ahref="https://www.evennia.com/docs/latest/index.html">The latest version is here</a></p>.