Commands
A script can use any of the normal game commands. It can also use some special 'wizard-like' commands. In most implementations of DG scripts, these commands are prefixed with m, o or w (for mobile, object or room).
- teleport - move a player, mobile or object to somewhere else.
- echo - allows free-form text to be displayed within the room.
- mat - allows commands to be run in other rooms.
- purge - destroy an object.
- load - bring a new object or mobile into the game.
- force - make a player or mobile to do something.
The following is not to be considered gameplay advice or 'how-to-play'. It simply shows a working script for a programming language and has no use to the average player. This is intended as an example for a game designer.
This is an actual script that was used in ActsMUD for a while. In this script, if a particular cupboard becomes empty, then a cook will wash up some cups and put them away in the cupboard.
Although it seems, to the player, that the cook is reacting to events; the cook is actually a puppet of the cupboard which stays in full control. The cupboard checks itself every few seconds to see 'if' there are no cups inside (object 22222 is a cup). If so, then the cupboard creates (loads) some new cups, and forces the cook to pick them up (%force% cook get cup), and put them in the cupboard (%force% cook put cup cupboard). The say and echo commands are just to make it all seem a little more natural.
0) Vnum : 11111 1) Name : Cupboard refill 2) Intended for : Objects 3) Trigger types: Random 4) Numeric Arg : 100 5) Arguments : 6) Commands: set cook cook if !%cook% halt end if %self.count(22222)% == 0 %force% cook say Raca! There are no cups in the cupboard. %load% obj 22222 %force% cook get cup %load% obj 22222 %force% cook get cup %load% obj 22222 %force% cook get cup %echo% The cook does some frantic washing up. %force% cook put cup cupboard %force% cook put cup cupboard %force% cook put cup cupboard %force% cook Say that is better endRead more about this topic: DG Scripts
Famous quotes containing the word commands:
“Unpaid work never commands respect ...”
—Harriot Stanton Blatch (18561940)
“How often we read that the enemy occupied a position which commanded the old, and so the fort was evacuated! Have not the school-house and the printing-press occupied a position which commands such a fort as this?”
—Henry David Thoreau (18171862)
“If writers were too wise, perhaps no books would get written at all. It might be better to ask yourself Why? afterwards than before. Anyway, the force from somewhere in Space which commands you to write in the first place, gives you no choice. You take up the pen when you are told, and write what is commanded. There is no agony like bearing an untold story inside you.”
—Zora Neale Hurston (18911960)