<p>Softcode is a very simple programming language that was created for in-game development on TinyMUD derivatives such as MUX, PennMUSH, TinyMUSH, and RhostMUSH. The idea is that by providing a stripped down, minimalistic language for in-game use, you can allow quick and easy building and game development to happen without having to learn C/C++. There is an added benefit of not having to have to hand out shell access to all developers, and permissions can be used to alleviate many security problems.</p>
<p>Pasting this into a MUX/MUSH and typing ‘hello’ will theoretically yield ‘Hello World!’, assuming
certain flags are not set on your account object.</p>
<p>Setting attributes is done via <codeclass="docutils literal notranslate"><spanclass="pre">@set</span></code>. Softcode also allows the use of the ampersand (<codeclass="docutils literal notranslate"><spanclass="pre">&</span></code>) symbol.
<p>Perhaps I want to break the Hello World into an attribute which is retrieved when emitting:</p>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span><spanclass="p">&</span>HELLO_VALUE.D <spanclass="nv">me</span><spanclass="o">=</span>Hello World
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">v()</span></code> function returns the <codeclass="docutils literal notranslate"><spanclass="pre">HELLO_VALUE.D</span></code> attribute on the object that the command resides
(<codeclass="docutils literal notranslate"><spanclass="pre">me</span></code>, which is yourself in this case). This should yield the same output as the first example.</p>
<p>If you are still curious about how Softcode works, take a look at some external resources:</p>
<p>Softcode is excellent at what it was intended for: <em>simple things</em>. It is a great tool for making an interactive object, a room with ambiance, simple global commands, simple economies and coded systems. However, once you start to try to write something like a complex combat system or a higher end economy, you’re likely to find yourself buried under a mountain of functions that span multiple objects across your entire code.</p>
<p>Not to mention, softcode is not an inherently fast language. It is not compiled, it is parsed with each calling of a function. While MUX and MUSH parsers have jumped light years ahead of where they once were they can still stutter under the weight of more complex systems if not designed properly.</p>
<p>Now that starting text-based games is easy and an option for even the most technically inarticulate, new projects are a dime a dozen. People are starting new MUDs every day with varying levels of commitment and ability. Because of this shift from fewer, larger, well-staffed games to a bunch of small, one or two developer games, some of the benefit of softcode fades.</p>
<p>Softcode is great in that it allows a mid to large sized staff all work on the same game without stepping on one another’s toes. As mentioned before, shell access is not necessary to develop a MUX or a MUSH. However, now that we are seeing a lot more small, one or two-man shops, the issue of shell access and stepping on each other’s toes is a lot less.</p>
on objects but complex systems may be organized neatly into real source code modules, sub-modules, or even broken out into entire Python packages as desired.</p>
<p>So what is <em>not</em> included in Evennia is a MUX/MOO-like online player-coding system. Advanced coding in Evennia is primarily intended to be done outside the game, in full-fledged Python modules. Advanced building is best handled by extending Evennia’s command system with your own sophisticated building commands. We feel that with a small development team you are better off using a professional source-control system (svn, git, bazaar, mercurial etc) anyway.</p>
<p>Adding advanced and flexible building commands to your game is easy and will probably be enough to satisfy most creative builders. However, if you really, <em>really</em> want to offer online coding, there is of course nothing stopping you from adding that to Evennia, no matter our recommendations. You could even re-implement MUX’ softcode in Python should you be very ambitious. The <aclass="reference internal"href="../Contribs/Contrib-Ingame-Python.html"><spanclass="doc std std-doc">in-game-python</span></a> is an optional pseudo-softcode plugin aimed at developers wanting to script their game from inside it.</p>