nakedmud-mod/
nakedmud-mod/html/tutorials/
nakedmud-mod/html/tutorials/building_extras/
nakedmud-mod/html/tutorials/c/
nakedmud-mod/html/tutorials/reference/
nakedmud-mod/html/tutorials/scripting/
nakedmud-mod/html/tutorials/scripting_extras/
nakedmud-mod/lib/
nakedmud-mod/lib/help/A/
nakedmud-mod/lib/help/B/
nakedmud-mod/lib/help/C/
nakedmud-mod/lib/help/D/
nakedmud-mod/lib/help/G/
nakedmud-mod/lib/help/H/
nakedmud-mod/lib/help/J/
nakedmud-mod/lib/help/L/
nakedmud-mod/lib/help/M/
nakedmud-mod/lib/help/O/
nakedmud-mod/lib/help/P/
nakedmud-mod/lib/help/R/
nakedmud-mod/lib/help/S/
nakedmud-mod/lib/help/W/
nakedmud-mod/lib/logs/
nakedmud-mod/lib/misc/
nakedmud-mod/lib/players/
nakedmud-mod/lib/pymodules/polc/
nakedmud-mod/lib/txt/
nakedmud-mod/lib/world/
nakedmud-mod/lib/world/zones/examples/
nakedmud-mod/lib/world/zones/examples/mproto/
nakedmud-mod/lib/world/zones/examples/oproto/
nakedmud-mod/lib/world/zones/examples/reset/
nakedmud-mod/lib/world/zones/examples/rproto/
nakedmud-mod/lib/world/zones/examples/trigger/
nakedmud-mod/lib/world/zones/limbo/
nakedmud-mod/lib/world/zones/limbo/room/
nakedmud-mod/lib/world/zones/limbo/rproto/
nakedmud-mod/src/alias/
nakedmud-mod/src/dyn_vars/
nakedmud-mod/src/editor/
nakedmud-mod/src/example_module/
nakedmud-mod/src/help2/
nakedmud-mod/src/set_val/
nakedmud-mod/src/socials/
nakedmud-mod/src/time/
<html>
<head>
<link href="../tutorial.css" rel="stylesheet" type="text/css">
</head>
<body>

<div class="header">
The NakedMud Tutorial :: Content Scripts
</div>

<!-- content starts here -->
<div class="content-wrap"><div class="content-body-wrap"><div class="content">
<div class="head">mpedit, opedit, and rpedit</div>
<div class="info">
Just about everything in NakedMud is scriptable. In fact, the mere creation of
a room, object, or mobile is just a script being run. Since scripts typically 
deal with rooms, objects, and mobiles, let's start by viewing a mobile's 
generation script. Create a mobile. Give it keywords, a name, a room 
description, and a regular description. Set its race and gender. Then enter the
script editor for it:
<pre class="mud">
> <font class="cmd">mpedit enforcer@moonhaven</font>
</pre>
The 'p' stands for prototype. The scripts that generate game content are
refered to as prototypes. When you use this command, you will see a few 
options to edit. Among them, will be a block of code that looks like this:
<pre class="code">
### The following mproto was generated by medit
### If you edit this script, adhere to the stylistic
### conventions laid out by medit, or delete the top line

### keywords, short descs, room descs, and look descs
me.keywords = "enforcer"  + ", " + me.keywords
me.name     = "an enforcer"
me.rdesc    = "A Moonhaven enforcer is here, keeping the peace."
me.desc     = me.desc + " " + "He is a big brute of a man, with a thickset square 
jaw and big bushy eyebrows. A couple days of stubble covers his face, and he has
a look about him that  suggests he can't wait until you do something bad so he 
has an excuse to pound  your face in with his mace."

### race and gender
me.race     = "human"
me.gender   = "male"
</pre>
Rooms, objects, and mobiles are generated by creating a blank slate copy, and
then running a script over it to assign values. When a builder edits something, 
what they are actually doing is filling in the blanks for a script that will 
later be run.
<p><p/>
One thing to note here is that the mobile is referred to as 'me'. When a script
is run over something, the thing it is being run over is always referred to as
'me', regardless of what it is. Other common script variables will be 
introduced later. 
<p><p/>
A caveat also comes with this command. Every time OLC is opened, it must be
able to properly parse the script that generates a piece of content. This means
reliably knowing that its formatting rules are adhered to. If you do not know
what those rules are, it is highly suggest you only use mpedit, opedit, and
rpedit to view code, and never to edit it. Code can be appended to content
prototypes through the OLC editor (every menu has an 'extra code' section that
you can write in). If you have the need to add extra scripting to content, do
it this way.
</div>



<!-- content ends here-->
</div></div></div>

<!-- navigation starts here -->
<div class="nav-wrap"><div class="nav">
<iframe src="nav.html" height="100%" width="100%" scrolling=no frameborder=0>
</iframe>
<!-- navigation ends here -->
</div></div>

<!--div class="footer">Edit Date: Nov 15, 2008. By Geoff Hollis</div-->
</body>
</html>