DG Scripts - Commands

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 end

Read more about this topic:  DG Scripts

Famous quotes containing the word commands:

    It is clear that in a monarchy, where he who commands the exceution of the laws generally thinks himself above them, there is less need of virtue than in a popular government, where the person entrusted with the execution of the laws is sensible of his being subject to their direction.
    —Charles Louis de Secondat Montesquieu (1689–1755)

    The power of a text is different when it is read from when it is copied out.... Only the copied text thus commands the soul of him who is occupied with it, whereas the mere reader never discovers the new aspects of his inner self that are opened by the text, that road cut through the interior jungle forever closing behind it: because the reader follows the movement of his mind in the free flight of day-dreaming, whereas the copier submits it to command.
    Walter Benjamin (1892–1940)

    Unpaid work never commands respect ...
    Harriot Stanton Blatch (1856–1940)