Register to post in forums, or Log in to your existing account
 

 Related 
Contents
Creating and Editing
  Editing your Map
  Map Object Properties
  Room Scripts
Related Links:
  Map Object Properties
Room Scripts [[CMUD_Room_Scripts]] 
Room Scripts

Room scripts allow you to assign commands to a room that are executed when you enter the room. Any settings defined in a room script are added to a temporary Class and are removed when you exit the room. This allows you to define aliases, triggers, buttons, etc that are only active in a particular room. Note the Room Scripts are created immediately after sending the direction to allow triggers to act on text received as part of the room information.

To create a room script, open the Properties for a room. Below the Room Name and Description fields is an area for the Room Script. Enter any normal CMUD scripting commands. Newlines are replaced with the current command separator (;) character when you save.

For example, a room script of:

list
#BUTTON 0 {Buy Bread} {buy bread}
#BUTTON 0 {Buy Potion} {buy potion}


will define two buttons, one for buying bread, and another for buying a potion. When you enter the room, the 'list' command is automatically sent to the MUD. This might be useful in a store where you want to see what is for sale and then buy stuff by just hitting a button. The buttons will be removed when you exit this room.

The combination of room scripts and offline mapper usage allow you to turn CMUD into a powerful Dungeon Master tool or for developing offline D&D scenarios.

Note that the room script is only executed when you move into a room. It is not executed if you manually select the current room on the map. To execute a room script for a given room, right-click on the room and select Execute Room Script from the context menu.
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net