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)
“Those commands of superiors which are contrary to our first duties are not to be obeyed.”
—Samuel Richardson (16891761)
“They went to him and woke him up, shouting, Master, Master, we are perishing! And he woke up and rebuked the wind and the raging waves; they ceased, and there was a calm. He said to them, Where is your faith? They were afraid and amazed, and said to one another, Who then is this, that he commands even the winds and the water, and they obey him?”
—Bible: New Testament, Luke 8:24-25.