|
DG scripts is a MUD scripting language that MUD builders can use to quickly add advanced interactive features to a MUD without requiring knowledge of a difficult programming language such as C.
The Death's Gate LanguageThe DG Scripting language was first developed at the now-defunct Death's Gate MUD, and is now a common addition to CircleMUD and some other codebases. Now it's included in the stock CircleMUD distribution (CircleMUD is under new official name tbaMUD). While simple and quick to learn, DG is a complete programming language, and all the normal programming expression conventions such as 'if' and 'while' are available. DG Scripts is based on the idea of the 'trigger' - a small program (script) which is called (run) as a consequence of a certain action. Triggers are normally attached to a mobile, object, or room. Although this may sound restrictive, in practice this set up is limited only by the imagination, as the results of one trigger will often be used to trigger another. The player, of course, does not usually see the association between object and trigger, so the effects can seem intelligent or random, adding excitement to the MUD. The association can be further masked by a delay or by assigning a variable which is noticed by another trigger later. Trigger TypesThere are many trigger types, here are five of the most important.
VariablesIn DG scripts, percent signs are used to show that a word is a variable (similar to csh), for example: The first half of the variable can refer to an actor (player or mob that trips the trigger), or to a mobile, object or room. The second half refers to a property that player or object has, such as the name, virtual number, strength and so on. CommandsA 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).
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 (oforce cook get cup), and put them in the cupboard (oforce cook put cup cupboard). The say and echo commands are just to make it all seem a little more natural. 0) Vnum : 11111 External links
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net