<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.sandboxgamemaker.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kddekadenz</id>
		<title>Platinum Arts Sandbox Free 3D Game Maker - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.sandboxgamemaker.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kddekadenz"/>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Special:Contributions/Kddekadenz"/>
		<updated>2026-05-02T22:05:31Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=PAS_to_Blender&amp;diff=1941</id>
		<title>PAS to Blender</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=PAS_to_Blender&amp;diff=1941"/>
				<updated>2012-11-18T16:08:48Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Exporting a PAS map to Blender&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
1.) Press T and type /writeobj modelname&lt;br /&gt;
&lt;br /&gt;
2.) Close Sandbox - if you use the standalone version, you can find the model as .obj in your Sandbox main directory&lt;br /&gt;
&lt;br /&gt;
3.) Import the .obj in Blender&lt;br /&gt;
&lt;br /&gt;
[[File:Pas_to_blender4.jpg]]&lt;br /&gt;
&lt;br /&gt;
4.) Switch to textured view&lt;br /&gt;
&lt;br /&gt;
[[File:Pas_to_blender2.jpg]]&lt;br /&gt;
&lt;br /&gt;
5.) Merge the textures into the blend&lt;br /&gt;
&lt;br /&gt;
[[File:Pas_to_blender3.jpg]]&lt;br /&gt;
&lt;br /&gt;
6.) Save the blend&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
optionally: export the textures to the same folder&lt;br /&gt;
&lt;br /&gt;
[[File:Pas_to_blender1.jpg]]&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=PAS_to_Blender&amp;diff=1934</id>
		<title>PAS to Blender</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=PAS_to_Blender&amp;diff=1934"/>
				<updated>2012-11-10T18:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: Created page with &amp;#039;&amp;#039;&amp;#039;&amp;#039;Exporting a PAS map to Blender&amp;#039;&amp;#039;&amp;#039;  1.) Press T and type /writeobj modelname  2.) Close Sandbox - if you use the standalone version, you can find the model as .obj in your Sand…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Exporting a PAS map to Blender&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
1.) Press T and type /writeobj modelname&lt;br /&gt;
&lt;br /&gt;
2.) Close Sandbox - if you use the standalone version, you can find the model as .obj in your Sandbox main directory&lt;br /&gt;
&lt;br /&gt;
3.) Import the .obj in Blender&lt;br /&gt;
&lt;br /&gt;
4.) Switch to textured view&lt;br /&gt;
&lt;br /&gt;
5.) Merge the textures into the blend&lt;br /&gt;
&lt;br /&gt;
6.) Save the blend&lt;br /&gt;
&lt;br /&gt;
optionally: export the textures to the same folder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gonna add some pics soon ;)&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Tutorials_List&amp;diff=1933</id>
		<title>Tutorials List</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Tutorials_List&amp;diff=1933"/>
				<updated>2012-11-10T18:21:07Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Models and Sandbox */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A list of tutorials created and edited by our contributors. &lt;br /&gt;
Contribute by improving the tutorials and creating tutorials for the red links&lt;br /&gt;
== Getting, Installing and opening Sandbox ==&lt;br /&gt;
&lt;br /&gt;
* [[Downloading Sandbox]]&lt;br /&gt;
* [[Installing Sandbox]]&lt;br /&gt;
* [[Running Sandbox]]&lt;br /&gt;
* [[development|Obtaining the development version]]&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
&lt;br /&gt;
* [[FPS|FPS - First Person Shooter (default)]]&lt;br /&gt;
* [[SSP|SSP - Side Scrolling Platformer]]&lt;br /&gt;
* [[RPG|RPG - Role Playing Game]]&lt;br /&gt;
** [[RPG tutorial|RPG Tutorial]]&lt;br /&gt;
* [[MovieCube|MovieCube - Machinima Tool]]&lt;br /&gt;
* [[Vehicle Simulator]]&lt;br /&gt;
&lt;br /&gt;
== Learning the editor basics ==&lt;br /&gt;
&lt;br /&gt;
* [[Map Editing Basics]]&lt;br /&gt;
* [[How to change textures in your map]]&lt;br /&gt;
* [[How to place 3D grass]]&lt;br /&gt;
* [[How to add lava, water, glass and other materials to your map]]&lt;br /&gt;
* [[How to make ramps, bridges, and angles]]&lt;br /&gt;
* [[How to make invisible boundaries]]&lt;br /&gt;
* [[Tips on making a good map]]&lt;br /&gt;
* [[Gridwork]]&lt;br /&gt;
&lt;br /&gt;
=== Buildings ===&lt;br /&gt;
&lt;br /&gt;
* [[How to make sloped roofs]]&lt;br /&gt;
* [[How to make secret doors, walls &amp;amp; floors]]&lt;br /&gt;
* [[How to make 1-way windows only you can see out of]]&lt;br /&gt;
* [[How to make 1-way doors]]&lt;br /&gt;
* [[How to create a hollow tower/tube]]&lt;br /&gt;
* [[How to make stairs you could walk up]]&lt;br /&gt;
* [[How to create set of glass stairs]]&lt;br /&gt;
* [[How to make a TV]]&lt;br /&gt;
* [[How to make various window shapes]]&lt;br /&gt;
* [[How to create a spiral staircase]]&lt;br /&gt;
* [[How to make a pyramid/four-sided sloped roof]]&lt;br /&gt;
&lt;br /&gt;
=== Terrain editing ===&lt;br /&gt;
&lt;br /&gt;
* [[How to create mountains, ponds, and oceans]]&lt;br /&gt;
* [[How to transfer parts of a map to a new one]]&lt;br /&gt;
* [[How to make a forest]]&lt;br /&gt;
* [[How to make a cave]]&lt;br /&gt;
* [[How to make a realistic river]]&lt;br /&gt;
* [[How to make a swimming pool]]&lt;br /&gt;
* [[How to make a fountain]]&lt;br /&gt;
* [[How to create smooth curvy pathways]]&lt;br /&gt;
* [[How to create fields with flower patches]]&lt;br /&gt;
* [[How to create a camp fire and fireplace]]&lt;br /&gt;
* [[How to make a bumpy road]]&lt;br /&gt;
* [[How to make various types of fences]]&lt;br /&gt;
* [[How to make a nice waterfall]]&lt;br /&gt;
* [[How to edit terrain properly]]&lt;br /&gt;
* [[How to fix bad terrain or geometry errors]]&lt;br /&gt;
* [[How to make railings]]&lt;br /&gt;
* [[Texture Blending]]&lt;br /&gt;
&lt;br /&gt;
=== Advanced Editor Techniques===&lt;br /&gt;
&lt;br /&gt;
* [[How to create a slide]]&lt;br /&gt;
* [[How to create a trampoline]]&lt;br /&gt;
* [[How to create electric fences]]&lt;br /&gt;
* [[How to make a sphere shapes in &amp;#039;edit mode&amp;#039;]]&lt;br /&gt;
* [[How to make curved shapes in &amp;#039;edit mode&amp;#039;]]&lt;br /&gt;
* [[How to create curved glass]]&lt;br /&gt;
* [[How to create climbable ladders and vertical walls]]&lt;br /&gt;
* [[How to make an endless slide]]&lt;br /&gt;
* [[How to create lens flares]]&lt;br /&gt;
* [[How to make a snowman]]&lt;br /&gt;
* [[How to make a boat]]&lt;br /&gt;
* [[How to create warp speed tunnels]]&lt;br /&gt;
* [[How to create hidden teleports]]&lt;br /&gt;
* [[How to create spinning palm trees]]&lt;br /&gt;
* [[How to change gravity]]&lt;br /&gt;
&lt;br /&gt;
== Lighting and Particle effects ==&lt;br /&gt;
&lt;br /&gt;
* [[How to add various lighting]]&lt;br /&gt;
* [[Lighting|How to light a map properly]]&lt;br /&gt;
* [[Tips to make a night time map]]&lt;br /&gt;
* [[Tips to make a morning map]]&lt;br /&gt;
* [[Tips to make a sunset map]]&lt;br /&gt;
* [[How to add particle effects]]&lt;br /&gt;
* [[How to create snow or rain]]&lt;br /&gt;
* [[How to put fog to a map]]&lt;br /&gt;
&lt;br /&gt;
== Models and Sandbox ==&lt;br /&gt;
&lt;br /&gt;
* [[Blender to Sandbox]]&lt;br /&gt;
* [[Wings3D to Sandbox flash tutorials]]&lt;br /&gt;
* [[Mapmodels|Loading and adding mapmodels]]&lt;br /&gt;
** [[Importing .OBJ files]]&lt;br /&gt;
* [[How to add new models]]&lt;br /&gt;
* [[PAS to Blender]]&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
* [[Adding custom textures to a new map]]&lt;br /&gt;
* [[Adding custom textures with normal maps]]&lt;br /&gt;
&lt;br /&gt;
== Scripting/Trigger tutorials ==&lt;br /&gt;
&lt;br /&gt;
=== Menu Editing - Cubescript ===&lt;br /&gt;
* [[Menu Editing|How to modify the menu]]&lt;br /&gt;
* [[Cubescript]]&lt;br /&gt;
* [[Creating easy spells]]&lt;br /&gt;
* [[Removing Editmode]]&lt;br /&gt;
* [[Adding Custom Skyboxes]]&lt;br /&gt;
=== Maptitle and authors ===&lt;br /&gt;
* [[How to add map title and author]]&lt;br /&gt;
* [[How to change color of text in maps welcome message]]&lt;br /&gt;
&lt;br /&gt;
=== FPS Scripting ===&lt;br /&gt;
&lt;br /&gt;
* [[Creating a shop script]]&lt;br /&gt;
* [[How to make characters talk with text pop-up windows]]&lt;br /&gt;
* [[How to make characters give you quests]]&lt;br /&gt;
* [[making picked up items visible in your inventory]]&lt;br /&gt;
* [[How to make a trigger load another map]]&lt;br /&gt;
* [[Making Echoes]]&lt;br /&gt;
* [[How to make triggered elevators/platforms]]&lt;br /&gt;
* [[How to make items that can be picked up]]&lt;br /&gt;
&lt;br /&gt;
=== RPG Scripting ===&lt;br /&gt;
* [[RPG commands]]&lt;br /&gt;
* [[RPG configuration]]&lt;br /&gt;
* [[RPG script]]&lt;br /&gt;
&lt;br /&gt;
== Source Code Modifying + Recompiling ==&lt;br /&gt;
&lt;br /&gt;
* [[Compiling the source code]]&lt;br /&gt;
* [[How to get a mapsize greater than 16]]&lt;br /&gt;
* [[How to add creatures]] &lt;br /&gt;
* [[How to add more player character models]]&lt;br /&gt;
&lt;br /&gt;
== Multiplayer tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[How to host a coop edit session over the internet]]&lt;br /&gt;
* [[How to host a persistent world in Sandbox over the internet]]&lt;br /&gt;
* [[How to monitor your dedicated server without being in it]]&lt;br /&gt;
&lt;br /&gt;
== Unsorted tutorials ==&lt;br /&gt;
* [[Transferring your Map to a new version of Sandbox]] &lt;br /&gt;
* [[How to save a map properly]]&lt;br /&gt;
* [[How to add projectiles to your game]]&lt;br /&gt;
* [[How to automatically save your map every x number of minutes]]&lt;br /&gt;
&lt;br /&gt;
== Sandbox Related ==&lt;br /&gt;
=== Within Sandbox ===&lt;br /&gt;
* [[Guide to a good game]]&lt;br /&gt;
* [[Customizing Sandbox]]&lt;br /&gt;
* [[Adding custom songs to Sandbox]]&lt;br /&gt;
* [[Preparing your map for uploading]]&lt;br /&gt;
* [[Using Cullart]]&lt;br /&gt;
* [[How to capture screen shots and videos]]&lt;br /&gt;
* [[How to set up Sandbox for commercial use]]&lt;br /&gt;
&lt;br /&gt;
=== Outside of Sandbox ===&lt;br /&gt;
* [[Licensing]]&lt;br /&gt;
* [http://forum.sandboxgamemaker.com/viewtopic.php?f=24&amp;amp;t=1493 Copyrighting your content]&lt;br /&gt;
&lt;br /&gt;
==Content Creation==&lt;br /&gt;
* [[Why Create Content?]]&lt;br /&gt;
* [[Tips on creating content]]&lt;br /&gt;
* [[Good free programs for Sandbox]]&lt;br /&gt;
* [[Content Creation Software Tutorials List]]&lt;br /&gt;
===3D Art===&lt;br /&gt;
* [[Models Vs. Geometry]]&lt;br /&gt;
===2D Art===&lt;br /&gt;
* [[Making Seamless textures]]&lt;br /&gt;
* [[How to make new textures]]&lt;br /&gt;
* [[Creating special shader maps for textures]]&lt;br /&gt;
* [[Glowmaps]]&lt;br /&gt;
* [http://www.leighvanderbyl.com/texturing-for-dummies/ Texturing for Dummies]&lt;br /&gt;
* [http://www.cgsociety.org/index.php/CGSFeatures/CGSFeatureSpecial/the_top_ten_tips_of_texturing Top Ten Tips of Texturing]&lt;br /&gt;
* [http://forums.cgsociety.org/showthread.php?t=373024 Hard Surface Texture Painting]&lt;br /&gt;
&lt;br /&gt;
== Meta-Sandbox ==&lt;br /&gt;
* [[How to contribute to Platinum Arts Sandbox]]&lt;br /&gt;
* [[Where to find inspiration]]&lt;br /&gt;
* [[Editing the wiki]]&lt;br /&gt;
&lt;br /&gt;
* [[Creators of these tutorials]]&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_commands&amp;diff=1926</id>
		<title>RPG commands</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_commands&amp;diff=1926"/>
				<updated>2012-10-23T14:23:54Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a list of most RPG commands (wrote a small program to output them):&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpg.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
primaryattack &amp;lt;br&amp;gt;&lt;br /&gt;
secondaryattack &amp;lt;br&amp;gt;&lt;br /&gt;
hotkey &amp;lt;br&amp;gt;&lt;br /&gt;
include &amp;quot;path/to/script&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
r_rehash &amp;lt;br&amp;gt;&lt;br /&gt;
newgame &amp;quot;gamename&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
map &amp;quot;mapname&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
newmap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgai.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_action_clear &amp;lt;br&amp;gt;&lt;br /&gt;
r_action_attack &amp;lt;br&amp;gt;&lt;br /&gt;
r_action_move &amp;lt;br&amp;gt;&lt;br /&gt;
r_action_wander&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgcamera.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
cs_interp_ ## name &amp;lt;br&amp;gt;&lt;br /&gt;
cs_start &amp;lt;br&amp;gt;&lt;br /&gt;
cs_interrupt &amp;lt;br&amp;gt;&lt;br /&gt;
cs_post &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_generic &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_movedelta &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_moveset &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_movecamera &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_moveent &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewdelta &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewset &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewcamera &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewent &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_focus &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_follow &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewport &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_generic &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_translate &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_scale &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_rotate &amp;lt;br&amp;gt;&lt;br /&gt;
cs_element_text &amp;lt;br&amp;gt;&lt;br /&gt;
cs_element_image &amp;lt;br&amp;gt;&lt;br /&gt;
cs_element_solid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgconfig.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_select_ ## c &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_ ## c &amp;lt;br&amp;gt;&lt;br /&gt;
r_select_ ## c &amp;lt;br&amp;gt;&lt;br /&gt;
r_select_item_use &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_item_use &amp;lt;br&amp;gt;&lt;br /&gt;
r_script_say &amp;lt;br&amp;gt;&lt;br /&gt;
r_script_signal &amp;quot;signalname&amp;quot; [code] &amp;lt;br&amp;gt;&lt;br /&gt;
r_mapscript_signal &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addgeneric &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addpolymorph &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addlight &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addsignal &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addscript &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_get_effect &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_num_effect &amp;lt;br&amp;gt;&lt;br /&gt;
r_item_use_new_consumable - does not work yet&amp;lt;br&amp;gt;&lt;br /&gt;
r_item_use_new_armour &amp;lt;br&amp;gt;&lt;br /&gt;
r_item_use_new_weapon &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_add_ingredient &amp;quot;item index&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_add_catalyst &amp;quot;item index&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_add_product &amp;quot;item index&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_get_ingredient &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_get_catalyst &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_get_product &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_num_ingredient &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_num_catalyst &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_num_product &amp;lt;br&amp;gt;&lt;br /&gt;
r_ammo_add_item &amp;lt;br&amp;gt;&lt;br /&gt;
r_ammo_num_item &amp;lt;br&amp;gt;&lt;br /&gt;
r_ammo_get_item &amp;lt;br&amp;gt;&lt;br /&gt;
r_faction_set_relation &amp;lt;br&amp;gt;&lt;br /&gt;
r_faction_get_relation &amp;lt;br&amp;gt;&lt;br /&gt;
r_global_new &amp;quot;value&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
r_tip_new &amp;quot;text of tip&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
r_cat_new &amp;quot;categoryname&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpggui.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_get &amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_value &amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_add &amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_get &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_value &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_add &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_dotrade &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_dialogue &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_response &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_response &amp;lt;br&amp;gt;&lt;br /&gt;
r_trigger_response &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpghud.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_minimap &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_horizbar &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_vertbar &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_text &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_image &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_solid&lt;br /&gt;
r_hud&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgscript.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_stack &amp;lt;br&amp;gt;&lt;br /&gt;
r_sleep &amp;lt;time&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
worlduse &amp;lt;br&amp;gt;&lt;br /&gt;
r_cansee &amp;lt;actor reference&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
r_preparemap &amp;quot;mapname&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
r_reftype &amp;lt;br&amp;gt;&lt;br /&gt;
r_registerref &amp;lt;br&amp;gt;&lt;br /&gt;
r_registertemp &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref &amp;lt;br&amp;gt;&lt;br /&gt;
r_swapref &amp;lt;br&amp;gt;&lt;br /&gt;
r_matchref &amp;lt;br&amp;gt;&lt;br /&gt;
r_ref_len &amp;lt;br&amp;gt;&lt;br /&gt;
r_ref_push &amp;lt;br&amp;gt;&lt;br /&gt;
r_ref_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_global_get $globalname&amp;lt;br&amp;gt;&lt;br /&gt;
r_global_set $globalname value&amp;lt;br&amp;gt;&lt;br /&gt;
r_cat_get &amp;lt;item index&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_maps &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_ents &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_aeffects &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_inv &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref_invstack &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref_inv &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_equip &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref_equip &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_veffects &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_attr &amp;lt;actor reference&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
r_get_skill &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_weight &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_name &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_type &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_base &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_use &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_state &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_pos &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_faction &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_add_effect &amp;lt;br&amp;gt;&lt;br /&gt;
r_kill &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_resurrect &amp;lt;actor reference&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_pickup &amp;lt;br&amp;gt;&lt;br /&gt;
r_additem &amp;lt;actor reference&amp;gt; &amp;lt;item index&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_amount &amp;lt;actor reference&amp;gt; &amp;lt;item index&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
r_drop &amp;lt;br&amp;gt;&lt;br /&gt;
r_remove &amp;lt;actor reference&amp;gt; &amp;lt;item index&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
r_canequip &amp;lt;br&amp;gt;&lt;br /&gt;
r_equip &amp;lt;br&amp;gt;&lt;br /&gt;
r_dequip &amp;lt;br&amp;gt;&lt;br /&gt;
r_transfer &amp;lt;br&amp;gt;&lt;br /&gt;
r_trigger &amp;lt;br&amp;gt;&lt;br /&gt;
r_destroy &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_mana &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxmana &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_manaregen &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_health &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxhealth &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_healthregen &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_resist &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_thresh &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_neededexp &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxweight &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxspeed &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_jumpvel &amp;lt;br&amp;gt;&lt;br /&gt;
r_invest_attr &amp;lt;br&amp;gt;&lt;br /&gt;
r_invest_skill &amp;lt;br&amp;gt;&lt;br /&gt;
r_givexp &amp;lt;actor reference&amp;gt; &amp;lt;item index&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_lastaction &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_charge &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_primary &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_secondary &amp;lt;br&amp;gt;&lt;br /&gt;
r_check_recipe &amp;lt;br&amp;gt;&lt;br /&gt;
r_use_recipe &amp;lt;br&amp;gt;&lt;br /&gt;
r_learn_recipe &amp;lt;br&amp;gt;&lt;br /&gt;
r_chat &amp;lt;br&amp;gt;&lt;br /&gt;
r_response &amp;quot;message&amp;quot; &amp;quot;node&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
r_trade &amp;lt;br&amp;gt;&lt;br /&gt;
r_loot &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_ents &amp;lt;br&amp;gt;&lt;br /&gt;
r_on_map &amp;lt;br&amp;gt;&lt;br /&gt;
r_spawn_ ## type &amp;lt;br&amp;gt;&lt;br /&gt;
r_teleport &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_group &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_owner &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_num &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_duration &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_remain &amp;lt;br&amp;gt;&lt;br /&gt;
r_sound &amp;quot;path/to/sound&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
r_journal_record &amp;lt;br&amp;gt;&lt;br /&gt;
r_journal_loop_buckets &amp;lt;br&amp;gt;&lt;br /&gt;
r_journal_loop_entries&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_commands&amp;diff=1891</id>
		<title>RPG commands</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_commands&amp;diff=1891"/>
				<updated>2012-10-07T16:08:37Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: Created page with &amp;#039;Here is a list of most RPG commands (wrote a small program to output them):  &amp;#039;&amp;#039;rpg.cpp&amp;#039;&amp;#039; &amp;lt;code&amp;gt; &amp;lt;br&amp;gt; primaryattack &amp;lt;br&amp;gt; secondaryattack &amp;lt;br&amp;gt; hotkey &amp;lt;br&amp;gt; include &amp;lt;br&amp;gt; r_rehash &amp;lt;br…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is a list of most RPG commands (wrote a small program to output them):&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpg.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
primaryattack &amp;lt;br&amp;gt;&lt;br /&gt;
secondaryattack &amp;lt;br&amp;gt;&lt;br /&gt;
hotkey &amp;lt;br&amp;gt;&lt;br /&gt;
include &amp;lt;br&amp;gt;&lt;br /&gt;
r_rehash &amp;lt;br&amp;gt;&lt;br /&gt;
newgame &amp;lt;br&amp;gt;&lt;br /&gt;
map &amp;lt;br&amp;gt;&lt;br /&gt;
newmap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgai.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_action_clear &amp;lt;br&amp;gt;&lt;br /&gt;
r_action_attack &amp;lt;br&amp;gt;&lt;br /&gt;
r_action_move &amp;lt;br&amp;gt;&lt;br /&gt;
r_action_wander&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgcamera.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
cs_interp_ ## name &amp;lt;br&amp;gt;&lt;br /&gt;
cs_start &amp;lt;br&amp;gt;&lt;br /&gt;
cs_interrupt &amp;lt;br&amp;gt;&lt;br /&gt;
cs_post &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_generic &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_movedelta &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_moveset &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_movecamera &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_moveent &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewdelta &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewset &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewcamera &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewent &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_focus &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_follow &amp;lt;br&amp;gt;&lt;br /&gt;
cs_action_viewport &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_generic &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_translate &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_scale &amp;lt;br&amp;gt;&lt;br /&gt;
cs_container_rotate &amp;lt;br&amp;gt;&lt;br /&gt;
cs_element_text &amp;lt;br&amp;gt;&lt;br /&gt;
cs_element_image &amp;lt;br&amp;gt;&lt;br /&gt;
cs_element_solid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgconfig.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_select_ ## c &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_ ## c &amp;lt;br&amp;gt;&lt;br /&gt;
r_select_ ## c &amp;lt;br&amp;gt;&lt;br /&gt;
r_select_item_use &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_item_use &amp;lt;br&amp;gt;&lt;br /&gt;
r_script_say &amp;lt;br&amp;gt;&lt;br /&gt;
r_script_signal &amp;lt;br&amp;gt;&lt;br /&gt;
r_mapscript_signal &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addgeneric &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addpolymorph &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addlight &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addsignal &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_addscript &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_get_effect &amp;lt;br&amp;gt;&lt;br /&gt;
r_status_num_effect &amp;lt;br&amp;gt;&lt;br /&gt;
r_item_use_new_consumable &amp;lt;br&amp;gt;&lt;br /&gt;
r_item_use_new_armour &amp;lt;br&amp;gt;&lt;br /&gt;
r_item_use_new_weapon &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_add_ingredient &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_add_catalyst &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_add_product &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_get_ingredient &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_get_catalyst &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_get_product &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_num_ingredient &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_num_catalyst &amp;lt;br&amp;gt;&lt;br /&gt;
r_recipe_num_product &amp;lt;br&amp;gt;&lt;br /&gt;
r_ammo_add_item &amp;lt;br&amp;gt;&lt;br /&gt;
r_ammo_num_item &amp;lt;br&amp;gt;&lt;br /&gt;
r_ammo_get_item &amp;lt;br&amp;gt;&lt;br /&gt;
r_faction_set_relation &amp;lt;br&amp;gt;&lt;br /&gt;
r_faction_get_relation &amp;lt;br&amp;gt;&lt;br /&gt;
r_global_new &amp;lt;br&amp;gt;&lt;br /&gt;
r_tip_new &amp;lt;br&amp;gt;&lt;br /&gt;
r_cat_new&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpggui.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_get &amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_value &amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_add &amp;lt;br&amp;gt;&lt;br /&gt;
r_buystack_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_get &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_value &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_add &amp;lt;br&amp;gt;&lt;br /&gt;
r_sellstack_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_dotrade &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_dialogue &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_response &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_response &amp;lt;br&amp;gt;&lt;br /&gt;
r_trigger_response &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpghud.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_minimap &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_horizbar &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_vertbar &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_text &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_image &amp;lt;br&amp;gt;&lt;br /&gt;
r_hud_solid&lt;br /&gt;
r_hud&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;rpgscript.cpp&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
r_stack &amp;lt;br&amp;gt;&lt;br /&gt;
r_sleep &amp;lt;br&amp;gt;&lt;br /&gt;
worlduse &amp;lt;br&amp;gt;&lt;br /&gt;
r_cansee &amp;lt;br&amp;gt;&lt;br /&gt;
r_preparemap &amp;lt;br&amp;gt;&lt;br /&gt;
r_reftype &amp;lt;br&amp;gt;&lt;br /&gt;
r_registerref &amp;lt;br&amp;gt;&lt;br /&gt;
r_registertemp &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref &amp;lt;br&amp;gt;&lt;br /&gt;
r_swapref &amp;lt;br&amp;gt;&lt;br /&gt;
r_matchref &amp;lt;br&amp;gt;&lt;br /&gt;
r_ref_len &amp;lt;br&amp;gt;&lt;br /&gt;
r_ref_push &amp;lt;br&amp;gt;&lt;br /&gt;
r_ref_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_global_get &amp;lt;br&amp;gt;&lt;br /&gt;
r_global_set &amp;lt;br&amp;gt;&lt;br /&gt;
r_cat_get &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_maps &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_ents &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_aeffects &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_inv &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref_invstack &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref_inv &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_equip &amp;lt;br&amp;gt;&lt;br /&gt;
r_setref_equip &amp;lt;br&amp;gt;&lt;br /&gt;
r_loop_veffects &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_attr &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_skill &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_weight &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_name &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_type &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_base &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_use &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_state &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_pos &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_faction &amp;lt;br&amp;gt;&lt;br /&gt;
r_add_effect &amp;lt;br&amp;gt;&lt;br /&gt;
r_kill &amp;lt;br&amp;gt;&lt;br /&gt;
r_resurrect &amp;lt;br&amp;gt;&lt;br /&gt;
r_pickup &amp;lt;br&amp;gt;&lt;br /&gt;
r_additem &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_amount &amp;lt;br&amp;gt;&lt;br /&gt;
r_drop &amp;lt;br&amp;gt;&lt;br /&gt;
r_remove &amp;lt;br&amp;gt;&lt;br /&gt;
r_canequip &amp;lt;br&amp;gt;&lt;br /&gt;
r_equip &amp;lt;br&amp;gt;&lt;br /&gt;
r_dequip &amp;lt;br&amp;gt;&lt;br /&gt;
r_transfer &amp;lt;br&amp;gt;&lt;br /&gt;
r_trigger &amp;lt;br&amp;gt;&lt;br /&gt;
r_destroy &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_mana &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxmana &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_manaregen &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_health &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxhealth &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_healthregen &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_resist &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_thresh &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_neededexp &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxweight &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_maxspeed &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_jumpvel &amp;lt;br&amp;gt;&lt;br /&gt;
r_invest_attr &amp;lt;br&amp;gt;&lt;br /&gt;
r_invest_skill &amp;lt;br&amp;gt;&lt;br /&gt;
r_givexp &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_lastaction &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_charge &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_primary &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_secondary &amp;lt;br&amp;gt;&lt;br /&gt;
r_check_recipe &amp;lt;br&amp;gt;&lt;br /&gt;
r_use_recipe &amp;lt;br&amp;gt;&lt;br /&gt;
r_learn_recipe &amp;lt;br&amp;gt;&lt;br /&gt;
r_chat &amp;lt;br&amp;gt;&lt;br /&gt;
r_response &amp;lt;br&amp;gt;&lt;br /&gt;
r_trade &amp;lt;br&amp;gt;&lt;br /&gt;
r_loot &amp;lt;br&amp;gt;&lt;br /&gt;
r_num_ents &amp;lt;br&amp;gt;&lt;br /&gt;
r_on_map &amp;lt;br&amp;gt;&lt;br /&gt;
r_spawn_ ## type &amp;lt;br&amp;gt;&lt;br /&gt;
r_teleport &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_group &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_owner &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_num &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_duration &amp;lt;br&amp;gt;&lt;br /&gt;
r_get_status_remain &amp;lt;br&amp;gt;&lt;br /&gt;
r_sound &amp;lt;br&amp;gt;&lt;br /&gt;
r_journal_record &amp;lt;br&amp;gt;&lt;br /&gt;
r_journal_loop_buckets &amp;lt;br&amp;gt;&lt;br /&gt;
r_journal_loop_entries&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG&amp;diff=1890</id>
		<title>RPG</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG&amp;diff=1890"/>
				<updated>2012-10-07T15:58:10Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The RPG is currently still in heavy development with many features still unimplemented. With the advent of the 2.7.0 release it has entered the Alpha stage. It may still change dramatically in the near future, but the various interfaces at this point are more or less stable and should function correctly with future releases.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* [[RPG configuration|Configuration and Definitions]]&lt;br /&gt;
* [[RPG script|Scripting]]&lt;br /&gt;
* [[RPG_commands|Commands]]&lt;br /&gt;
* [[RPG_cutscene|Cutscenes]]&lt;br /&gt;
* [[RPG gui|GUIs]]&lt;br /&gt;
* [[RPG hud|HUDs]]&lt;br /&gt;
&lt;br /&gt;
=Tutorials=&lt;br /&gt;
* [[RPG editing|Editing tips]]&lt;br /&gt;
* [[RPG tutorial|Tutorial]]&lt;br /&gt;
&lt;br /&gt;
=Misc. pages=&lt;br /&gt;
* [[RPG todo|todo]]&lt;br /&gt;
&lt;br /&gt;
=Internals=&lt;br /&gt;
&lt;br /&gt;
The creator is capable of defining and manipulating a great many facets of his game, and future releases promise to increase these capabilities and freedoms.&lt;br /&gt;
&lt;br /&gt;
== Cutscenes ==&lt;br /&gt;
&lt;br /&gt;
Cutscenes unlike definitions can contain things other than numbers in their names and aren&amp;#039;t loaded into memory until they are needed. Cutscenes &amp;#039;&amp;#039;&amp;#039;can always be skipped&amp;#039;&amp;#039;&amp;#039; and you as the creator should therefor make sure that the post script takes care of any changes of state that need to happen, additionally during cutscenes are the only time the player can be commanded via AI commands.&lt;br /&gt;
&lt;br /&gt;
There are two parts to the cutscene system, the first is directives for the camera and the second are 2D elements to be drawn on screen and their containers.&lt;br /&gt;
&lt;br /&gt;
with respect to the 2D elements, the cutscene system functions like the HUD in this regard, fitting a proportionally scaled 1600x1200 virtual screen into yours and then adjusting the size to cover the entire screen and storing the size in the hud_right and hud_bottom variables.&lt;br /&gt;
&lt;br /&gt;
Containers basically group a series of actions together and influences them in some way (eg, rotates 2D elements). Containers are destroyed when they no longer possess any children. A very handy use for these are to allow layers. For example, you could create a slide container and a subtitle container, this will result in the subtitles always being drawn above the slides.&lt;br /&gt;
&lt;br /&gt;
== Definitions ==&lt;br /&gt;
&lt;br /&gt;
The creator can define just about anything, from creatures, monsters, maps, containers, scripts, dialogue, cutscenes, HUDs, GUIs and particle effects. The definitions are sourced from the game&amp;#039;s data directory and can be changed in real time during the game. It should be noted that unless things use these definitions as a template, any effects from ingame modifications will not persist across sessions. We therefor recommend that you only use those that accept references as any changes to them will persist unless you simply wish to test and fine tine some variables quickly and easily.&lt;br /&gt;
&lt;br /&gt;
Also note that all definitions must be defined in a separate text file named solely by a number with a .cfg extension. Any other .cfg files will throw warnings and the game will abort if there are any gaps. At least that is true for the hard-coded directories - you may add additional ones and use &amp;#039;&amp;#039;&amp;#039;include&amp;#039;&amp;#039;&amp;#039; to include their files in your scripts and definitions.&lt;br /&gt;
&lt;br /&gt;
For example, there is a definition for a bear creature with 40 strength. I might increase this to 90 in game, but any existing bears will still have 40 strength. Likewise I could create a few new bears which would then have 90 strength. if I was to save and reload my game, any new bears will have 40 strength but those spawned with 90 strength will still exist and walk about.&lt;br /&gt;
&lt;br /&gt;
== Game state ==&lt;br /&gt;
&lt;br /&gt;
All map related information, short of the map&amp;#039;s entities, waypoints and geometry are stored in a hashtable. This hashtable includes the properties of the map, the script, the name and the entities currently present as well as any queued actions that are awaiting the player&amp;#039;s arrival.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, any map besides the current map isn&amp;#039;t updated and is in a state of limbo until the player goes there.&lt;br /&gt;
&lt;br /&gt;
== GUIs ==&lt;br /&gt;
&lt;br /&gt;
The RPG defines a series of commands to facilitate the creation of custom GUIs, unlike previous iterations the GUI isn&amp;#039;t hard coded although it depends on a few hard coded names.&lt;br /&gt;
&lt;br /&gt;
Essentially all the RPG does in relation to this is to force the talk GUI open during conversations and to pause the game while a GUI is open. newui currently isn&amp;#039;t properly supported.&lt;br /&gt;
&lt;br /&gt;
== HUDs ==&lt;br /&gt;
&lt;br /&gt;
The placement of all HUD entities are defined entirely through script, the script itself is evaluated once every update and can be redefined at any part of the game using a r_hud invocation.&lt;br /&gt;
&lt;br /&gt;
The HUD pretends to be a 1600x1200 screen scaled to fit inside your screen and then has its dimensions adjusted, these dimensions are stored in the variables, hud_right and hud_bottom which you should query when you draw items offset from the bottom or the right. The only benefit of using such a size is that it&amp;#039;s far easier to get a sense of scale and to understand in general than a 0.f to 1.f range.&lt;br /&gt;
&lt;br /&gt;
In case you&amp;#039;re wondering why there is a hud_bottom and not a hud_up, the reason is that the screen coordinates are flipped and that the top left is therefor (0, 0), not the bottom left.&lt;br /&gt;
&lt;br /&gt;
== Multiplayer ==&lt;br /&gt;
&lt;br /&gt;
The RPG wasn&amp;#039;t designed to accommodate multiplayer. We may consider NWN style coop sometime in the distant future but the RPG simply lacks any multiplayer capability what so ever.&lt;br /&gt;
&lt;br /&gt;
In other words, this module is presently single player only and will likely remain so.&lt;br /&gt;
&lt;br /&gt;
== Savegames ==&lt;br /&gt;
&lt;br /&gt;
Savegames store the game state and the game definition source. Definitions and the AI&amp;#039;s state isn&amp;#039;t stored, the one exception is recipes in which a portion of the flags slot is saved. specifically the portion that tells us if the player knows the recipe.&lt;br /&gt;
&lt;br /&gt;
Otherwise, everything is saved in a compressed archive, from maps and their contents, to the various properties of each and every existing entity to the whole reference table.&lt;br /&gt;
&lt;br /&gt;
It should be noted that you cannot save at certain points, specifically during dialogue, cutscenes, in editmode and on maps with the F_NOSAVE flag set.&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
&lt;br /&gt;
Scripts are signal based, you define a signal to listen for and a set of actions to execute when that signal is received. There are several types, those the game sends on every update, those the game sends under certain conditions and those the creator manually sends himself via r_signal.&lt;br /&gt;
&lt;br /&gt;
The second and probably the most important facet of scripting is the use of references. The reference system is type safe, prone to whining (the solution is to fix what it&amp;#039;s complaining about, not ignore it) and is implemented as a layer utilising cubescript as opposed to being a part of it. &lt;br /&gt;
&lt;br /&gt;
The reference system is implemented as an array of hashtables, which introduces the concept of scope and shadowing and there are also some hard-coded reserved references. At present these are specifically, &amp;quot;player&amp;quot;, &amp;quot;curmap&amp;quot;, &amp;quot;talker&amp;quot;, &amp;quot;self&amp;quot; and &amp;quot;actor&amp;quot;, you should not change them and they will likely be read only in the near future. In addition there are also temporary references, these aren&amp;#039;t saved in the save game and are cleared at the end of the update cycle. Some of the destinations may persist for a long time but there is no such guarantee.&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1883</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1883"/>
				<updated>2012-09-02T17:17:22Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self main&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self quest&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_node &amp;quot;normal&amp;quot; [result &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;emphasis&amp;quot; [result &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;actions&amp;quot; [result &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3 - items=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 2&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 23&lt;br /&gt;
 r_item_weight 2&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 10&lt;br /&gt;
 r_item_weight 5&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 4&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4 - magic=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5 - monsters=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6 - a simple quest=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7 - a basic puzzle=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1882</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1882"/>
				<updated>2012-09-02T17:16:14Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 6 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self main&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self quest&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_node &amp;quot;normal&amp;quot; [result &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;emphasis&amp;quot; [result &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;actions&amp;quot; [result &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3 - items=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 2&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 23&lt;br /&gt;
 r_item_weight 2&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 10&lt;br /&gt;
 r_item_weight 5&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 4&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4 - magic=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5 - monsters=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6 - a simple quest=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1881</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1881"/>
				<updated>2012-09-02T17:15:34Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self main&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self quest&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_node &amp;quot;normal&amp;quot; [result &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;emphasis&amp;quot; [result &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;actions&amp;quot; [result &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3 - items=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 2&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 23&lt;br /&gt;
 r_item_weight 2&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 10&lt;br /&gt;
 r_item_weight 5&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 4&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4 - magic=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5 - monsters=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1880</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1880"/>
				<updated>2012-09-02T17:14:39Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self main&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self quest&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_node &amp;quot;normal&amp;quot; [result &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;emphasis&amp;quot; [result &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;actions&amp;quot; [result &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3 - items=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 2&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 23&lt;br /&gt;
 r_item_weight 2&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 10&lt;br /&gt;
 r_item_weight 5&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 4&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4 - magic=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1879</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1879"/>
				<updated>2012-09-02T17:13:05Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self main&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self quest&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_node &amp;quot;normal&amp;quot; [result &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;emphasis&amp;quot; [result &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;actions&amp;quot; [result &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3 - items=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 2&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 23&lt;br /&gt;
 r_item_weight 2&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 10&lt;br /&gt;
 r_item_weight 5&lt;br /&gt;
 r_item_category $cat_weap&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
 r_item_value 4&lt;br /&gt;
 r_item_weight 1&lt;br /&gt;
 r_item_category $cat_misc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1878</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1878"/>
				<updated>2012-09-02T17:07:13Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 2 - the first NPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self main&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self quest&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_node &amp;quot;normal&amp;quot; [result &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;emphasis&amp;quot; [result &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot;] []&lt;br /&gt;
  r_script_node &amp;quot;actions&amp;quot; [result &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1877</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1877"/>
				<updated>2012-09-02T17:04:03Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2 - the first NPC=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self 0&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self 2&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_say &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot; [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1876</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1876"/>
				<updated>2012-09-02T17:03:24Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1 - initial skeleton=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self 0&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self 2&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_say &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot; [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1875</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1875"/>
				<updated>2012-09-02T17:02:17Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;glad&amp;quot; //goes to the node glad&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_node &amp;quot;glad&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot;] [&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self 0&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self 2&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_say &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot; [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1874</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1874"/>
				<updated>2012-09-02T16:58:45Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Part 6 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_say &amp;quot;Hello, how are you doing&amp;quot; [ // 0 - it&amp;#039;s good practice to number your entries&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; 1 //goes to dialogue #1&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; -1 //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_say &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [ // 1&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; -1&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self 0&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self 2&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_say &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot; [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 // its type is also &amp;quot;magic&amp;quot; which means its efficiency is reduced by magic resisting items.&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg - &amp;#039;&amp;#039;the following code parts are all out of the same cfg, they are just separated for better readability&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_node &amp;quot;main&amp;quot; [result &amp;quot;Hello, how are you doing&amp;quot;] [&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; &amp;quot;howareyou&amp;quot; //goes to the node howareyou&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; &amp;quot;work&amp;quot;&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;noreward&amp;quot;&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; &amp;quot;missing&amp;quot;&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; &amp;quot;nowork&amp;quot;&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot; //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;howareyou&amp;quot; [result &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 r_script_node &amp;quot;work&amp;quot; [result &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; &amp;quot;wait&amp;quot; [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;wait&amp;quot; [result &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;noreward&amp;quot; [result &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; &amp;quot;thankyou&amp;quot; [&lt;br /&gt;
     r_remove player 7 1 //remove the mcGuffin out of players inventory&lt;br /&gt;
     r_givexp player 900 //give player some exp in return&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;thankyou&amp;quot; [result &amp;quot;Thank you very much, I will never forget this&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;missing&amp;quot; [result &amp;quot;Where is it?&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 r_script_node &amp;quot;nowork&amp;quot; [result &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
The journal is to record rumours, quest notes, deeds, obituaries and all kinds of other things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
r_journal_record &amp;quot;mcGuffin&amp;quot; &amp;quot;I shall go into the cave to the North-West of this valley and retrieve the mcGuffin.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This will add to the entry mcGuffin in your journal the message &amp;quot;I shall go into..&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Broken Link Removed&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Tutorials_List&amp;diff=1766</id>
		<title>Tutorials List</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Tutorials_List&amp;diff=1766"/>
				<updated>2012-05-14T17:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting, Installing and opening Sandbox ==&lt;br /&gt;
&lt;br /&gt;
* [[Downloading Sandbox]]&lt;br /&gt;
* [[Installing Sandbox]]&lt;br /&gt;
* [[Running Sandbox]]&lt;br /&gt;
* [[development|Obtaining the development version]]&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
&lt;br /&gt;
* [[FPS|FPS - First Person Shooter (default)]]&lt;br /&gt;
* [[SSP|SSP - Side Scrolling Platformer]]&lt;br /&gt;
* [[RPG|RPG - Role Playing Game]]&lt;br /&gt;
* [[RPG tutorial|RPG Tutorial]]&lt;br /&gt;
* [[MovieCube|MovieCube - Machinima Tool]]&lt;br /&gt;
* [[Vehicle Simulator]]&lt;br /&gt;
&lt;br /&gt;
== Learning the editor basics ==&lt;br /&gt;
&lt;br /&gt;
* [[Map Editing Basics]]&lt;br /&gt;
* [[How to change textures in your map]]&lt;br /&gt;
* [[How to place 3D grass]]&lt;br /&gt;
* [[How to add lava, water, glass and other materials to your map]]&lt;br /&gt;
* [[How to make ramps, bridges, and angles]]&lt;br /&gt;
* [[How to make invisible boundaries]]&lt;br /&gt;
* [[Tips on making a good map]]&lt;br /&gt;
* [[Gridwork]]&lt;br /&gt;
&lt;br /&gt;
=== Buildings ===&lt;br /&gt;
&lt;br /&gt;
* [[How to make sloped roofs]]&lt;br /&gt;
* [[How to make secret doors, walls &amp;amp; floors]]&lt;br /&gt;
* [[How to make 1-way windows only you can see out of]]&lt;br /&gt;
* [[How to make 1-way doors]]&lt;br /&gt;
* [[How to create a hollow tower/tube]]&lt;br /&gt;
* [[How to make stairs you could walk up]]&lt;br /&gt;
* [[How to create set of glass stairs]]&lt;br /&gt;
* [[How to make a TV]]&lt;br /&gt;
* [[How to make various window shapes]]&lt;br /&gt;
* [[How to create a spiral staircase]]&lt;br /&gt;
* [[How to make a pyramid/four-sided sloped roof]]&lt;br /&gt;
&lt;br /&gt;
=== Terrain editing ===&lt;br /&gt;
&lt;br /&gt;
* [[How to create mountains, ponds, and oceans]]&lt;br /&gt;
* [[How to transfer parts of a map to a new one]]&lt;br /&gt;
* [[How to make a forest]]&lt;br /&gt;
* [[How to make a cave]]&lt;br /&gt;
* [[How to make a realistic river]]&lt;br /&gt;
* [[How to make a swimming pool]]&lt;br /&gt;
* [[How to make a fountain]]&lt;br /&gt;
* [[How to create smooth curvy pathways]]&lt;br /&gt;
* [[How to create fields with flower patches]]&lt;br /&gt;
* [[How to create a camp fire and fireplace]]&lt;br /&gt;
* [[How to make a bumpy road]]&lt;br /&gt;
* [[How to make various types of fences]]&lt;br /&gt;
* [[How to make a nice waterfall]]&lt;br /&gt;
* [[How to edit terrain properly]]&lt;br /&gt;
* [[How to fix bad terrain or geometry errors]]&lt;br /&gt;
* [[How to make railings]]&lt;br /&gt;
* [[Texture Blending]]&lt;br /&gt;
&lt;br /&gt;
=== Advanced Editor Techniques===&lt;br /&gt;
&lt;br /&gt;
* [[How to create a slide]]&lt;br /&gt;
* [[How to create a trampoline]]&lt;br /&gt;
* [[How to create electric fences]]&lt;br /&gt;
* [[How to make a sphere shapes in &amp;#039;edit mode&amp;#039;]]&lt;br /&gt;
* [[How to make curved shapes in &amp;#039;edit mode&amp;#039;]]&lt;br /&gt;
* [[How to create curved glass]]&lt;br /&gt;
* [[How to create climbable ladders and vertical walls]]&lt;br /&gt;
* [[How to make an endless slide]]&lt;br /&gt;
* [[How to create lens flares]]&lt;br /&gt;
* [[How to make a snowman]]&lt;br /&gt;
* [[How to make a boat]]&lt;br /&gt;
* [[How to create warp speed tunnels]]&lt;br /&gt;
* [[How to create hidden teleports]]&lt;br /&gt;
* [[How to create spinning palm trees]]&lt;br /&gt;
* [[How to change gravity]]&lt;br /&gt;
&lt;br /&gt;
== Lighting and Particle effects ==&lt;br /&gt;
&lt;br /&gt;
* [[How to add various lighting]]&lt;br /&gt;
* [[Lighting|How to light a map properly]]&lt;br /&gt;
* [[Tips to make a night time map]]&lt;br /&gt;
* [[Tips to make a morning map]]&lt;br /&gt;
* [[Tips to make a sunset map]]&lt;br /&gt;
* [[How to add particle effects]]&lt;br /&gt;
* [[How to create snow or rain]]&lt;br /&gt;
* [[How to put fog to a map]]&lt;br /&gt;
* [[Useful lighting commands]]&lt;br /&gt;
&lt;br /&gt;
== Models and Sandbox ==&lt;br /&gt;
&lt;br /&gt;
* [[Blender to Sandbox]]&lt;br /&gt;
* [[Wings3D to Sandbox flash tutorials]]&lt;br /&gt;
* [[Importing .OBJ files]]&lt;br /&gt;
* [[Mapmodels|Loading and adding mapmodels]]&lt;br /&gt;
* [[How to add new models]]&lt;br /&gt;
* [[Creating 3D models with PAS]]&lt;br /&gt;
* [[How to add new colors of creatures and map models]]&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&lt;br /&gt;
* [[Glowmaps]]&lt;br /&gt;
* [[Adding custom textures to a new map]]&lt;br /&gt;
* [[Adding custom textures with normal maps]]&lt;br /&gt;
* [[Making Seamless textures]]&lt;br /&gt;
* [[How to make new textures]]&lt;br /&gt;
* [[Creating special shader maps for textures]]&lt;br /&gt;
* [http://www.leighvanderbyl.com/texturing-for-dummies/ Texturing for Dummies]&lt;br /&gt;
* [http://www.cgsociety.org/index.php/CGSFeatures/CGSFeatureSpecial/the_top_ten_tips_of_texturing Top Ten Tips of Texturing]&lt;br /&gt;
* [http://forums.cgsociety.org/showthread.php?t=373024 Hard Surface Texture Painting]&lt;br /&gt;
&lt;br /&gt;
== Scripting/Trigger tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Menu Editing|How to modify the menu]]&lt;br /&gt;
* [[making picked up items visible in your inventory]]&lt;br /&gt;
* [[How to make a trigger load another map]]&lt;br /&gt;
* [[Cubescript]]&lt;br /&gt;
* [[Creating easy spells]]&lt;br /&gt;
* [[Removing Editmode]]&lt;br /&gt;
* [[Making Echoes]]&lt;br /&gt;
* [[Adding Custom Skyboxes]]&lt;br /&gt;
* [[How to make triggered elevators/platforms]]&lt;br /&gt;
* [[How to make items that can be picked up]]&lt;br /&gt;
* [[How to make moving doors and platforms in single player mode]]&lt;br /&gt;
&lt;br /&gt;
=== NPCs ===&lt;br /&gt;
&lt;br /&gt;
* [[Creating a shop script]]&lt;br /&gt;
* [[How to make characters talk with text pop-up windows]]&lt;br /&gt;
* [[How to make characters talk with a voice recording]]&lt;br /&gt;
* [[How to make characters give you quests]]&lt;br /&gt;
* [[How to add bots and train them]]&lt;br /&gt;
* [[Ultimate Simple Script Guide, Part 1]]&lt;br /&gt;
* [[Ultimate Simple Script Guide, Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Source Code Modifying + Recompiling ==&lt;br /&gt;
&lt;br /&gt;
* [[Compiling the source code]]&lt;br /&gt;
* [[How to get a mapsize greater than 16]]&lt;br /&gt;
* [[How to add creatures]] &lt;br /&gt;
* [[How to add more player character models]]&lt;br /&gt;
&lt;br /&gt;
== Multiplayer tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[How to host a coop edit session over the internet]]&lt;br /&gt;
* [[How to host a persistent world in Sandbox over the internet]]&lt;br /&gt;
* [[How to monitor your dedicated server without being in it]]&lt;br /&gt;
&lt;br /&gt;
== Unsorted tutorials ==&lt;br /&gt;
* [[Transfering your map from one sandbox version to another]]&lt;br /&gt;
* [[How to save a map properly]]&lt;br /&gt;
* [[How to add projectiles to your game]]&lt;br /&gt;
* [[How to automatically save your map every x number of minutes]]&lt;br /&gt;
&lt;br /&gt;
== Sandbox Related ==&lt;br /&gt;
=== Within Sandbox ===&lt;br /&gt;
* [[Guide to a good game]]&lt;br /&gt;
* [[Customizing Sandbox]]&lt;br /&gt;
* [[Adding custom songs to Sandbox]]&lt;br /&gt;
* [[Preparing your map for uploading]]&lt;br /&gt;
* [[Using Cullart]]&lt;br /&gt;
* [[How to capture screen shots and videos]]&lt;br /&gt;
&lt;br /&gt;
=== Outside of Sandbox ===&lt;br /&gt;
* [[Licensing]]&lt;br /&gt;
* [http://forum.sandboxgamemaker.com/viewtopic.php?f=24&amp;amp;t=1493 Copyrighting your content]&lt;br /&gt;
* [[Tips on creating content]]&lt;br /&gt;
* [[Models Vs. Geometry]]&lt;br /&gt;
&lt;br /&gt;
=== Maptitle and authors ===&lt;br /&gt;
* [[How to add map title and author]]&lt;br /&gt;
* [[How to change color of text in maps welcome message]]&lt;br /&gt;
&lt;br /&gt;
== Meta-Sandbox ==&lt;br /&gt;
* [[How to contribute to Platinum Arts Sandbox]]&lt;br /&gt;
* [[Where to find inspiration]]&lt;br /&gt;
* [[Editing the wiki]]&lt;br /&gt;
&lt;br /&gt;
* [[Creators of these tutorials]]&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1648</id>
		<title>RPG tutorial</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_tutorial&amp;diff=1648"/>
				<updated>2012-04-17T10:46:58Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Extras */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following tutorials are only meant to cover the basics of developing for the RPG. Each of the tutorials build upon the work from the previous exercises and are therefor best done in order.&lt;br /&gt;
&lt;br /&gt;
=Part 1=&lt;br /&gt;
&lt;br /&gt;
This part covers making the initial skeleton of our game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default the RPG detects the available games by searching data/rpg/games for cfg files, these files form the basis of what the main menu will list as the available games. In selecting a game from the menu, it will then attempt to load the definitions from an equivalently named directory.&lt;br /&gt;
&lt;br /&gt;
We now know the first step to making our own tutorial game, we need a corresponding cfg and directory inside &amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Luckily sandbox comes with a base that can be derived to quickly get things up and running, so first up, let&amp;#039;s make a copy of the base directory and call the copy &amp;quot;tutorial&amp;quot; and then move a file named &amp;#039;&amp;#039;&amp;#039;base.cfg&amp;#039;&amp;#039;&amp;#039; inside &amp;#039;&amp;#039;&amp;#039;data/rpg/games/tutorial&amp;#039;&amp;#039;&amp;#039; into &amp;#039;&amp;#039;&amp;#039;data/rpg/games&amp;#039;&amp;#039;&amp;#039; and rename it to &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
We can essentially open up our game in sandbox now, but we still have a few things to do, so for now, open up &amp;#039;&amp;#039;&amp;#039;tutorial.cfg&amp;#039;&amp;#039;&amp;#039; in your favourite text editor. The contents should be pretty self explanatory but we do need to make a few specific changes.&lt;br /&gt;
&lt;br /&gt;
Firstly, we want to set the default map and associate it with mapscript 0, for this excercise we&amp;#039;ll name our map tutorial1.&lt;br /&gt;
&lt;br /&gt;
Secondly, we want to set the version number and the compatibility number to 1.&lt;br /&gt;
&lt;br /&gt;
Finally, we will want to specify a HUD to use for our game. Sandbox currently only ships one, so we will execute it here.&lt;br /&gt;
&lt;br /&gt;
The final version of tutorial.cfg should look similar to this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_preparemap tutorial1 0&lt;br /&gt;
  &lt;br /&gt;
  firstmap tutorial1&lt;br /&gt;
  &lt;br /&gt;
  gameversion 1&lt;br /&gt;
  compatversion 1&lt;br /&gt;
  &lt;br /&gt;
  exec data/rpg/hud_standard.cfg&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save it and we have one more step to go, we need to make a map named tutorial1, so fire up sandbox and save a newmap under that name.&lt;br /&gt;
&lt;br /&gt;
Congratulations! you have successfully set up the basics required to make your RPG with sandbox&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
game.cfg has two explicit purposes. Firstly it identifies the existence of a game and secondly, it defines many of the important attributes of the game.&lt;br /&gt;
&lt;br /&gt;
things that can and should be defined in game.cfg include&lt;br /&gt;
* the script and flags to use on a maps&lt;br /&gt;
* internal properties, such as the game version&lt;br /&gt;
* global game properties, such as friendly fire&lt;br /&gt;
* rule properties (currently not available)&lt;br /&gt;
* the initial/default HUD&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I&amp;#039;m a windows&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If windows is your operating system of choice, do yourself a huge favour and at the very least configure windows to display file extensions such as .cfg. This will save you a fair bit of pain&lt;br /&gt;
&lt;br /&gt;
=Part 2=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves spawning a neutral NPC and assigning him some dialogue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can go about this in a few ways, but we&amp;#039;ll start by first defining the NPC&amp;#039;s script, the NPC, and then creating a place for him in the world.&lt;br /&gt;
&lt;br /&gt;
First off, go to your definitions directory (probably data/rpg/games/tutorial) and then enter the script subdirectory. You will not want to create a new configuration file and place it at the very end of the others (eg, if the last is named 7.cfg, name yours 8.cfg). In this file, we define how any entities using it will react and interact with the surrounding world. Since we don&amp;#039;t want to bother with that, we will simply include the default NPC script.&lt;br /&gt;
&lt;br /&gt;
Afterwards we can start defining the dialogue. When you&amp;#039;re done the final script should look something like this. Feel free to experiment by writing more dialogue and fleshing out your character&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  include scripts/1 //includes the default NPC script&lt;br /&gt;
  &lt;br /&gt;
  r_script_say &amp;quot;Hello, how are you doing&amp;quot; [ // 0 - it&amp;#039;s good practice to number your entries&lt;br /&gt;
    r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; 1 //goes to dialogue #1&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; -1 //closes the dialogue&lt;br /&gt;
  ]&lt;br /&gt;
  &lt;br /&gt;
  r_script_say &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [ // 1&lt;br /&gt;
    r_response &amp;quot;Goodbye&amp;quot; -1&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we will now define a critter to use the script. All critter configuration options are prefixed with r_char and most contain a variant with a _get suffix for retrieving the value. Now create a new cfg file in the critter sub directory, following the same steps as you did for the script to define it&amp;#039;s name. This will probably be 0.cfg.&lt;br /&gt;
&lt;br /&gt;
Consult the configuration reference for a full list of available configuration options, for now, copy the following into critters/0.cfg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_char_name &amp;quot;Bob&amp;quot;&lt;br /&gt;
  r_char_mdl &amp;quot;ogre&amp;quot;&lt;br /&gt;
  r_char_script 8 //make sure this corresponds with the above script&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to spawn Bob, so start your game and create a critter entity that spawn a critter of type 0. Remember that F1 toggles editmode in the RPG!&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  newent critter 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&amp;#039;re done, to test it simply exit editmode and press E while hovering the crosshair over him.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default Scripts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The various definition types of the RPG each default to their own individual specialized script. They correspond as follows&lt;br /&gt;
* 0 - null/empty/nothing&lt;br /&gt;
* 1 - Default critter script; primarily initiates dialogue, will in the future control AI logic and stealth abilities&lt;br /&gt;
* 2 - Default item script; mainly implements pickup&lt;br /&gt;
* 3 - Default obstacle script; does nothing&lt;br /&gt;
* 4 - Default container script; will eventually allow you to pick the lock and loot items&lt;br /&gt;
* 5 - Default platform script; does nothing&lt;br /&gt;
* 6 - Default trigger script; toggles triggered state (eg, switches door between open and close)&lt;br /&gt;
&lt;br /&gt;
Note that the player defaults to script 0, and has its script explicitly set to 7. Script 7 contains some basic player logic, mainly it lets you know when you level up.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Definition numbering&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The numbers allows the game to easily and quickly identify and order definitions, unfortunately this is inconvenient to the users since it makes identifying which definition corresponds to an item you&amp;#039;re looking for a bit of a chore. The only thing you need to remember, is that each definition must be assigned number from 0 and up and that there cannot be &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; empty gaps. Duplicate numbers (eg hex or octal) and non-number names will throw a warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 1.cfg  2.cfg  3.cfg  4.cfg  5.cfg&lt;br /&gt;
 # the game will abort with these files&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 $ ls&lt;br /&gt;
 0.cfg  1.cfg  2.cfg  3.cfg  4.cfg&lt;br /&gt;
 # the game will start&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Multiple dialogue entry points&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The entry point is defined by the talk signal, by default this simply opens the dialogue at position 0 should it exist. If you&amp;#039;d like to change the entry point you will have to redefine the talk signal for your entity. For example...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_signal talk [&lt;br /&gt;
    if $cond [&lt;br /&gt;
      r_chat self 0&lt;br /&gt;
    ]&lt;br /&gt;
      r_chat self 2&lt;br /&gt;
    ]&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add more more conditions and variables and you are allowed the full range of cubescript commands.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dialogue standards&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are no fixed standards, but we recommend the following conventions when writing dialogue for your characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  r_script_say &amp;quot;Things the creatures say are simply typed like this, no surrounding quotes&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;If you wish to put *emphasis* on a word, place *&amp;#039;s on both sides]&amp;quot; []&lt;br /&gt;
  r_script_say &amp;quot;[between these brackets, write what your character sees and experiences]&amp;quot; [&lt;br /&gt;
    r_response &amp;quot;[Likewise, place any actions your character takes here]&amp;quot;&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Part 3=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers basic item definitions, trigger basics and crafting.&lt;br /&gt;
&lt;br /&gt;
For this exercise we will craft papyrus sheets, we will write on these to produce our weapon in the next part. This process demands the use of a knife, a hammer and something heavy to compress it while drying. The important part is the materials that are used in the process and those that enable the process, we recommend ignoring the process itself.&lt;br /&gt;
&lt;br /&gt;
So first up, let&amp;#039;s define the ingredients, the tools we&amp;#039;re going to use and the product we&amp;#039;re going to make. If you&amp;#039;ve followed the tutorial thus far, you should still have 0 item definitions, otherwise follow the previously defined rules. Save the following in the items subdirectory. The commands and their effect should be self-explanatory&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus reed&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Freshly harvested from the Papyrus plant, the stem of these reeds have been used for centuries to create a durable writing surface.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Knife&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The blade has seen a lot of use and is missing a few chips, but remains deadly sharp.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Old Mallet&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;The mallet appears to have seen a lot of use, but remains effective for beating things.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Papyrus&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Papyrus reeds have been converted into a durable surface suitable for writing on.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, we will define the recipe. A recipe has 3 lists of items, the ingredients, the catalysts and the products. Ingredients are items that are consumed in full to produce the products and catalysts are items that enable the process to happen.&lt;br /&gt;
&lt;br /&gt;
For now, copy the following to &amp;#039;&amp;#039;&amp;#039;recipes/0.cfg&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN //we know the recipe at the start&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 0 10 // 10 x papyrus reeds&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_catalyst 1 1 // 1 x knife&lt;br /&gt;
 r_recipe_add_catalyst 2 1 // 1 x hammer&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 3 1 // 1 x papyrus&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to create the final item, we simply need to spawn them into the world. If you are in a hurry to test it out, use the following commands to spawn them in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent item 0 10 //skip this if you aren&amp;#039;t in a hurry&lt;br /&gt;
 newent item 1 1 //knife&lt;br /&gt;
 newent item 2 1 //hammer&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re still here, we&amp;#039;re now going to make actual harvestable papyrus plants using triggers, since we lack a suitable model we will improvise using one for reeds. First we will define a suitable script. Our trigger&amp;#039;s script will add a random amount between 1-4 reeds to the player&amp;#039;s inventory and then destroy itself. If we wanted, we could toggle a variable and change the model so it looks as though it was harvested and perhaps even respawn it after a few while of game time, but that&amp;#039;s a more advanced topic for another time. So for now, copy the following into &amp;#039;&amp;#039;&amp;#039;scripts/9.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  //papyrus reeds&lt;br /&gt;
  &lt;br /&gt;
  r_script_signal interact [&lt;br /&gt;
    // adds between 1-4 units of papyrus to whoever harvests it&lt;br /&gt;
    r_additem actor 0 (rnd 5 1) &lt;br /&gt;
    // removes itself from the stack&lt;br /&gt;
    r_destroy self&lt;br /&gt;
  ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for the trigger itself, copy the following into &amp;#039;&amp;#039;&amp;#039;triggers/0.cfg&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Papyrus plant&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;dcp/reed&amp;quot;&lt;br /&gt;
 r_trigger_script 9&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations, just spawn a few of those near a body of water somewhere, and you&amp;#039;ve finish this section of the tutorial. The command is of course as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 newent trigger 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Splitting the process&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The general recommendation is to try and contain the whole process in a single recipe. Rather than splitting it out into many small pieces. As a rule, try to avoid making the player learn and execute the process and let taht be handled via the character&amp;#039;s knowledge. For example, if we wanted to create stew in a more contemporary setting, the recommended recipe would be something like this.&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 3 x Potatoes&lt;br /&gt;
* 1 x Unions&lt;br /&gt;
* 5 x Carrots&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
Likewise, the strongly not recommended series of recipes may look something like this&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Potato&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced potato&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Sliced union&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Diced union&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Carrot&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Knife&lt;br /&gt;
* 1 x Cutting board&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 5 x Sliced carrot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 15 x Sliced Potatoes&lt;br /&gt;
* 25 x Diced Unions&lt;br /&gt;
* 25 x Sliced Carrots&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ingredients&lt;br /&gt;
* 1 x Uncooked Stew&lt;br /&gt;
* 1 x Butane canister&lt;br /&gt;
&lt;br /&gt;
Catalysts&lt;br /&gt;
* 1 x Portable gas cooker&lt;br /&gt;
&lt;br /&gt;
Products&lt;br /&gt;
* 1 x Pot&lt;br /&gt;
* 5 x Stew&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Skilled Craftsmen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you want to add a recipe that depends on skills to be used, you can use the r_recipe_reqs family of variables to set them. You&amp;#039;re allowed to utilise the full family of stats and skills to define skill requirements for a recipe.&lt;br /&gt;
&lt;br /&gt;
=Part 4=&lt;br /&gt;
&lt;br /&gt;
This part covers covers particle effect definitions, status effect definitions and item usage definitions with the example of a weapon. The player will be able to craft it with the materials from the previous part.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s dive right into it. We&amp;#039;re going to create 2 items and an additional recipe. For the first item, we need some means of writing on the papyrus we created in the previous session. The second item will be the weapon we will produce, for now we will just create a small skeleton for it. We should currently have 4 items defined, if not adjust numbers accordingly.&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Ink Well&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;It is a phial of ink. Paired with a quill these are still very popular writing instruments.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;Upon this scroll of papyrus rest incantations for a magical spell.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;tentus/moneybag&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we will define the recipe to produce the weapon, we should currently only have a single recipe, adjust accordingly if this isn&amp;#039;t the case.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_recipe_flags $RECIPE_KNOWN&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_ingredient 3 1 // 1 x papyrus&lt;br /&gt;
 r_recipe_add_ingredient 4 1 // 1 x ink&lt;br /&gt;
 &lt;br /&gt;
 r_recipe_add_product 5 1 // magic arrow scroll&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have to deal with the most important part to make any weapons, swords, spells or otherwise. We need a status group to do something. Zero of more status effects comprise each group, and this design decision mainly exists to accommodate spells like polymorph and their respective dispelling. The statuses sub directory should already contain a dummy group, once again, adjust the numbers as required for our own.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //heavy damage&lt;br /&gt;
 r_status_friendly 0 //this is decidedly hostile&lt;br /&gt;
 r_status_addgeneric $STATUS_HEALTH -100 0 // instantly remove 100 HP&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We currently have everything we need to define our weapon/spell, but we unfortunately won&amp;#039;t be able to see the projectile at present due to having no particle effects defined. Projectiles can have up to 3 effects, that is the projectile itself, its trail and the explosion at the end. -1 can be substituted in any of the effect slots to disable emissions for that part. We will define the following 2 effects in the effects subdirectory.&lt;br /&gt;
&lt;br /&gt;
0.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // flying arrow&lt;br /&gt;
 r_effect_mdl &amp;quot;hirato/arrow&amp;quot;&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 // purple magic sparkles&lt;br /&gt;
 r_effect_flags 0&lt;br /&gt;
 r_effect_particle $PART_STEAM&lt;br /&gt;
 r_effect_colour 0x3F003F&lt;br /&gt;
 r_effect_size  0.5&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have everything we need to define our weapon fully as well as be able to see any of its attacks. To make the weapon usable, we need to define a use case in which it is a weapon. We have 3 possible use cases, use (eg, read, drink), armour and weapon, the last two are implemented and fully functional while the first isn&amp;#039;t. Naturally we want the weapon use case.&lt;br /&gt;
&lt;br /&gt;
So to define our weapon fully, open up items/5.cfg and add the following at the end. Generally speaking you don&amp;#039;t need to define quite as many properties, most of these are here just to be sure things work as expected.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_use_new_weapon // 0 - it&amp;#039;s good practice to number these entries&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available in consume and armour use cases as well&lt;br /&gt;
 r_item_use_name &amp;quot;Magic Arrow&amp;quot;&lt;br /&gt;
 r_item_use_description &amp;quot;An arrow is conjoured from the caster&amp;#039;s finger tip and flung at its target with sheer mental will.&amp;quot;&lt;br /&gt;
 r_item_use_cooldown 1500&lt;br /&gt;
 //increases the strength of the spell with player skill or charging&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 // adds our status effect at 30% efficiency - with the above charge flag that means 30 damge &lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_MAGIC 0.3&lt;br /&gt;
 &lt;br /&gt;
 //these slots are available with armour use cases as well&lt;br /&gt;
 r_item_use_slots $SLOT_LHAND&lt;br /&gt;
 r_item_use_skill $SKILL_MAGIC&lt;br /&gt;
 &lt;br /&gt;
 //these slots are exclusive to weapons&lt;br /&gt;
 r_item_use_pflags $P_TIME&lt;br /&gt;
 r_item_use_angle 0&lt;br /&gt;
 r_item_use_lifetime 1000&lt;br /&gt;
 r_item_use_gravity 0&lt;br /&gt;
 r_item_use_projeffect 0 //substitute with your arrow&amp;#039;s effect&lt;br /&gt;
 r_item_use_traileffect 1 //substitute with your trail&amp;#039;s effect&lt;br /&gt;
 r_item_use_deatheffect -1 //replace with a suitable EoL effect&lt;br /&gt;
 r_item_use_ammo -1 //use mana&lt;br /&gt;
 r_item_use_cost 15 //uses 15 units of mana&lt;br /&gt;
 r_item_use_kickback 10&lt;br /&gt;
 r_item_use_recoil 10&lt;br /&gt;
 r_item_use_target $T_SINGLE&lt;br /&gt;
 r_item_use_speed 1.5 // in 100&amp;#039;s of cubes a second&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congratulations! Just spawn the ink well somewhere and craft your weapon, and have some fun. In the next part we will make several mobs for you to use it against.&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Reserved ammo types&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Specifying ammo 0 and above for a use case means you&amp;#039;re going to use items from the respective ammo group. In addition there are also 3 additional ammo types that occupy numbers -1, -2 and -3. they are as follows.&lt;br /&gt;
&lt;br /&gt;
* -1 - Mana&lt;br /&gt;
* -2 - Health&lt;br /&gt;
* -3 - Experience&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$STATUS_HEALTH, $RECIPE_KNOWN, what is all this stuff!?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are hard coded RPG constants that are reproduced inside data/rpg/game.cfg and are usually kept in sync. We strongly recommend that you use these constants/variables as opposed to using the numbers directly, this helps ensure future compatibility and makes it easier to understand the intended effect of the definitions if updates are required.&lt;br /&gt;
&lt;br /&gt;
The file contains &amp;#039;&amp;#039;&amp;#039;all&amp;#039;&amp;#039;&amp;#039; of the various flags and numbers that are available in the RPG, so being familiar with them will be a great boon to you if you choose to use sandbox.&lt;br /&gt;
&lt;br /&gt;
=Part 5=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial covers debug settings, waypoints, and basic AI by making a hostile mob for the player to defeat. Before we even consider adding any AI or monsters, we need to canvas our map with waypoints for the AI to follow and get to the player.&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map.jpg|200px|thumb|right|recommended layout for the first tutorial map]]&lt;br /&gt;
&lt;br /&gt;
But before we get to the waypoints, there is a more critical item to consider, we need to shelter the beast first, so that it doesn&amp;#039;t attack the player immediately, specifically so that the player has a chance to build his weapon before taking on the beast. I&amp;#039;d suggest erecting a wall behind Bob&amp;#039;s house, see the screenshot on the right for a recommended layout.&lt;br /&gt;
&lt;br /&gt;
Our second order of business is to then enable the AI debug channel so that we can see the waypoints we&amp;#039;re dropping and then to canvas the area. Considering the terrain will be mostly flat, you may wish to turn on the experimental waypointing method as well, it will speed up the process tremendously. With that said, waypointing is by far the most tedious task to do sufficiently well in the RPG.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 debug 32 //ai debug channel&lt;br /&gt;
 dropwaypoints 1 //required to drop waypoints&lt;br /&gt;
 experimentalwaypoint 1 //method that links to all nearby nodes, as opposed to tracing a path&lt;br /&gt;
 savewaypoints // saves them when you&amp;#039;re done DO NOT FORGET TO DO THIS!!!&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first order of business is to make a faction for our mob, at present this is only useful for querying relationships between factions as well as allowing you to hurt each other with friendly fire protection enabled. You may wish to put Bob inside his own faction as well. Copy the following as the definition for the second faction.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_faction_name &amp;quot;Beasts&amp;quot;&lt;br /&gt;
 r_faction_base 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now define a script for our creature, we want him to attack us if he spots us as well as when we bother or attack him. The ai for now is very basic and will not try to dodge or do anything besides rush in and complete its goal (which is, to kill you). The following will be his script for now.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 //our mob&amp;#039;s script&lt;br /&gt;
 include scripts/1&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal talk [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal hit [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal update [&lt;br /&gt;
   if (r_cansee self player) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self player 1&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   if (!= (r_get_faction self) (r_get_faction actor)) [&lt;br /&gt;
     r_action_clear self&lt;br /&gt;
     r_action_attack self actor&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now define our beast, let&amp;#039;s make him a hungry and aggressive wolf&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_char_name &amp;quot;Wolf&amp;quot;&lt;br /&gt;
 r_char_mdl &amp;quot;rpg/characters/wolf&amp;quot;&lt;br /&gt;
 r_char_script 10&lt;br /&gt;
 r_char_faction 1&lt;br /&gt;
 &lt;br /&gt;
 r_char_base_maxspeed 40 //speed boost&lt;br /&gt;
 r_char_base_jumpvel 80&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now done all we need to spawn him, but he won&amp;#039;t pose any threat to us at present. For that we need to define a weapon for him and equip it. Since he&amp;#039;s a wolf, he would probably use his fangs for a short range low damage attack with little cooldown. So let&amp;#039;s define his fangs in the items directory with those properties.&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;Fangs&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;If you see this, submit a bug report.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_new_weapon // 0&lt;br /&gt;
 r_item_use_cooldown 100&lt;br /&gt;
 r_item_use_chargeflags $CHARGE_MAG&lt;br /&gt;
 r_item_use_new_status 1 $ATTACK_SLASH .075&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_slots (| $SLOT_LHAND $SLOT_RHAND)&lt;br /&gt;
 r_item_use_skill $SKILL_MELEE&lt;br /&gt;
 &lt;br /&gt;
 r_item_use_range 4&lt;br /&gt;
 r_item_use_angle 8 //degrees&lt;br /&gt;
 r_item_use_lifetime 0&lt;br /&gt;
 r_item_use_cost 0&lt;br /&gt;
 r_item_use_target $T_HORIZ&lt;br /&gt;
 r_item_use_recoil -10&lt;br /&gt;
 r_item_use_projeffect -1&lt;br /&gt;
 r_item_use_traileffect -1&lt;br /&gt;
 r_item_use_deatheffect -1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that taken care of, we now need to spawn him with the item and equip them. In spite of how wolves normally attack, this will be equipped on his &amp;quot;paws&amp;quot;. So open up his script and append the following onto the end. Also, we will place a &amp;#039;&amp;#039;&amp;#039;location entity&amp;#039;&amp;#039;&amp;#039; somewhere in the map near the wolf, he will wander around near it until he spots the player.&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal spawn [&lt;br /&gt;
   r_action_wander self 0 96 0&lt;br /&gt;
   r_additem self 6 1&lt;br /&gt;
   r_equip self 6 0&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Debug flags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The debug variable is a set of flags, you can toggle most of them from the options menu under the game tab, but here they are, reproduced in full.&lt;br /&gt;
&lt;br /&gt;
* 1 - World - draws misc information on the HUD and prints some information on the map stack&lt;br /&gt;
* 2 - Entity - draws entity pointers above head and prints when more are spawned and destroyed as well as their deaths and a few other things&lt;br /&gt;
* 4 - Configuration - prints what various properties were set to when loading definitions&lt;br /&gt;
* 8 - Projectiles - prints hit testing details and renders a pointer string over the projectile&lt;br /&gt;
* 16 - Script - informs you of most executed commands and any sent and received signals (when verbose)&lt;br /&gt;
* 32 - AI - draws waypoints and pritns any received commands&lt;br /&gt;
* 64 - I/O mainly lets you know what is being read from savegames&lt;br /&gt;
* 128 - Camera, draws cutscene information on the HUD&lt;br /&gt;
* 256 - Verbose, makes the rest spammier&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Particles are everywhere!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re being overwhelmed by particles from rendering the waypoints, whether that involves them flickering, or simply bringing performance to a crawl, you can use &amp;#039;&amp;#039;&amp;#039;maxparticledistance&amp;#039;&amp;#039;&amp;#039; to adjust the draw distance, just don&amp;#039;t forget to take note of its original value and change it back afterwards&lt;br /&gt;
&lt;br /&gt;
=Part 6=&lt;br /&gt;
&lt;br /&gt;
This section of the tutorial involves creating a fetch quest, mapflags and teleports&lt;br /&gt;
&lt;br /&gt;
[[File:RPG_tutorial_map2.jpg|200px|thumb|rihgt|suggested layout for dungeon level]]&lt;br /&gt;
&lt;br /&gt;
First up, before we get to the scripts, we are going to create an additional map set below tutorial1, the name of this will be tutorial2. If you are so inclined you can simply create the required geometry below the map, but this is to introduce you to mapflags and mutliple map setups.&lt;br /&gt;
&lt;br /&gt;
We need at least 2 medium sized rooms, connected to each other, with the cavern on the first tutorial map leading into one of them. The first room will be the subject for part 7, the second will house the mcGuffin we will create for this part. The screenshot on the right has an example layout.&lt;br /&gt;
&lt;br /&gt;
After that is done, our first order of business would be to add this to the list of maps for the tutorial game. Since we plan to create a special HUD for the map in the next part, it would be easiest for us if we can prohibit saving. Add the map as follows below the first map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_preparemap tutorial2 0 $MAP_NOSAVE&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This now brings us to the most important, we need to define some means of getting in and out of the dungeon. We will need two triggers and scripts to do this. We will be using a special trigger flag that will make the trigger invisible and we will be using the collide script slot to trigger area transitions. If you like me, dislike that, use the interact slots instead. Spend some time first finding a model that fits the entrance to your cavern/dungeon well and would guarantee a collision before continuing. First off, let&amp;#039;s define the scripts for our triggers.&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial2&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal collide [&lt;br /&gt;
   r_teleport actor 0 tutorial1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The scripts would literally move whatever touches it to the specified map at teledest 0, but more on that later. We will now define our triggers.&lt;br /&gt;
&lt;br /&gt;
1.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Enter cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 11&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Leave cavern&amp;quot;&lt;br /&gt;
 r_trigger_script 12&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_flags $TRIG_INVIS&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done, you can now spawn the triggers at their respective places. After doing that, spawn teledest ents with a tag of 0 outside the immediate area, so that the teleport command has a destination to place anything it teleports.&lt;br /&gt;
&lt;br /&gt;
Our next step will be to make the mcGuffin, the mcGuffin in this case will be an item.&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_item_name &amp;quot;McGuffin&amp;quot;&lt;br /&gt;
 r_item_description &amp;quot;This item is needed to advance the pl- er.. tutorial.&amp;quot;&lt;br /&gt;
 r_item_mdl &amp;quot;hirato/box/standard&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to spawn this in the back of the dedicated room in the dungeon. After that is done, we only need to edit 2 more files, first up, open up variables,cfg.&lt;br /&gt;
&lt;br /&gt;
You use this file to store variables and values you want to persist across sessions. So you want to use these to record the various choices the player has made, the things he has done and the status of all kinds of things in the world.&lt;br /&gt;
&lt;br /&gt;
append this onto the end of variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 bobmcguffin = (r_global_new 0) //bob&amp;#039;s quest to retrieve the mcguffin, 1 - have quest 2 - finished quest&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now only have Bob&amp;#039;s dialogue left to go. We will provide different responses for the various states as well as set any variables that need be and remove any inventory items that need be.&lt;br /&gt;
&lt;br /&gt;
We will need to change a fair bit of his script, So without further ado, open up his script and replace the dialogue with the following.&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_say &amp;quot;Hello, how are you doing&amp;quot; [ // 0 - it&amp;#039;s good practice to number your entries&lt;br /&gt;
   r_response &amp;quot;I&amp;#039;m well, yourself?&amp;quot; 1 //goes to dialogue #1&lt;br /&gt;
   case (r_global_get $bobmcguffin) 0 [&lt;br /&gt;
     r_response &amp;quot;Do you have any work for me?&amp;quot; 2&lt;br /&gt;
   ] 1 [&lt;br /&gt;
     if (r_get_amount player 7) [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; 4&lt;br /&gt;
     ] [&lt;br /&gt;
       r_response &amp;quot;I brought you the mcGuffin&amp;quot; 6&lt;br /&gt;
     ]&lt;br /&gt;
   ] 2 [&lt;br /&gt;
     r_response &amp;quot;Do you have any more work for me?&amp;quot; 7&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; -1 //closes the dialogue&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;I&amp;#039;m glad to hear it&amp;quot; [ // 1&lt;br /&gt;
   r_response &amp;quot;Goodbye&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;I need someone to go into the cave to the North-West of this valley and retrieve the mcGuffin, can you do that for me?&amp;quot; [ //2&lt;br /&gt;
   r_response &amp;quot;You can count on me!&amp;quot; 3 [ r_global_set $bobmcguffin 1 ]&lt;br /&gt;
   r_response &amp;quot;Maybe some other time&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;Great! I&amp;#039;ll be waiting for your return&amp;quot; [ //3&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;Thank you for finding it, but I don&amp;#039;t have a reward for you but I&amp;#039;d till very much like the mcGuffin.&amp;quot; [ //4&lt;br /&gt;
   r_response &amp;quot;[Give him the mcGuffin]&amp;quot; 5 [&lt;br /&gt;
     r_remove player 7 1&lt;br /&gt;
     r_givexp player 900&lt;br /&gt;
     r_global_set $bobmcguffin 2&lt;br /&gt;
   ]&lt;br /&gt;
   r_response &amp;quot;I think I&amp;#039;ll hold onto it for now&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;Thank you very much, I will never forget this&amp;quot; [ // 5&lt;br /&gt;
   r_response &amp;quot;[End]&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;Where is it?&amp;quot; [ //6&lt;br /&gt;
   r_response &amp;quot;I must&amp;#039;ve forgotten it in the cave...&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
 &lt;br /&gt;
 r_script_say &amp;quot;No, but once again, thank you for getting this for me&amp;quot; [ //7&lt;br /&gt;
   r_response &amp;quot;Farewell&amp;quot; -1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Congrats, you&amp;#039;ve made your first FedEx quest. I hope you&amp;#039;re ashamed of yourself and will take this moment to reflect on your actions and produce quests with multiple paths and solutions that aren&amp;#039;t simply get X of Y or kill X of Y ;)&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mapflags&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of mapflags that will affect your ability to do things on the various maps, at present they are as follows&lt;br /&gt;
&lt;br /&gt;
* F_VOLATILE - clears the map state when the player leaves, useful for dungeon levels&lt;br /&gt;
* F_NOSAVE - prevents saving whilst on the map - use sparingly&lt;br /&gt;
* F_NOMINIMAP - doesn&amp;#039;t generate and display a minimap while this flag is active&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global Variable Tips&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These are saved with your game and remain in a constant order and are all defined inside variables.cfg and they can only be integers. r_global_new returns the variable&amp;#039;s index (ie, the first will return 0) and you should alias these return values to an easy to remember name that is short and as descriptive as possible. If you need to list more detailed information, do so in comments either before or on the same line.&lt;br /&gt;
&lt;br /&gt;
You will want to increase the game/compat versions when you move/remove/add anything in here, serious breakage can occur&lt;br /&gt;
&lt;br /&gt;
You should keep the names short and easy to type, for example, if we have a quest where you find a someone named Jane a bunch of apples, JaneApples and ApplesForJane would be some of the better names.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Journal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There is no journal at present but there will be in the future, you will want to record rumours, quest notes, deeds, obituaries and all kinds of other things in there. What you can do for now is make a book where the player can access all this information via dialogue.&lt;br /&gt;
&lt;br /&gt;
=Part 7=&lt;br /&gt;
&lt;br /&gt;
This part of the tutorial involves the creation of a basic logic puzzle to open a door.&lt;br /&gt;
&lt;br /&gt;
We will create a 10 digit number pad of sorts, the player would need to interact with in a specific order to remove an obstacle we will place in the second area.&lt;br /&gt;
&lt;br /&gt;
Our first order of business will be to define the variables we&amp;#039;ll need to pull this off, we&amp;#039;ll need two for the method we&amp;#039;ll be using.&lt;br /&gt;
&lt;br /&gt;
variables.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 keyprogress = (r_global_new 0)&lt;br /&gt;
 keytest = (r_global_new -1)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we&amp;#039;ll define the button&amp;#039;s scripts. The scripts will set the keytest variable and will then call the &amp;quot;testkey&amp;quot; signal on the current map and propagate it to the door. We will define the door a bit later.&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 0&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 1&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 2&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
16.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 3&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
17.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 4&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
18.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 5&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
19.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 6&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
20.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 7&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
21.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 8&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
22.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_script_signal interact [&lt;br /&gt;
   r_global_set $keytest 9&lt;br /&gt;
   r_signal &amp;quot;testkey&amp;quot; self curmap 1&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you thought that wasn&amp;#039;t boring enough, we now define the buttons themselves with similarly minor alterations, these should occupy slots 3 to 12 in the triggers directory, feel free to use a more appropriate model if you have one available.&lt;br /&gt;
&lt;br /&gt;
3.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;0 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 13&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;1 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 14&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;2 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 15&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;3 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 16&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;4 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 17&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;5 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 18&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;6 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 19&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;7 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 20&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;8 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 21&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
12.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;9 Key&lt;br /&gt;
 r_trigger_mdl &amp;quot;teleporter&lt;br /&gt;
 r_trigger_script 22&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will not get to the fun part! defining the actual door itself (hooray!). Like in every other instance, we will define the script first. The door&amp;#039;s script will be as follows, it need to test and increment the global variables we&amp;#039;ve defined earlier.&lt;br /&gt;
&lt;br /&gt;
23.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 key = [ 3 1 3 3 7 ] //change as appropriate&lt;br /&gt;
 keylen = (listlen $key)&lt;br /&gt;
 &lt;br /&gt;
 r_script_signal testkey [&lt;br /&gt;
   if (&amp;lt; (r_global_get $keyprogress) @keylen) [&lt;br /&gt;
     if (= (at [@@@key] (r_global_get $keyprogress)) (r_global_get $keytest) [&lt;br /&gt;
       r_global_set $keyprogress (+ (r_global_get $keyprogress) 1)&lt;br /&gt;
     ] [&lt;br /&gt;
       r_global_set $keyprogress 0&lt;br /&gt;
     ]&lt;br /&gt;
     if (= (r_global_get $keyprogress) @@keylen) [&lt;br /&gt;
       r_trigger self&lt;br /&gt;
     ]&lt;br /&gt;
   ]&lt;br /&gt;
 ]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will now make the trigger itself, like with the last step, choose a model of appropriate size to block the passage to the mcGuffin&lt;br /&gt;
&lt;br /&gt;
13.cfg&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 r_trigger_name &amp;quot;Heavy door&amp;quot;&lt;br /&gt;
 r_trigger_mdl &amp;quot;ahab/castle_door&amp;quot;&lt;br /&gt;
 r_trigger_script 23&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Addendum==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;a guiding hand&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the puzzle and its difficulty, you should strive to give the player a few hints to solve it. You should avoid giving the player the answer but you should give the player some audio or visual feedback based on his actions.&lt;br /&gt;
&lt;br /&gt;
Take our above puzzle for example, we have no idea if the combination we have entered is even correct apart from the door opening after interacting with the triggers. In addition, trying every 5 digit combo to get the example combination can take as many as 100000 attempts.&lt;br /&gt;
&lt;br /&gt;
For a puzzle like that, it is unreasonable to just expect the player to figure out the answer himself without a few hints. Short of giving the player the answer, we could perhaps tell him the digits but in a wrong order, or perhaps give him a mnemonic he has to decipher to get the answer.&lt;br /&gt;
&lt;br /&gt;
=Extras=&lt;br /&gt;
&lt;br /&gt;
* [http://www.sendspace.com/file/cu341n Finished product] - Note, sandbox 2.7.1 or newer is required -&amp;gt; link is currently dead!&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_script&amp;diff=1647</id>
		<title>RPG script</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=RPG_script&amp;diff=1647"/>
				<updated>2012-04-17T10:41:41Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Signals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=References=&lt;br /&gt;
References are stored separately of cube script and are defined as a stack of hashtables that can be arbitrarily incremented and decreased. The depth is typically 1 unless a script is executing or things are being run inside a r_stack block.&lt;br /&gt;
&lt;br /&gt;
References are the system that exposes a lot of functionality as well as providing a relatively fast and type-safe means for creators to script assorted interactions in their games.&lt;br /&gt;
&lt;br /&gt;
As a general rule, a reference must be defined (or registered) before it can be set or searched for. There are two ways to register a reference. The first is using &amp;#039;&amp;#039;&amp;#039;r_registerref&amp;#039;&amp;#039;&amp;#039; and the second using &amp;#039;&amp;#039;&amp;#039;r_registertemp&amp;#039;&amp;#039;&amp;#039;. Both behave exactly the same except for one difference, &amp;#039;&amp;#039;&amp;#039;r_registertemp&amp;#039;&amp;#039;&amp;#039; only searches the top level for a matching reference as opposed to the whole stack, otherwise they both create one at the top level if one isn&amp;#039;t found. Due to this behaviour, you can shadow variables quite easily and painlessly and allows us to use self and actor as reference for just about every script call.&lt;br /&gt;
&lt;br /&gt;
The references can reference just about anything in the RPG, the current official list is as follows. Note that volatile references are cleared at the start of every update due to the volatile nature of what they reference.&lt;br /&gt;
* Critters&lt;br /&gt;
* Items&lt;br /&gt;
* Obstacles&lt;br /&gt;
* Platforms&lt;br /&gt;
* Triggers&lt;br /&gt;
* Inventory&lt;br /&gt;
* Equipment (volatile)&lt;br /&gt;
* Map&lt;br /&gt;
* Victim Effect (volatile)&lt;br /&gt;
* Area Effect (volatile)&lt;br /&gt;
&lt;br /&gt;
In addition the following list should be considered reserved, you may use them for other purposes but we really do not recommend this for obvious reasons.&lt;br /&gt;
* player - the player&lt;br /&gt;
* curmap - the current map&lt;br /&gt;
* hover - the current hover target&lt;br /&gt;
* talker - who the player is currently talking to&lt;br /&gt;
* actor - generally something that sent a signal to the entity in the self reference&lt;br /&gt;
* self - something executing a script, typically due to to receiving a signal fro mactor&lt;br /&gt;
&lt;br /&gt;
=Signals=&lt;br /&gt;
&lt;br /&gt;
Nearly all scripts in the RPG are defined as a signal to either the script on the mapscript subtypes. The signals can have just about any name, there are several loosely reserved names the engine will call periodically but the creator has completely free reign on what he wants to name his signals and what he wants and when alongside those the game call.&lt;br /&gt;
&lt;br /&gt;
Signals are sent to everything by default unless a specific target is specified. Signals called periodically by the game are as follows&lt;br /&gt;
* update - sent to everything every update&lt;br /&gt;
* collide - sent to every pair of entities that collided in an update&lt;br /&gt;
* hit - sent when something is hit by another&amp;#039;s attack&lt;br /&gt;
* interact - typically sent when you press the E key while having a hover target&lt;br /&gt;
* death - sent to an entity when it does&lt;br /&gt;
* level - sent to an entity when it gains a level&lt;br /&gt;
* equip - send to the item when an entity equips it&lt;br /&gt;
* load - sent to the map when it&amp;#039;s initialised&lt;br /&gt;
* spawn - sent to an entity when it&amp;#039;s created&lt;br /&gt;
* attack - sent when an entity attacks&lt;br /&gt;
&lt;br /&gt;
This list is subject to change in the future&lt;br /&gt;
&lt;br /&gt;
=Context sensitive values=&lt;br /&gt;
&lt;br /&gt;
When some conditions are met or certain signals are sent, global variables are set for it to use.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;hit signal&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
friendly - notes whether or not the attack was friendly&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;script/signal status effect&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=Commands=&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Tutorials_List&amp;diff=1643</id>
		<title>Tutorials List</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Tutorials_List&amp;diff=1643"/>
				<updated>2012-04-13T16:43:42Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Other useful tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting, Installing and opening Sandbox ==&lt;br /&gt;
&lt;br /&gt;
* [[Downloading Sandbox]]&lt;br /&gt;
* [[Installing Sandbox]]&lt;br /&gt;
* [[Running Sandbox]]&lt;br /&gt;
* [[development|Obtaining the development version]]&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
* [[FPS|FPS - First Person Shooter (default)]]&lt;br /&gt;
* [[SSP|SSP - Side Scrolling Platformer]]&lt;br /&gt;
* [[RPG|RPG - Role Playing Game]]&lt;br /&gt;
* [[MovieCube|MovieCube - Machinima Tool]]&lt;br /&gt;
* [[Vehicle Simulator]]&lt;br /&gt;
== Learning the editor basics ==&lt;br /&gt;
&lt;br /&gt;
* [[Map Editing Basics]]&lt;br /&gt;
* [[How to place 3D grass]]&lt;br /&gt;
* [[How to add lava, water, glass and other materials to your map]]&lt;br /&gt;
* [[How to make invisible boundaries]]&lt;br /&gt;
* [[Tips on making a good map]]&lt;br /&gt;
&lt;br /&gt;
== Buildings ==&lt;br /&gt;
&lt;br /&gt;
* [[How to make sloped roofs]]&lt;br /&gt;
* [[How to make secret doors, walls &amp;amp; floors]]&lt;br /&gt;
* [[How to make 1-way windows only you can see out of]]&lt;br /&gt;
* [[How to make 1-way doors]]&lt;br /&gt;
* [[How to create a hollow tower/tube]]&lt;br /&gt;
* [[How to make stairs you could walk up]]&lt;br /&gt;
* [[How to create set of glass stairs]]&lt;br /&gt;
* [[How to make a TV]]&lt;br /&gt;
* [[How to make various window shapes]]&lt;br /&gt;
* [[How to create a spiral staircase]]&lt;br /&gt;
* [[How to make a pyramid/four-sided sloped roof]]&lt;br /&gt;
&lt;br /&gt;
== Lighting and Particle effects ==&lt;br /&gt;
&lt;br /&gt;
* [[How to add various lighting]]&lt;br /&gt;
* [[Lighting|How to light a map properly]]&lt;br /&gt;
* [[Tips to make a night time map]]&lt;br /&gt;
* [[Tips to make a morning map]]&lt;br /&gt;
* [[Tips to make a sunset map]]&lt;br /&gt;
* [[How to add particle effects]]&lt;br /&gt;
* [[How to create snow or rain]]&lt;br /&gt;
* [[How to put fog to a map]]&lt;br /&gt;
* [[Useful lighting commands]]&lt;br /&gt;
&lt;br /&gt;
== Terrain editing ==&lt;br /&gt;
&lt;br /&gt;
* [[How to create mountains, ponds, and oceans]]&lt;br /&gt;
* [[How to transfer parts of a map to a new one]]&lt;br /&gt;
* [[How to make a forest]]&lt;br /&gt;
* [[How to make a cave]]&lt;br /&gt;
* [[How to make a realistic river]]&lt;br /&gt;
* [[How to make a swimming pool]]&lt;br /&gt;
* [[How to make a fountain]]&lt;br /&gt;
* [[How to create smooth curvy pathways]]&lt;br /&gt;
* [[How to create fields with flower patches]]&lt;br /&gt;
* [[How to create a camp fire and fireplace]]&lt;br /&gt;
* [[How to make a hollow pyramid]]&lt;br /&gt;
* [[How to make a bumpy road]]&lt;br /&gt;
* [[How to make various types of fences]]&lt;br /&gt;
* [[How to make a nice waterfall]]&lt;br /&gt;
* [[How to edit terrain properly]]&lt;br /&gt;
* [[How to fix bad terrain or geometry errors]]&lt;br /&gt;
* [[How to make railings]]&lt;br /&gt;
&lt;br /&gt;
== NPC-s ==&lt;br /&gt;
&lt;br /&gt;
* [[Creating a shop script]]&lt;br /&gt;
* [[How to make characters talk with text pop-up windows]]&lt;br /&gt;
* [[How to make characters talk with a voice recording]]&lt;br /&gt;
* [[How to make characters give you quests]]&lt;br /&gt;
* [[How to add bots and train them]]&lt;br /&gt;
* [[Ultimate Simple Script Guide, Part 1]]&lt;br /&gt;
* [[Ultimate Simple Script Guide, Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Importing models to Sandbox ==&lt;br /&gt;
&lt;br /&gt;
* [[Blender to Sandbox]]&lt;br /&gt;
* [[Wings3D to Sandbox flash tutorials]]&lt;br /&gt;
* [[Importing .OBJ files]]&lt;br /&gt;
* [[Mapmodels|Loading and adding mapmodels]]&lt;br /&gt;
* [[How to add new models]]&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
&lt;br /&gt;
* [[Glowmaps]]&lt;br /&gt;
* [[Adding custom textures to a new map]]&lt;br /&gt;
* [[Adding custom textures with normal maps]]&lt;br /&gt;
* [[How to make new textures]]&lt;br /&gt;
* [http://www.leighvanderbyl.com/pdf/texturing.pdf Texturing for Dummies ]&lt;br /&gt;
* [http://www.cgsociety.org/index.php/CGSFeatures/CGSFeatureSpecial/the_top_ten_tips_of_texturing Top Ten Tips of Texturing]&lt;br /&gt;
* [http://forums.cgsociety.org/showthread.php?t=373024 Hard Surface Texture Painting]&lt;br /&gt;
&lt;br /&gt;
== Scripting tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[Menu Editing|How to modify the menu]]&lt;br /&gt;
* [[making picked up items visible in your inventory]]&lt;br /&gt;
* [[How to make a trigger load another map]]&lt;br /&gt;
* [[Cubescript]]&lt;br /&gt;
* [[Creating easy spells]]&lt;br /&gt;
* [[Removing Editmode]]&lt;br /&gt;
* [[Making Echoes]]&lt;br /&gt;
* [[Adding Custom Skyboxes]]&lt;br /&gt;
&lt;br /&gt;
== Maptitle and authors ==&lt;br /&gt;
&lt;br /&gt;
* [[How to add map title and author]]&lt;br /&gt;
* [[How to change color of text in maps welcome message]]&lt;br /&gt;
&lt;br /&gt;
== Multiplayer tutorials ==&lt;br /&gt;
&lt;br /&gt;
* [[How to host a coop edit session over the internet]]&lt;br /&gt;
* [[How to host a persistent world in Sandbox over the internet]]&lt;br /&gt;
* [[How to monitor your dedicated server without being in it]]&lt;br /&gt;
&lt;br /&gt;
== Other useful tutorials ==&lt;br /&gt;
&lt;br /&gt;
*[[Guide to a good game]]&lt;br /&gt;
*[[Editing the wiki]]&lt;br /&gt;
*[[Customizing Sandbox]]&lt;br /&gt;
*[http://forum.sandboxgamemaker.com/viewtopic.php?f=24&amp;amp;t=1493 Copyrighting your content]&lt;br /&gt;
*[http://quadropolis.us/node/2328 Gridwork]&lt;br /&gt;
*[[Adding custom songs to Sandbox]]&lt;br /&gt;
*[[Creating 3D models with PAS]]&lt;br /&gt;
&lt;br /&gt;
== Unsorted tutorials ==&lt;br /&gt;
* [[Transfering your map from one sandbox version to another]]&lt;br /&gt;
* [[How to make items that can be picked up]]&lt;br /&gt;
* [[How to make moving doors and platforms in single player mode]]&lt;br /&gt;
* [[How to add your own music]]&lt;br /&gt;
* [[How to create skymaps]]&lt;br /&gt;
* [[How to create lens flares]]&lt;br /&gt;
* [[How to create a slide]]&lt;br /&gt;
* [[How to create a trampoline]]&lt;br /&gt;
* [[How to create electric fences]]&lt;br /&gt;
* [[How to create warp speed tunnels]]&lt;br /&gt;
* [[How to create climbable ladders and vertical walls]]&lt;br /&gt;
* [[How to create hidden teleports]]&lt;br /&gt;
* [[How to create spinning palm trees]]&lt;br /&gt;
* [[How to capture screen shots and videos]]&lt;br /&gt;
* [[How to make ramps, bridges, and angles]]&lt;br /&gt;
* [[How to change gravity]]&lt;br /&gt;
* [[How to save a map properly]]&lt;br /&gt;
* [[How to change textures in your map]]&lt;br /&gt;
* [[How to add creatures]] &lt;br /&gt;
* [[How to add new colors of creatures and map models]]&lt;br /&gt;
* [[How to add more player character models]]&lt;br /&gt;
* [[How to make an endless slide]]&lt;br /&gt;
* [[How to make a robochimp throw you into the air]]&lt;br /&gt;
* [[How to make a snowman]]&lt;br /&gt;
* [[How to make a boat]]&lt;br /&gt;
* [[How to resize map models and textures]]&lt;br /&gt;
* [[How to add projectiles to your game]]&lt;br /&gt;
* [[How to automatically save your map every x number of minutes]]&lt;br /&gt;
* [[How to make a sphere shapes in &amp;#039;edit mode&amp;#039;]]&lt;br /&gt;
* [[How to make curved shapes in &amp;#039;edit mode&amp;#039;]]&lt;br /&gt;
* [[How to create curved glass]]&lt;br /&gt;
* [[How to make a water slide]]&lt;br /&gt;
* [[How to make triggered elevators/platforms]]&lt;br /&gt;
* [[How to get a mapsize greater than 16]]&lt;br /&gt;
&lt;br /&gt;
== Sandbox Related ==&lt;br /&gt;
* [[How to contribute to Platinum Arts Sandbox]]&lt;br /&gt;
* [[Tips on creating content]]&lt;br /&gt;
* [[Models Vs. Geometry]]&lt;br /&gt;
* [[Where to find inspiration]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* [[Creators of these tutorials]]&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Main_Page&amp;diff=1641</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Main_Page&amp;diff=1641"/>
				<updated>2012-04-13T16:41:23Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Platinum Arts Sandbox Free 3D Game Maker&amp;#039;&amp;#039;&amp;#039; is a 3D game maker based on the Cube 2 engine that allows users to quickly and easily create and edit their own worlds in game, even cooperatively. It is free, open-source, and easy to use for Kids and Adults.  Sandbox logo by [http://sashazavisha.deviantart.com/art/young-creator-120946941 sashaZavisha].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:49%;float:left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General information ==&lt;br /&gt;
&lt;br /&gt;
* [[Platinum Arts Sandbox|About Platinum Arts Sandbox]]&lt;br /&gt;
* [http://SandboxGameMaker.com Project homepage]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[Contact The Team]]&lt;br /&gt;
* [[cmdline arguments|Command line Arguments]]&lt;br /&gt;
* [[packaging guide|The Packaging Guide]]&lt;br /&gt;
* [[server list|List Of Sandbox Servers]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
* [[Installing Platinum Arts Sandbox]]&lt;br /&gt;
* [[Compiling the source code]]&lt;br /&gt;
* [[package managers|Some Notes for package managers]]&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
* [[bug reports|Bug Reports]]&lt;br /&gt;
* [[Coding Style]]&lt;br /&gt;
* [[Contributing]]&lt;br /&gt;
* [[development|Obtaining the development version]]&lt;br /&gt;
* [[Todo|To do list]]&lt;br /&gt;
* [[content request| Content Request - Help us out!!]]&lt;br /&gt;
&lt;br /&gt;
== Kid Friendly RPG ==&lt;br /&gt;
* [[Concept Document]]&lt;br /&gt;
* [[Brainstorming area]]&lt;br /&gt;
&lt;br /&gt;
== Master Chef Ogro 2 ==&lt;br /&gt;
* [[Brainstorming]]&lt;br /&gt;
&lt;br /&gt;
== Undercover Kids Game ==&lt;br /&gt;
* [[To Do List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:49%;float:right;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
* [[Map Editing Basics]]&lt;br /&gt;
* [[Mapping Taboos]]&lt;br /&gt;
* [[Beginner&amp;#039;s video tutorials]]&lt;br /&gt;
* [[Good free programs for Sandbox]]&lt;br /&gt;
&lt;br /&gt;
== Advanced topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cooperative Editing]] (General Server set up)&lt;br /&gt;
* [[Cooperative Editing 2]] (Easier way using Hamachi)&lt;br /&gt;
* [[Adding Models to Sandbox]]&lt;br /&gt;
* [http://sandboxgamemaker.com/platinumartssandboxeditref.html Editing Reference Guide]&lt;br /&gt;
* [http://sauerbraten.org/docs/models.html Model Reference Guide]&lt;br /&gt;
* [[Configuration Reference Guide]]&lt;br /&gt;
* [[Cubescript]]&lt;br /&gt;
* [[Menu Editing]] ([[New menu editing|newui]])&lt;br /&gt;
* [[map_config|Map Configuration]]&lt;br /&gt;
&lt;br /&gt;
== Example Modules ==&lt;br /&gt;
&lt;br /&gt;
* [[FPS|FPS - First Person Shooter (default)]]&lt;br /&gt;
* [[RPG|RPG - Role Playing Game]]&lt;br /&gt;
* [[SSP|SSP - Side Scrolling Platformer]]&lt;br /&gt;
* [[MovieCube|MovieCube - Machinima Tool]]&lt;br /&gt;
* [[Vehicle Simulator]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
*[[Tips on Making a Good Map]]&lt;br /&gt;
*[[Tutorials List | Text Tutorials List]]&lt;br /&gt;
*[[Video Tutorials List]]&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
*[[Soundtrack]]&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Creating_3D_models_with_PAS&amp;diff=1640</id>
		<title>Creating 3D models with PAS</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Creating_3D_models_with_PAS&amp;diff=1640"/>
				<updated>2012-04-13T16:35:45Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) create a newmap &amp;lt;br&amp;gt;&lt;br /&gt;
2) delete everything &amp;lt;br&amp;gt;&lt;br /&gt;
3) create your desired model &amp;lt;br&amp;gt;&lt;br /&gt;
4) use the command &amp;#039;/writeobj name&amp;#039; to export your model &amp;lt;br&amp;gt;&lt;br /&gt;
5) optional - open the model with a 3D modeling programm and edit it &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Creating_3D_models_with_PAS&amp;diff=1639</id>
		<title>Creating 3D models with PAS</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Creating_3D_models_with_PAS&amp;diff=1639"/>
				<updated>2012-04-13T16:34:21Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: Created page with &amp;#039;1) create a newmap 2) delete everything 3) create your desired model 4) use the command &amp;#039;/writeobj name&amp;#039; to export your model 5) optional - open the model with a 3D modeling prog…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1) create a newmap&lt;br /&gt;
2) delete everything&lt;br /&gt;
3) create your desired model&lt;br /&gt;
4) use the command &amp;#039;/writeobj name&amp;#039; to export your model&lt;br /&gt;
5) optional - open the model with a 3D modeling programm and edit it&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Main_Page&amp;diff=1638</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Main_Page&amp;diff=1638"/>
				<updated>2012-04-13T16:31:00Z</updated>
		
		<summary type="html">&lt;p&gt;Kddekadenz: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Platinum Arts Sandbox Free 3D Game Maker&amp;#039;&amp;#039;&amp;#039; is a 3D game maker based on the Cube 2 engine that allows users to quickly and easily create and edit their own worlds in game, even cooperatively. It is free, open-source, and easy to use for Kids and Adults.  Sandbox logo by [http://sashazavisha.deviantart.com/art/young-creator-120946941 sashaZavisha].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:49%;float:left;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General information ==&lt;br /&gt;
&lt;br /&gt;
* [[Platinum Arts Sandbox|About Platinum Arts Sandbox]]&lt;br /&gt;
* [http://SandboxGameMaker.com Project homepage]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[Contact The Team]]&lt;br /&gt;
* [[cmdline arguments|Command line Arguments]]&lt;br /&gt;
* [[packaging guide|The Packaging Guide]]&lt;br /&gt;
* [[server list|List Of Sandbox Servers]]&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
* [[Installing Platinum Arts Sandbox]]&lt;br /&gt;
* [[Compiling the source code]]&lt;br /&gt;
* [[package managers|Some Notes for package managers]]&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
* [[bug reports|Bug Reports]]&lt;br /&gt;
* [[Coding Style]]&lt;br /&gt;
* [[Contributing]]&lt;br /&gt;
* [[development|Obtaining the development version]]&lt;br /&gt;
* [[Todo|To do list]]&lt;br /&gt;
* [[content request| Content Request - Help us out!!]]&lt;br /&gt;
&lt;br /&gt;
== Kid Friendly RPG ==&lt;br /&gt;
* [[Concept Document]]&lt;br /&gt;
* [[Brainstorming area]]&lt;br /&gt;
&lt;br /&gt;
== Master Chef Ogro 2 ==&lt;br /&gt;
* [[Brainstorming]]&lt;br /&gt;
&lt;br /&gt;
== Undercover Kids Game ==&lt;br /&gt;
* [[To Do List]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:49%;float:right;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
&lt;br /&gt;
* [[Map Editing Basics]]&lt;br /&gt;
* [[Mapping Taboos]]&lt;br /&gt;
* [[Beginner&amp;#039;s video tutorials]]&lt;br /&gt;
* [[Good free programs for Sandbox]]&lt;br /&gt;
&lt;br /&gt;
== Advanced topics ==&lt;br /&gt;
&lt;br /&gt;
* [[Cooperative Editing]] (General Server set up)&lt;br /&gt;
* [[Cooperative Editing 2]] (Easier way using Hamachi)&lt;br /&gt;
* [[Adding Models to Sandbox]]&lt;br /&gt;
* [http://sandboxgamemaker.com/platinumartssandboxeditref.html Editing Reference Guide]&lt;br /&gt;
* [http://sauerbraten.org/docs/models.html Model Reference Guide]&lt;br /&gt;
* [[Configuration Reference Guide]]&lt;br /&gt;
* [[Cubescript]]&lt;br /&gt;
* [[Menu Editing]] ([[New menu editing|newui]])&lt;br /&gt;
* [[map_config|Map Configuration]]&lt;br /&gt;
&lt;br /&gt;
== Example Modules ==&lt;br /&gt;
&lt;br /&gt;
* [[FPS|FPS - First Person Shooter (default)]]&lt;br /&gt;
* [[RPG|RPG - Role Playing Game]]&lt;br /&gt;
* [[SSP|SSP - Side Scrolling Platformer]]&lt;br /&gt;
* [[MovieCube|MovieCube - Machinima Tool]]&lt;br /&gt;
* [[Vehicle Simulator]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
*[[Tips on Making a Good Map]]&lt;br /&gt;
*[[Tutorials List | Text Tutorials List]]&lt;br /&gt;
*[[Video Tutorials List]]&lt;br /&gt;
*[[Kid Matthew&amp;#039;s RPG Tutorials]]&lt;br /&gt;
*[[Creating 3D models with PAS]]&lt;br /&gt;
&lt;br /&gt;
== Other ==&lt;br /&gt;
*[[Soundtrack]]&lt;/div&gt;</summary>
		<author><name>Kddekadenz</name></author>	</entry>

	</feed>