<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>Inline functions<aclass="headerlink"href="#inline-functions"title="Permalink to this headline">¶</a></h1>
<asideclass="sidebar">
<p>For much more information about inline functions, see the <aclass="reference internal"href="../Components/FuncParser.html"><spanclass="doc std std-doc">FuncParser</span></a> documentation</p>
</aside>
<p><em>Inline functions</em>, also known as <em>funcparser functions</em> are embedded strings on the form</p>
<divclass="highlight-none notranslate"><divclass="highlight"><pre><span></span>> say the answer is $eval(24 * 12)!
You say, "the answer is 288!"
</pre></div>
</div>
<p>General processing of outgoing strings is disabled by default. To activate inline-function parsing of outgoing strings, add this to your settings file:</p>
<p>Inline functions are provided by the <aclass="reference internal"href="../Components/FuncParser.html"><spanclass="doc std std-doc">FuncParser</span></a>. It is enabled in a few other situations:</p>
<ulclass="simple">
<li><p>Processing of <aclass="reference internal"href="../Components/Prototypes.html"><spanclass="doc std std-doc">Prototypes</span></a>; these ‘prototypefuncs’ allow for prototypes whose values change dynamically upon spawning. For example, you would set <codeclass="docutils literal notranslate"><spanclass="pre">{key:</span><spanclass="pre">'$choice(["Bo",</span><spanclass="pre">"Anne",</span><spanclass="pre">"Tom"])'</span></code> and spawn a random-named character every time.</p></li>
<li><p>Processing of strings to the <codeclass="docutils literal notranslate"><spanclass="pre">msg_contents</span></code> method. This allows for <aclass="reference internal"href="Change-Message-Per-Receiver.html"><spanclass="doc std std-doc">sending different messages depending on who will see them</span></a>.</p></li>
<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>.