DM Reference

Last Updated: 4/3/2008 (Release 415)


DM language details

The DM (Dream Maker) language uses a syntax similar to C/C++ to build networked multi-user worlds. This reference and the accompanying guide discuss the structure and function of DM.


cache

See also:
FILE_DIR definition
cache_lifespan var (world)
fcopy_rsc proc
file proc
icons
sounds

Files specified in single quotes are loaded (at compile time) into the world cache file (ending in .rsc). These are referred to as resource files. At runtime these files are downloaded by players into their byond.rsc file for future use. With the appropriate verbs or through savefiles, players may also upload files into the world cache.

If a resource file is not used for a long time, it will be automatically removed from the cache file to save space. If a cache file gets too bulky, however, you may manually delete it and start from scratch.

To make compilation faster and to make it easier to distribute code, the compiler will use an existing cache file if possible. That means you could compile up a world, and send people the .dm and .rsc files without any need to package all the individual resource files. It is also possible to include additional supplementary .rsc files by using the #include statement.


comment

Comments may be used to explain code. They can also be used to turn off a line or block of code. All text inside a comment is ignored by the compiler.

The single line comment begins with // and runs to the end of the line.

The multi-line comment begins with /* and runs until */.

Multi-line comments may be nested.

Example:

// single line comment /* multi-line comment */

garbage collection

At runtime, data objects are garbage collected. That means data which is no longer in use gets automatically deleted to free up system memory. This applies to text strings, lists, savefiles, datum objects, and so on.

The garbage collector works by using an efficient reference counting system. Once an item is no longer referenced by any variable, it gets deleted. For the most part, that frees you from having to think about memory allocation, which is wonderful, especially in the case of text strings, which tend to be allocated on the fly all over the place.

There are a couple provisos that you should note. One is that circular references will never be deleted by the garbage collector. By circular reference, I mean a pair of objects with variables that point to each other, or even an object with a variable that points to itself. In rare cases, you may even depend on this behavior. When you are done with such objects, you should either null out the circular reference, or you should forcibly destroy each object with the del instruction.

An object with running or sleeping procs is referenced by the src variable of those procs and will therefore not be thrown out.

Another note is that the world.contents list does not count as a reference. Otherwise, /mob and /obj objects would never be deleted, which is not the case. Note that objects which are contained by another object or which contain objects themselves are referenced and will not be deleted. That means an object must be at loc=null with no contents and, of course, no other references anywhere in order to get deleted by the garbage collector.

Mobs with a non-empty key and all objects with non-empty tags are also immortal.

Turfs and areas do not currently get garbage collected.

When the world shuts down, all objects are destroyed, whether they are referenced or not. You don't have to worry about system memory getting consumed by persistent objects. That doesn't happen.

In general, people who do not like reference counting garbage collection should be happy that DM provides a del instruction, allowing you to take charge and delete things whether they are referenced or not. Another nicety is that this automatically nulls out any existing references to the object, so you don't end up with dangling references to a deleted object, which can otherwise be a great source of instability and mysterious bugs.


icons

See also:
FILE_DIR definition
cache
flick proc
icon
icon var (atom)
icon_state var (atom)
image objects

An icon file may be referenced by putting single quotes around the filename. The file extension determines the type of icon. Currently supported icon types are .dmi, .bmp, .png, .jpg, and .gif. To create dmi icons, use the Dream Maker icon editor. This allows you to make animations, 4 or 8 directional icons, and icons with different states (such as "live" and "dead").

Example:

mob icon = 'monster.dmi'

You can also load icons into memory at run-time and manipulate the graphical data to produce new icons dynamically. This is done by creating an /icon object.


icon arithmetic

See also:
icon proc
icon_states proc
icons
rgb proc
turn proc (applied to an icon)

NOTE: the following "arithmetical" methods of icon manipulation are being phased out in favor of the new /icon object, which can be directly manipulated and which provides a wider variety of operations.

There are several ways in which icons can be manipulated at runtime. They can be rotated, added together, and the colors components may be altered.

One purpose for such operations is to make players look different. Other interesting uses (and abuses) will undoubtedly follow.

Addition and Subtraction

The result of adding two icons is an arithmetic combination of the color components of each individual pixel. At positions where either icon is transparent, the result is also transparent. Subtraction, instead of increasing the intensity, decreases it by the amount in each pixel of the icon being subtracted.

Suppose you wanted to add together different bodies and heads. You could do that by making a few of each type with black backgrounds. When these add together, the black contributes nothing but prevents pixels in the other icon from getting clipped.

Example:

mob/verb addicon(I as icon) icon += I subicon(I as icon) icon -= I

If you need to add the same color to every pixel, you can do so using a color value. Color values have the same format as in HTML: "#RRGGBB" with two hexadecimal digits for each color component. That gives you a range in color from 0 to FF (which is 255 in decimal).

You can also specify a color value as "#RGB". The single digit is automatically repeated, so "#F00" is the same as "#FF0000", which is bright red. For certain pre-defined color values, you can also specify a name, such as "red". See HTML colors for a list of color names.

If you prefer base 10, you can create color values with the rgb(R,G,B) instruction. Each parameter is in the range 0 to 255.

Multiplication

To increase (or decrease) the intensity of an icon multiplicatively, you can use the '*' operator.

Example:

mob/verb/multicon(factor as num) icon *= factor

mouse control

Various mouse actions may be handled by defining procedures either on the client object or on the atomic object being manipulated. Any of the following procedures may be defined:

In general, define only the procedures you need, because extra communication overhead may be avoided when the compiler detects that you do not care about certain events.

The arguments used in mouse procs generally follow one of two forms:

For Click(), DblClick(), MouseDown(), MouseUp(), MouseEntered(), and MouseExited():
client/Click(object, location, control, params)
atom/Click(location, control, params)
For MouseDrag() and MouseDrop():
client/MouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params)
atom/MouseDrag(over_object, src_location, over_location, src_control, over_control, params)

The location argument varies with the type of control. For the map, it will be the turf where the mouse action happened. For info controls (statpanels), it will be the name of the statpanel where the action happened. For grid controls, it will be the cell where the action happened. For others controls it may vary, but most will leave this blank.

The control argument is the ID of the skin control where the action happened, such as "mappane.map" or "mainwindow.banner".

The params argument is text, and can be converted to a list using params2list(). It may contain any of the following properties, which will only be set if they are used:

The mouse pointer may be customized as well. The following variables all deal with the appearance of the pointer. They do not control what actions may be taken by the user, but they provide hints to the user about what actions may work.

When selecting a mouse pointer, you may provide your own custom icon or use one of the built-in pointers.

Note: Older games compiled prior to BYOND 4.0 had a different format for the MouseDown() and MouseUp() procs. These used icon_x and icon_y as arguments, but control and params have replaced them.


mouse pointers

See also:
mouse control
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
mouse_pointer_icon var (client)

The following mouse pointers are built-in and may be assigned to any of the mouse pointer variables. Of course, you can also define your own custom mouse pointers using an icon file.

MOUSE_INACTIVE_POINTER (0)
MOUSE_ACTIVE_POINTER (1)
MOUSE_DRAG_POINTER
Same as mouse_drag_pointer = MOUSE_ACTIVE_POINTER.
MOUSE_DROP_POINTER
Same as mouse_drop_pointer = MOUSE_ACTIVE_POINTER.
MOUSE_ARROW_POINTER
Same as mouse_over_pointer = MOUSE_INACTIVE_POINTER.
MOUSE_CROSSHAIRS_POINTER
Same as mouse_over_pointer = MOUSE_ACTIVE_POINTER.
MOUSE_HAND_POINTER

null

Variables that are not initialized have the value null. This value is distinct from 0 and "". If you compare it to these, using the == operator, it is not equal. However, in a numeric context (like a mathematical operation), null evaluates to 0 and in a text context (like insertion into a text expression), null evaluates to "". In a logical expression, null, 0, and "" evaluate to false and all other values are true.

In an embedded text expression, null behaves like "". That means, if you are expecting a variable to display a 0, you should explicitly initialize it to 0 rather than leaving it as null.


preprocessor

The preprocessor performs various transformations on source code as the DM compiler reads the file. It may be used to define macros--that is words which are replaced by other fragments of code. It is also possible to insert other source code files and to conditionally compile or not compile sections of code.

Preprocessor commands are called directives. They are placed on a line by themselves and always begin with a hash symbol #. The preprocessor directives recognized by DM are the same as standard C compilers:

#define
#if
#elif
#ifdef
#ifndef
#else
#endif
#include
#error

DM_VERSION macro

See also:
byond_version var (world)
byond_version var (client)
preprocessor

This macro indicates the version of the compiler. This could be useful when distributing code that uses new language features that would not compile in older compilers.

Example:

#if DM_VERSION < 230 #error This compiler is too far out of date! #endif

__FILE__ macro

See also:
ASSERT proc
DEBUG definition
__LINE__ macro
__MAIN__ macro

The __FILE__ macro expands to a string containing the name of the current source file. This may be useful when generating debugging error messages.


__LINE__ macro

See also:
ASSERT proc
DEBUG definition
__FILE__ macro

The __LINE__ macro is replaced by the line number in the current source file. This may be useful when generating debugging error messages.


__MAIN__ macro

See also:
preprocessor

The __MAIN__ macro is defined in the main .dme file being compiled. In all other files included by this file, __MAIN__ is not defined.

The purpose of this is for library writers to package a small demo of their library directly in the library source code. When users compile the library directly, the library's own .dme is the main file and can include extra files that are not normally part of the library.

Example:

#ifdef __MAIN__ #include "demo.dm" #include "demo.dmp" #endif

If the demo requires a lot of extra resources, it is probably better to package the demo as a separate project. Small demos, however, are nice and convenient using this "auto-demo" technique--especially since Dream Seeker automatically launches Dream Maker after installing a library containing a .dme file.


#define directive

See also:
preprocessor
Format:
#define Name Value
#define Name(Parameters) Value
Args:
Name: A macro definition.
Value: The value to substitute for Name.
Parameters: Arguments to pass into the macro.

The #define statement creates a macro that is substituted for Name. Substitution only applies to whole words. Text inside of double or single quotes is not processed for substitution, so "This is BIG." would not be modified even if a macro named BIG were defined. That is different from "This is [BIG].", where BIG is an embedded expression, which does get processed for macro substitution.

Example:

#define DAY 0 #define NIGHT 1 var/daytime = NIGHT //daytime = 1

Example:

#define SQR(X) ((X)*(X)) var/x = SQR(2) //x = ((2)*(2)) = 4

Note that it's usually important to use parentheses around any arguments you use in a macro. Otherwise strange results may occur if you use an expression such as 2+3. In the SQR(X) example, if there were no parentheses around each X then the expansion of the macro would be (2+3*2+3). Since the * operator has a higher precedence than + the result is 11, not 25 as expected. It's equally important to put parentheses around the entire macro for the same reason.


DEBUG definition

See also:
#define directive
Format:
#define DEBUG

If DEBUG is defined, source file and line number information will be stored in the compiled .dmb file. If a proc crashes during execution and DEBUG information is present, the current source file name and line number will be indicated in the error output.

This option increases the size of the .dmb, typically by about 10%. Execution of the code may also be a tiny bit slower.

If you are distributing the .dmb to players and you do not want them to have debug access at runtime, you should not compile in debug mode.

If you want to use the run-time profiler (see the debugging options in Dream Seeker), you must compile in debug mode. Then you can get a report of CPU usage by your various procs.


FILE_DIR definition

See also:
cache
icons
Format:
#define FILE_DIR Path
Args:
Path: A search path on the current filesystem.

This macro defines a search path to be used in evaluating resource files (icons and sounds). First the current directory is searched, then the first FILE_DIR path, then the next, etc.

Example:

#define FILE_DIR icons #define FILE_DIR icons/mobs mob/clown icon = 'clown.dmi'

This searches for the file at the paths "./clown.dmi", "./icons/clown.dmi", and "./icons/sounds/clown.dmi", where "." is the directory of the current source file.


#elif directive

See:
#if directive

#else directive

See:
#if directive

#endif directive

See:
#if directive

#error directive

See also:
preprocessor
Format:
#error Text
Args:
Text: an error message to display

The #error directive halts compilation and displays the specified message.

Example:

#if DM_VERSION < 4 #error This compiler is too far out of date! #endif

#if directive

See also:
#define directive
#ifdef directive
Format:
#if Val
...
#elif Val2
...
#else
...
#endif
Args:
Val: A logical expression.

The #if statement is used to conditionally compile code. If Val is true (non-zero), the code following the #if statement will be compiled. Otherwise, compilation skips to the next #elif, #else, or #endif statement.

The function defined() can be used in the conditional expression. It is true if its argument is a defined macro (with #define) and false otherwise.

Example:

#if defined(DEBUG) // This code will be compiled if DEBUG is // defined #else // This code will be compiled if DEBUG is // not defined #endif

#ifdef directive

See also:
#define directive
#if directive
#ifndef directive
Format:
#ifdef Name
Args:
Name: A macro definition.

The #ifdef statement is used to conditionally compile code. It is equivalent to #if defined(Name).


#ifndef directive

See also:
#define directive
#if directive
#ifdef directive
preprocessor
Format:
#ifndef Name
Args:
Name: A macro definition.

The #ifndef statement is used to conditionally compile code. It is equivalent to #if !defined(Name).


#include directive

Format:
#include "Filename"
#include <Filename>
Args:
"Filename": The path to the filename to include, from the current directory.
<Filename>: The path inside the BYOND lib directory.

The #include statement causes the compiler to process another file before continuing in the current source file.

If a file is included multiple times, only the first occurrence will be processed. That is a convenient addition to the standard C preprocessor, which DM otherwise emulates quite closely.

The file <stddef.dm> is automatically included before all other source code.

Example:

#include "test.dm" // checks ./test.dm #include <test.dm> // checks lib-path/test.dm

The BYOND lib directory is called "lib" and is located in the BYOND system directory (typically "\Program Files\Byond\lib"). If the file is not found there, it also looks in the user lib directory, which would typically be "...\Byond\user\login-name\lib".

Note that the compiler interface allows you to include files graphically by simply clicking the checkbox next to the file. This creates an include statement for you in the .dme project environment file. The only time you would still want to manually include files is when you need to ensure a certain order of processing. For example, if file "MyCode.dm" overrides procedure definitions of an object defined in "LibCode.dm", you should include "LibCode.dm" at the top of "MyCode.dm". Most other DM code is independent of order, but overriding procedure definitions is not. The compiler will warn you in such cases if you forget.

Another case in which you should manually include files is if you are writing a library to be used by other programmers. Since the .dme file is not distributed with a library, all necessary inclusions must be made in the .dm files.


#undef directive

See also:
#define directive
preprocessor
Format:
#undef Name
Args:
Name: A macro definition.

The #undef statement removes a macro definition.


sounds

See also:
FILE_DIR definition
cache
sound proc
/sound datum

A sound stored in a file may be referenced by putting single quotes around the filename. The file extension determines the type of sound. Currently supported music types include MIDI (.mid or .midi), and module formats .mod, .it, .s3m, .xm, and .oxm. Supported sound effect formats include .wav, .ogg, .raw, .wma, and .aiff.*

Example:

world << sound('fugue.midi')

This example plays the specified midi file to all players.

Notes

*The MP3 format is not presently supported by BYOND due to licensing issues. Ogg-Vorbis, however, is a good alternative. For music the module formats are also a good choice, and tend to be smaller.


text

See also:
<< output operator
entities (text)
macros (text)
tags (text)
text proc

Text consists of a string of characters enclosed in double quotes. To place a quote inside a string, escape it with \.

Example:

usr << "He said, \"Hi.\""

This example sends some text to the usr: He said, "Hi."

To insert a variable expression into a string, enclose it in brackets []. These are referred to as embedded text expressions. An object expression will display the object's name preceded by the text macro \the or \The if no other article has been specified. Capitalization of the article is inferred from context.

Example:

mob/verb/shout(T as text) world << "[usr]: [T]"

If this example is called by a mob named "Bill" with the text "hi everybody!", it will display "Bill: hi everybody!".

On the other hand, if it is called by a mob named "cat", it would display "The cat: hi everybody!".

For lengthy text strings, DM provides a special text document syntax. This begins with {" and ends with "}. It may include multiple lines and even un-escaped double quotes.

Example:

mob/verb/end() usr << {" This is the way the world ends This is the way the world ends This is the way the world ends Not with a bang but a whimper. --T.S. Eliot "Hollow Men" "} del world //the end!

entities (text)

See also:
macros (text)
tags (text)
text

Special characters may be inserted into text using HTML syntax. Such characters are known as entities. They start with an ampersand and end with a semicolon. The main reason for doing this is to insert characters that otherwise have a special meaning. The most common entities have names. The rest must be referred to by their ASCII number (e.g. &#38; is the same as &amp;). The common ones are listed in the following table. Note that the same effect may be achieved by simply escaping the special character (like \<). The full entity syntax is included for generality.
&amp; &
&lt; <
&gt; >
&quot; "
&copy; ©


macros (text)

See also:
icon text macro
text
text proc

Text macros start with '\' (a backslash) and end with a space or other punctuation.

\the, \The // insert 'the' (if needed) \a, \an, // insert 'a(n)' or 'some' (if needed) \A, \An \he, \He // insert 'he/she/they/it' \she, \She // same \his, \His // insert 'his/her/their/its' \him // insert 'him/her/them/it' \himself // insert 'himself/herself/themself/itself' \herself // same \hers // insert 'his/hers/theirs/its' \proper // used in an object name to force proper-noun behavior \improper // used in an object name to force improper-noun behavior \th // insert 1st, 2nd, 5th etc. \s // insert 's' if [] was plural \icon // insert icon of following [] \ref // insert a unique id for following [] \roman // insert following [] as a lower-case roman numeral \Roman // insert following [] as an upper-case roman numeral \... // suppress final new line \n // insert new line \" // insert double quote \\ // insert backslash \< // insert &amp;lt; (less than) \> // insert &amp;gt; (greater than) \(space) // skip a space \(newline) // skip a newline (and following space)

Example:

mob/verb/steal(M as mob,obj/O as obj in M) O.loc = usr view() << "[usr] finds \himself \an [O]."

Example:

var/DayCount world/proc/NewDay() DayCount++ world << "The [DayCount]\th day dawns."

Example:

obj/CPU name = "\improper CPU" //prevent capitalization from causing proper-noun behavior

icon text macro

See also:
icon_state var (atom)
macros (text)
style sheets
tags (text)

The \icon macro is used to treat the following embedded expression (in []'s) as an icon rather than as text. An object, for example, would be replaced by its icon rather than by its name.

Example:

usr << "You look like this: \icon[usr]!"

The \icon macro expands internally to the <IMG> tag. The above example, could be rewritten like this:

usr << "You look like this: \ <IMG CLASS=icon SRC=\ref[usr.icon] ICONSTATE='[usr.icon_state]'>!"

Note that the current icon state of the object is automatically used. Also note that the image belongs to a class called icon. That allows you to configure the way icons are displayed by using a style sheet. The following default style rule causes icons to be shrunk to 16 by 16 pixels so they fit in better with surrounding text:

IMG.icon {width: 16px; height: 16px}

You could override this setting globally in your own style sheet. You could even define rules to allow individual icons to be formatted differently from the rest.

Example:

BIG IMG.icon {width: 32px; height: 32px} SMALL IMG.icon {width: 16px; height: 16px}

With those rules in place, you could output a full sized icon by using the <BIG> tag:

usr << "You look like this: <BIG>\icon[usr]</BIG>!"

The one time that one might want to use the <IMG> tag directly is to specify the ALT text to be displayed on clients which don't support graphical icons.

Note that the \icon macro does not work in the mini-browser; it is only for text output. To make icons appear in an HTML document, use browse_rsc() to send an icon to the client before using browse() to display it.


ref text macro

See also:
Topic proc (client)
icon text macro
locate proc
macros (text)
tag var (datum)

The \ref text macro inserts a unique identification number or text string for the following embedded object (inside []'s). If the object has a tag, that will be used. Otherwise, an internal id number is used. In either case, the embedded reference is surrounded by [] brackets.

The reason the tag is preferred is that it stands a better chance of still being valid if the object is deleted and recreated (like in a world reboot). The internal id number, on the other hand, is transient and should only be expected to remain the same for the duration of the object's existence. If you want a more permanent reference, you must assign and save the object's tag variable.

The primary use for object references embedded in text is in topic links. This allows you to encode a reference to an object in the href value of a hyperlink. (Just make sure the object does not get deleted before the user executes the link. See garbage collection.)

Topic links that contain a parameter "src" assigned to an object reference are treated somewhat specially. Unless you override client.Topic() to do otherwise, the default behavior is to call the referenced object's own Topic() procedure.

Example:

mob/verb/test() usr << "Click <a href=?src=\ref[src];action=start>here</a>!" mob/Topic(href,href_list[]) switch(href_list["action"]) if("start") usr << "Starting the game..." else return ..()

The above example uses an embedded reference to the player's own mob to create a link to a topic handled by that mob's Topic() proc. The href_list parameter is simply the result of params2list(href).

In that example, the embedded reference was automatically converted back into an object (dereferenced) for you. If you embed references to additional objects in the href data, you would have to dereference those yourself using the locate() instruction.


style sheets

See also:
entities (text)
macros (text)
script var (client)
tags (text)
text

HTML tags, such as <FONT> may be used to directly format output text. Another approach, however, is to use HTML tags to specify purely structural information and use a style sheet to define how various elements within that structure should be treated. DM uses a subset of the Cascading Style Sheet (CSS) language, which was introduced for this purpose in HTML documents.

This section discusses the syntax of style sheets as an independent element. For information on how to include the style sheets in your DM code, see the section on client.script.

As an example of a style sheet, one might want combat and conversational messages to appear differently--perhaps using different colors. Instead of using the <FONT> tag to color the text, you could use <SPAN> to mark the beginning and ending of the text and to specify what kind of message it is. The result might be text such as the following:

"[usr] <SPAN CLASS=combat>spanks</SPAN> [targ]!" "[usr] says, '<SPAN CLASS=chat>[msg]</SPAN>'"

The CLASS attribute may be used with any tag, but SPAN and DIV are often convenient because they have no other side-effect but defining the style class. SPAN is for text within a single paragraph and DIV is for whole paragraphs. The way text belonging to a particular class is formatted may be controlled in a style sheet such as the following:

.combat {color: red} .chat {color: green}

This says that text in the 'combat' class should be colored red and text in the 'chat' class should be colored green. These classes are not pre-defined; you can create whatever new style classes you need.

The advantage of using style sheets instead of direct formatting tags is that you can cleanly separate structural information (such as combat and conversational messages) from formatting information (such as red and green text). By separating the two, you or the player can easily plug in different formatting schemes without changing any of the actual content.

A style sheet is composed of a list of rules, such as the two rules in the preceding example. Each rule contains one or more selectors followed by a body of attribute assignments (in braces). The selector specifies the context of the rule and the body specifies the format.

A selector may specify a container tag (such as SPAN, BODY, or P) and a class. The above example could have been written with a selector of SPAN.chat. However, by leaving out the tag, it applies to any tag with CLASS=chat. It is also possible to only specify the tag and not the class. In that case, the selector applies to any matching tag, regardless of class.

To specify a nested context, several simple selectors may be listed one after the other. For example, emphasized text within a combat message could be enlarged with the following rule:

.combat EM {font-size: larger}

It is also possible to list several selectors separated by commas in order to make them all apply to the same body. For example, this next rule is equivalent to the two following ones:

.combat EM, .chat EM {font-size: larger} .combat EM {font-size: larger} .chat EM {font-size: larger}

The style rule body contains a list of attribute assignments, delimited by semicolons. Each assignment takes the form of an attribute name, followed by a colon, followed by the value of the attribute. The following table summarizes the recognized attributes and their possible values.
color #F00, #FF000, red, rgb(255,0,0), rgb(100%,0%,0%)
background
font-size 10pt, 1.5em, 150%
font-style normal or italic
font-weight normal, bold, lighter, darker, or 100 to 900
font-family monospace, sans-serif, serif, cursive, ...
font style weight size family
text-decoration none or underline
text-align right, left, or center
text-indent 0.25in, 3em, 20pt
margin-left
margin-right
width 16px, 32px, auto
height

fonts

The font attribute is a special short-hand for assigning font-size, font-style, font-weight, and font-family in one statement. Any properties that are not specified in the font statement are assigned to their default values.

The font family may be a specific font name or a more general category such as monospace or sans-serif. Since not all users necessarily have the same fonts installed, it is a good idea to list alternate fonts. The desired font is placed first, followed by other possible fall-backs, each separated by a comma. Usually a general family such as monospace is listed last of all. Any font names containing a space should have quotes around them.

The following example sets the font for the <BODY> tag. Even if you don't explicitly use <BODY> in output text, it is applied implicitly.

BODY {font: 12pt 'Times New Roman', sans-serif}

This sets the font to 12 point and selects Times New Roman if it is available and otherwise falls back on a system-determined sans-serif font. This command also implicitly specifies not to use italics and to use a normal font weight (not bold).

Font sizes may be specified in points (1pt = 1/72 of an inch), picas (1pc = 12pt), pixels (px), inches (in), centimeters (cm), and millimeters (mm). There are also various levels corresponding to the traditional 1 to 7 HTML scale. These are xx-small, x-small, small, medium, large, x-large, and xx-large. In addition to these absolute font sizes, it is possible to use a relative size, such as 150% or equivalently 1.5em. This scales the font relative to the currently active font setting.

In addition to regular classes, there are special pseudo-classes for handling embedded hyperlinks. These are specified in the selector with the class starting with a colon rather than a dot. They are :link, :visited, and :active. These only apply to the <A> tag. The :link class applies to hyperlinks in their normal state. Once a link has been clicked, it belongs instead to the :visited class. When the user holds the mouse over a link, it temporarily belongs to the :active class. The only attribute that may change in an active or visited link is the text color.

margins and indents

Paragraphs can be given different margins according to your preferences. The margin-left attribute controls the left margin, and margin-right is the right margin. You can use specific sizes like inches or points, or a relative size unit like em or ex. (A percentage is interpreted so that 100% is 1em, not the width of the window.) Using the text-indent attribute will indent the first line of a paragraph from the left margin. It is possible to create a hanging indent by using a negative value for text-indent, like so:

BODY {text-indent: -0.5in; margin-left: 0.5in}

background colors

The background attribute is only relevant to the BODY context. It causes the entire terminal background to change color. When doing this, it is usually necessary to change the foreground colors of text or it may become unreadable. The various standard classes of output generated by DreamSeeker are in the following table.

system colors

system notice general notices from the client
system command echo command echoing
system command expansion command-line expansion list
system pager pager messages
system irc IRC command prefix

The value of the CLASS attribute may contain a list of classes separated by spaces. This permits client output to be in the 'system' class as well as more specific ones. That allows you to change all of these colors in one shot if you are too lazy to change them each individually. For example, if you define a style sheet that changes the background color, you might need to redefine the various foreground colors like this:

BODY {background: aqua; color: black} .system {color: red; font-weight: bold} .command {color: green}

In this example, the background color of the terminal will be aqua, normal text from the server will be black, and all output from the client will be bold and red, except echoed commands and expansion lists, which will be bold and green. The more specific .command rule is placed after the general .system rule so that its color takes precedence. This is how style sheets are composed--you write general rules first followed by any exceptions.

style rule precedence

The order in which rules are specified is one of the factors that determines precedence of style sheet commands. The language is known as Cascading Style Sheets because of its ability to handle several layers of stylistic rules, intermingling the configurations of the user and the designer in an ordered fashion.

Rules are selected by first finding all matching candidates for a given attribute in the current HTML tag being processed. If there is more than one, rules from a higher level style sheet take precedence over lower level ones. That means the basic user configurable settings in DreamSeeker are the lowest priority, followed by a style sheet in the user's .dms script file, followed by a style sheet from the designer's client.script setting, because that is the order in which these are read by the style sheet manager.

Rules from the same style sheet are ordered by specificity. The selector SPAN.chat is more specific than .chat and .chat EM is more specific than EM. In general, the more classes referenced by a selector, the more specific it is. When that results in a tie, the selector with the greater number of tags takes precedence.

If two rules about the same attribute come from the same sheet and have the same specificity, the final one to be defined takes precedence.

In the rare event that a rule needs to break out of the normal order of precedence, it can be flagged as important. In this case it will take precedence over all other "unimportant" rules. However, if more than one rule is important, the normal rules of precedence will be used to resolve the conflict.

The important flag is applied after the attribute assignment like this:

BODY {background: white ! important; font: serif}

In the above example, only the background color is important, not the font specification.

STYLE attribute

Style commands may also be inserted directly in an html tag to control its appearance. This does not have the advantages of style sheets, which separate content from presentation, but it does allow you to use the style sheet syntax when formatting text.

The following example uses the style attribute to color some text:

usr << "That <SPAN STYLE='color: red'>HURT</SPAN>!"

As you can see, the STYLE attribute of any tag can be assigned to a text string containing a list of attribute assignments. Just the body of the style rule is given, since no selector is needed to match the current context.


tags (text)

See also:
entities (text)
macros (text)
style sheets
text

Text tags (also known as elements by snooty HTML purists) control how the text is formatted. HTML syntax is used, so all tags start with < and end with >. The tags which are currently supported by Dream Seeker, are listed below:

<A></A> //anchor (hyperlink) <ACRONYM></ACRONYM> //acronym or abbreviation <B></B> //bold text <BIG></BIG> //one size bigger text <BODY></BODY> //body of html document <BR> //line break <CITE></CITE> //citation reference <CODE></CODE> //program source code <DFN></DFN> //definition <DIV></DIV> //used in conjunction with style sheets <EM></EM> //emphasized text <FONT></FONT> //font face, color, and size <H1></H1> //heading level <H2></H2> <H3></H3> <H4></H4> <H5></H5> <H6></H6> <HEAD></HEAD> //document head section <HTML></HTML> //html document <I></I> //italic text <IMG></IMG> //display icons <KBD></KBD> //keyboard input <P></P> //paragraph <PRE></PRE> //pre-formatted text <S></S> //overstrike text <SAMP></SAMP> //sample output <SMALL></SMALL> //one size smaller text <SPAN></SPAN> //used in conjunction with style sheets <STRONG></STRONG> //strongly emphasized text <STYLE></STYLE> //contains a style sheet <TITLE></TITLE> //document title <TT></TT> //typewriter style <U></U> //underline <VAR></VAR> //variable name
<XMP></XMP>          //preformatted (tags ignored)

In addition to these, the <BEEP> tag, which is not standard HTML, may be used to beep the terminal.

Some tags take additional parameters, known as attributes. The most common ones are <FONT> and <A>. The syntax for these is illustrated by the following two examples:

"How about <FONT FACE=Arial COLOR=red SIZE=+1>this</FONT>!" "Click <A HREF=byond.com TITLE=BYOND!>here</A>!"

As many attributes may be specified as desired. The attribute value may have quotes around it, but this is only necessary if the value contains spaces. It is usually more convenient to use single quotes so you don't have to escape the double quotes, but you can also embed the HTML in a text document to avoid the need for escaping quotes.

Text colors may be specified by name or RGB value. The named colors and their corresponding RGB value are listed in the following table:

black #000000
silver #C0C0C0
grey #808080
white #FFFFFF
maroon #800000
red #FF0000
purple #800080
fuchsia #FF00FF
green #00C000
lime #00FF00
olive #808000
yellow #FFFF00
navy #000080
blue #0000FF
teal #008080
aqua #00FFFF

The hexadecimal colors above are written with 8 bits (two hex digits) for each color. It is also possible to use 4 bit values by using only one hex digit per color. The full 8 bit color is produced by repeating each digit. For example, #F00 (red) is the same as #FF0000.

Text sizes range from 1 to 7, 1 being the smallest and 7 being the largest. In addition to absolute sizes, relative sizes may be specified (like +1 for one size bigger or -1 for one size smaller).


area

See also:
atom
procs (area)
rooms
vars (area)

Areas are derived from /area. Regions on the map may be assigned to an area by painting it onto the map. Areas off the map serve as rooms that objects may enter and exit.

For each area type defined, one area object is created at runtime. So for areas on the map, all squares with the same area type belong to the same instance of the area.

Additional instances of rooms may be created from the same type by explicitly creating them with null as the initial location. That is, the first argument to new() should either be null or left unspecified.

The following example defines the area prototype /area/outside. It also defines an action to be taken when somebody enters an area, namely to display its description.

Example:

area Entered(O) if(desc) O << desc return ..() outside desc = "Ah! A breath of fresh air!"

procs (area)

Built-in area procs:

area/proc
Click
DblClick
Del
Enter
Entered
Exit
Exited
MouseDown
MouseDrag
MouseDrop
MouseExited
MouseEntered
MouseUp
New
Read
Stat
Topic
Write

rooms

Areas that are not located on the map are referred to as rooms. When a player enters one, the map goes away and you have something like a text MUD. By default, there would be no way for players to move from one room to another, so you have to handle movement yourself.

You can check the variable area.x to see if a given area is on the map or not.

The following example puts players in a room when they log in and provides a single exit.

Example:

mob/Login() if(!loc) Move(locate(/area/birthing_hut)) return ..() area/birthing_hut Entered(O) O << "Waaaaah! You land in a pile of straw." return ..() verb/exit() if(Move(locate(1,1,1))) //jump to the map or whatever usr << "You crawl into the open air..." else usr << "The hut door is blocked. You cannot get out."

vars (area)

Built-in area vars:

area/var
contents
density
desc
dir
gender
icon
icon_state
invisibility
underlays
overlays
layer
luminosity
mouse_over_pointer
mouse_drag_pointer
mouse_drop_pointer
mouse_drop_zone var
mouse_opacity var
name
opacity
parent_type
suffix
tag
text
type
vars
verbs

parent_type var (area)

See also:
parent_type var

The default parent_type of /area is /atom.


atom

See also:
area
datum
mob
movable atoms
obj
procs (atom)
turf
vars (atom)

The /atom object type is the ancestor of all mappable objects in the game. The types /area, /turf, /obj, and /mob are all derived from /atom. You should not create instances of /atom directly but should use /area, /turf, /obj, and /mob for actual objects. The /atom object type exists for the purpose of defining variables or procedures that are shared by all of the other "physical" objects. These are also the only objects for which verbs may be accessible to the user.

/atom is derived from /datum, so it inherits the basic properties that are shared by all DM objects.


movable atoms

See also:
atom
mob
obj
procs (movable atoms)
vars (movable atoms)

The /atom/movable object type is the ancestor of all mappable objects that are capable of motion. The types /obj and /mob are derived from /atom/movable. You should not create instances of /atom/movable but should use /obj and /mob for actual objects. This object definition exists solely to define variables and procedures related to motion.


procs (movable atoms)

Built-in movement procs:

atom/movable/proc
Bump
Move

Bump proc (movable atom)

See also:
Move proc (movable atom)
Format:
Bump(atom/Obstacle)
When:
Called when a movement fails due to a dense blockage.
Args:
Obstacle: The blocking object.
Default action:
If the obstacle is a mob in the src's group, swap their positions.

Move proc (movable atom)

See also:
Bump proc (movable atom)
Enter proc (atom)
Entered proc (atom)
Exit proc (atom)
Exited proc (atom)
loc var (atom)
walk proc
Format:
Move(NewLoc,Dir=0)
Returns:
1 on success; 0 on failure.
When:
Called to move the object. By default, client.Move() calls this proc when players use direction keys. The automated movement functions (like walk()) also call this proc. Directly setting the loc variable does not call this procedure.
Args:
NewLoc: The new location.
Dir: The direction of movement (or 0).
Default action:
First call src.loc.Exit(). If that succeeds, call NewLoc.Enter(). If that succeeds, set src.loc to NewLoc. Otherwise call src.Bump() if there is a blockage. If dir is zero, re-orient the src to reflect the direction of motion; otherwise re-orient the src to the specified dir.

vars (movable atoms)

Built-in movement vars:

atom/movable/var
animate_movement
screen_loc
pixel_step_size

animate_movement var (movable atoms)

See also:
Move proc (movable atom)
pixel_step_size var (movable atoms)
Default value:
FORWARD_STEPS (1)
Possible values:
NO_STEPS (0)
FORWARD_STEPS (1)
SLIDE_STEPS (2)
SYNC_STEPS (3)

Setting this to 0 causes movement between two adjacent positions to be displayed as a single discrete jump. Otherwise, objects will be made to glide from one position to another, using the movement animation defined in the icon file if one is defined.

By default, movement animation avoids cutting corners, since this can look very bad in some games. If you want objects to take the shortest (and smoothest) visual path when moving around, use SLIDE_STEPS instead of the default FORWARD_STEPS. This also allows the object to be facing in a different direction than it is moving, so make sure this is what you want.

SYNC_STEPS is intended for objects that move in unison as part of a larger "conglomerate" object. You should set the movement animation to SYNC_STEPS on all but a single "head" object, which will serve as the leader when choosing pixel step sizes. If you do not use SYNC_STEPS, there are cases where the pixel offsets of objects may get out of sync during motion, causing the object to visually break up.


pixel_step_size var (movable atoms)

See also:
animate_movement var (movable atoms)
pixel_step_size var (client)
pixel_x var (atom)
Default value:
0

This controls the number of pixels an object is moved in each footstep during animated movement. The default value of 0 chooses automated control over this value, which generally results in a minimum footstep of 4 pixels that is increased when necessary to keep up with motion on the turf grid.

Be careful about using small step sizes. Icons with high contrast pixel-level detail can look pretty ugly when displaced by short distances.


screen_loc var (movable atoms)

See also:
layer var (atom)
screen var (client)
view var (client)

This is a text string that controls where an object that is listed in client.screen will appear on the user's screen. The format is:

"x,y" "x1,y1 to x2,y2"

The bottom left corner of the map viewport (southwest) is "1,1". If the view is 11x11, then the top-right corner (northeast) is "11,11".

The edges of the map may also be referenced by using directions, such as "3,NORTH". For convenience, the order of coordinates is arbitrary when using directions, so one may specify y before x as in "NORTH,WEST". In expressions such as the latter, you may also leave out the comma.

A range of coordinates (the second format above) causes a square region to be filled with the object at each position. The southwest and northeast corners of the box are indicated in the screen_loc value.

Normal layering rules apply to screen objects, so to color the background of the map (visible at least when regions of the map are blocked from view), one could create an object with a drawing layer below all other map objects and set its screen_loc to cover the whole map (e.g. "1,1 to 11,11").

In addition to objects inside of the map view, one may create border objects. Borders are automatically created when screen objects are placed at coordinates outside of the inner map view. For example, objects placed at y=0 fall on a border directly below the map and y=-1 is one layer below that.

Offsets may be applied to screen_loc coordinates. For example, "NORTH+1,WEST" is in a border above the map.

It is also possible to specify a pixel offset. Screen objects do not use pixel_x and pixel_y for this purpose, because it is intended that an object could exist on the map and in the screen object list simultaneously, so positioning must be independent.

Pixel offsets are specified after a colon line this: "1:16,1:16". In this case the object is shifted to the northeast by 16 pixels.


procs (atom)

Built-in atom procs:

atom/proc
Click
DblClick
Del
Enter
Entered
Exit
Exited
MouseDown
MouseDrag
MouseDrop
MouseExited
MouseEntered
MouseUp
New
Read
Stat
Topic
Write

Click proc (atom)

See also:
Click proc (client)
DblClick proc (atom)
MouseDown proc (atom)
MouseDrag proc (atom)
MouseDrop proc (atom)
MouseEntered proc (atom)
MouseExited proc (atom)
MouseUp proc (atom)
show_popup_menus var (client)
Format:
Click(location,control,params)
When:
Called when the object is clicked.
Args:
location: the turf, stat panel, grid cell, etc. in which the object was clicked
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This proc is called by the default client.Click() procedure.

The following example allows the player to walk to a position by clicking it.

Example:

turf/Click() walk_to(usr,src)

DblClick proc (atom)

See also:
Click proc (atom)
DblClick proc (client)
MouseDown proc (atom)
MouseDrag proc (atom)
MouseDrop proc (atom)
MouseEntered proc (atom)
MouseExited proc (atom)
MouseUp proc (atom)
show_popup_menus var (client)
Format:
DblClick(location,control,params)
When:
Called when the object is double-clicked.
Args:
location: the turf, stat panel, grid cell, etc. in which the object was double-clicked
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This proc is called by the default client.DblClick() procedure.

This example allows the player to teleport to a position by double clicking it.

Example:

turf/DblClick() usr.Move(src)

Enter proc (atom)

See also:
Entered proc (atom)
Exit proc (atom)
Exited proc (atom)
Move proc (movable atom)
Format:
Enter(atom/movable/O)
Returns:
1 to permit; 0 to deny.
When:
Called when an object attempts to enter the contents list.
Args:
O: the object attempting to enter.
Default action:
Permit the object to enter (returning 1) if this would result in 1 or fewer dense objects at the location.

Entered proc (atom)

See also:
Enter proc (atom)
Exit proc (atom)
Exited proc (atom)
Move proc (movable atom)
Format:
Entered(atom/movable/Obj,atom/OldLoc)
When:
Called when an object has entered the contents list through Move(). Directly setting the object's loc does not result in a call to Entered() or any other movement side-effects. The same goes for creation or deletion of an object at a location.
Args:
Obj: the object that entered (a mob or obj).
OldLoc: the previous location of the object.
Default action:
none

Example:

turf/pit Entered(O) O << "OUCH. You fell in a pit!"

The mob's Entered() and Exited() procs can be used to control what happens when objects are added or removed from the mob's inventory. Of course that could all be done within get() and drop() verbs, but the following code separates user interface from lower-level functions.

Example:

obj var weight = 10 verb get() set src in oview(1) if(Move(usr)) usr << "You pick up \a [src]." else usr << "You cannot pick up [src]." drop() set src in usr if(Move(usr.loc)) usr << "You drop \a [src]." mob var weight max_weight = 50 Entered(obj/O) weight += O.weight Exited(obj/O) weight -= O.weight Enter(obj/O) //only allow entrance if weight is within the limit if(O.weight + weight <= max_weight) return ..()

To see the advantages of this arrangement, imagine that there are certain situations in which an object may be created directly within the mob's inventory without the mob picking it up. You can still run it through your normal movement rules without calling get().

Example:

mob/verb/wish() var/obj/O = new() //create it with loc=null if(O.Move(usr)) //and then move it into inventory usr << "Your wish has been granted!" else usr << "You are too greedy!" del O

Exit proc (atom)

See also:
Enter proc (atom)
Entered proc (atom)
Exited proc (atom)
Move proc (movable atom)
Format:
Exit(atom/movable/O)
Returns:
1 to permit; 0 to deny.
When:
Called when an object attempts to exit the contents list.
Args:
O: the object attempting to exit.
Default action:
Allow the object to exit (returning 1).

Exited proc (atom)

See also:
Enter proc (atom)
Entered proc (atom)
Exit proc (atom)
Move proc (movable atom)
Format:
Exited(atom/movable/Obj)
When:
Called when an object has exited from the contents list through a call to Move(). Directly setting the object's loc does not result in a call to Exited() or any other movement side-effects. The same goes for deletion of an object.
Args:
Obj: the object that exited (a mob or obj).
Default action:
none

MouseDown proc (atom)

See also:
Click proc (atom)
DblClick proc (atom)
MouseDown proc (client)
MouseDrag proc (atom)
MouseDrop proc (atom)
MouseEntered proc (atom)
MouseExited proc (atom)
MouseUp proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
MouseDown(location,control,params)
Args:
location: the turf, stat panel, grid cell, etc. in which the object was clicked
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This is called when a mouse button is pressed while pointing to this object.

Don't define this unless you need it, because it generates extra communication that is otherwise avoided. Most operations can be done through Click(), DblClick(), and MouseDrop(). The other procedures are simply available for completeness.

Note: In BYOND 3.5 this procedure took three different arguments: location, icon_x, and icon_y. Since icon_x and icon_y have been replaced, old code will need to be modified. Games compiled before this change will still work normally.


MouseDrag proc (atom)

See also:
Click proc (atom)
DblClick proc (atom)
MouseDown proc (atom)
MouseDrag proc (client)
MouseDrop proc (atom)
MouseEntered proc (atom)
MouseExited proc (atom)
MouseUp proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
MouseDrag(over_object,src_location,over_location,src_control,over_control,params)
Args:
over_object: the object under the mouse pointer
src_location: the turf, stat panel, grid cell, etc. from where the src object was dragged
over_location: the turf, stat panel, grid cell, etc. containing the object under the mouse pointer
src_control: The id of the skin control the object was dragged from
over_control: The id of the skin control the object was dragged over
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This is called while dragging this object by pressing and holding the left mouse button over the object and moving the mouse. The over_object may be null if dragging over a stat panel or over other empty space.

Don't define this unless you need it, because it generates extra communication that is otherwise avoided. Most operations can be done through Click(), DblClick(), and MouseDrop(). The other procedures are simply available for completeness.


MouseDrop proc (atom)

See also:
Click proc (atom)
DblClick proc (atom)
MouseDown proc (atom)
MouseDrag proc (atom)
MouseDrop proc (client)
MouseEntered proc (atom)
MouseExited proc (atom)
MouseUp proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
MouseDrop(over_object,src_location,over_location,src_control,over_control,params)
Args:
over_object: the object under the mouse pointer
src_location: the turf, stat panel, grid cell, etc. from where the src object was dragged
over_location: the turf, stat panel, grid cell, etc. containing the object under the mouse pointer
src_control: The id of the skin control the object was dragged from
over_control: The id of the skin control the object was dropped onto
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This is called when the a mouse button is released after dragging this object. The over_object may be null if dropping over a stat panel or over other empty space.


MouseEntered proc (atom)

See also:
Click proc (atom)
DblClick proc (atom)
MouseDown proc (atom)
MouseDrag proc (atom)
MouseDrop proc (atom)
MouseEntered proc (client)
MouseExited proc (atom)
MouseUp proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
MouseEntered(location,control,params)
Args:
location: the turf, stat panel, grid cell, etc. containing the object
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This is called when the mouse moves onto the object with no buttons pressed.

Don't define this unless you need it, because it generates extra communication that is otherwise avoided. Defining it on only the objects that require it reduces overhead.


MouseExited proc (atom)

See also:
Click proc (atom)
DblClick proc (atom)
MouseDown proc (atom)
MouseDrag proc (atom)
MouseDrop proc (atom)
MouseEntered proc (atom)
MouseExited proc (client)
MouseUp proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
MouseExited(location,control,params)
Args:
location: the turf, stat panel, grid cell, etc. containing the object
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This is called when the mouse moves off of an object with no buttons pressed.

Don't define this unless you need it, because it generates extra communication that is otherwise avoided. Defining it on only the objects that require it reduces overhead.


MouseUp proc (atom)

See also:
Click proc (atom)
DblClick proc (atom)
MouseDown proc (atom)
MouseDrag proc (atom)
MouseDrop proc (atom)
MouseEntered proc (atom)
MouseExited proc (atom)
MouseUp proc (client)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
MouseUp(location,control,params)
Args:
location: the turf, stat panel, grid cell, etc. in which the object was clicked
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control

This is called when a mouse button is released while pointing to this object.

Don't define this unless you need it, because it generates extra communication that is otherwise avoided. Most operations can be done through Click(), DblClick(), and MouseDrop(). The other procedures are simply available for completeness.

Note: In BYOND 3.5 this procedure took three different arguments: location, icon_x, and icon_y. Since icon_x and icon_y have been replaced, old code will need to be modified. Games compiled before this change will still work normally.


New proc (atom)

See also:
New proc (datum)
new proc
Format:
New(loc)
(supports named arguments)
When:
Called when the object is created.
Args:
loc: The initial location.
Default action:
None.

By the time New() is called, the object has already been created at the specified location and all of its variables have been initialized. You can perform additional initialization by overriding this procedure.

Since the initial location parameter passed to new() is applied before New() is even called, there is some special handling of the loc variable when using named arguments in a call. Normally, if a procedure is overridden, named arguments in a call are matched against those in the the overridden definition. In this case, however, the loc parameter name is hard-coded. Regardless of what you call the first argument in your definition of New(), the initial location will be taken from the first positional argument, or from the argument named loc if there are no positional arguments.

The following example does some extra initialization that is not possible in the variable definition section, because it requires a runtime evaluation. This is a common reason to use New().

Example:

mob var birthdate //time stamp New() birthdate = world.realtime return ..() verb/look() set src in view() usr << "[src] was born on [time2text(birthdate,"DD-MMM-YYYY")]."

Stat proc (atom)

See also:
Stat proc (client)
stat proc
Format:
Stat()
When:
Called periodically by the client to update the stat window.
Default action:
none.

The following code could be used to display a player's current status.

Example:

mob/var health = 100 mob/Stat() stat("health",health) statpanel("Inventory",contents)

vars (atom)

Built-in atom vars:

atom/var
contents
density
desc
dir
gender
icon
icon_state
invisibility
infra_luminosity
underlays
overlays
loc
layer
luminosity
mouse_over_pointer
mouse_drag_pointer
mouse_drop_pointer
mouse_drop_zone var
mouse_opacity var
name
opacity
parent_type
pixel_x
pixel_y
suffix
tag
text
type
vars
verbs
x
y
z

contents list var (atom)

See also:
Enter proc (atom)
Entered proc (atom)
Exit proc (atom)
Exited proc (atom)
list
loc var (atom)
Default value:
List of contained objects.

Except in the case of areas, this list is always restricted to objs and mobs (ie movable objects). Only direct contents are listed. Items inside of a bag object, for example, would not show up in the mob's contents list.

The contents of areas are a little different. The turfs contained in the area are in the list along with any objs or mobs directly contained by those turfs.


density var (atom)

See also:
Enter proc (atom)
Entered proc (atom)
Exit proc (atom)
Exited proc (atom)
Default value:
0 (1 for mobs)

This turns the object's density on or off (1 or 0). Two dense objects may not occupy the same space in the standard movement system.


desc var (atom)

Default value:
null

This is the description of the object.

Example:

mob/verb/look(atom/O in view()) if(O.desc) usr << O.desc else usr << "It's just \an [O]."

dir var (atom)

See also:
Move proc (movable atom)
icon var (atom)
turn proc
Default value:
SOUTH
Possible values:
NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST

This is the direction that the object is facing. This has little effect unless the object's icon is directional. In the case of a directional icon, this selects the corresponding orientation from the icon file.

An icon file with only four (cardinal) directions makes the choice of orientation ambiguous when the true direction is a diagonal. In that case, of the two possibilities, the one closest to the previous orientation is displayed. Sounds complicated, but it's what one would naturally expect.


gender var (atom)

See also:
macros (text)
name var (atom)
Default value:
"neuter"

This sets the object's gender. This influences text macros like \he, which may expand to "it", "he", "she", or "they". Valid values are:

"neuter" "male" "female" "plural" These are also defined as constants, which may help prevent typos, since the compiler will complain if it doesn't recognize what you type: NEUTER MALE FEMALE PLURAL

icon var (atom)

See also:
icon proc
icon_state var (atom)
icons
overlays var (atom)
underlays var (atom)
Default value:
null

This is the icon file that will be used to represent the object on graphical clients.

Example:

turf/wall icon = 'wall.dmi'

You can also assign this to an external file at run-time with an expression such as file("wall.dmi"), but you would only want to do that when the other method is not possible, because it requires addition of the file to the resource cache, which can take a little time.

When this variable is assigned to any dynamically created icon object, that object gets dumped into the world's resource cache (the .rsc file), and a reference to that cached file is assigned to atom.icon. In other words, don't expect comparisons such as usr.icon == MyDynamicallyCreatedIcon to work unless you have used fcopy_rsc() to get a cache reference to your dynamically created icon first. This is almost never an issue, so don't worry about it if none of that made any sense to you!


icon_state var (atom)

See also:
flick proc
icon var (atom)
icon_states proc
Default value:
null

Icons may appear differently depending on the icon state. For example, turf door icons could have "open" and "closed" states. If a state is specified that does not exist in the icon file, the default null state will be displayed if it exists.

Example:

turf/door icon_state = "closed" density = 1 verb open() set src in view(1) icon_state = "open" density = 0 close() set src in view(1) icon_state = "closed" density = 1

infra_luminosity var (atom)

See also:
luminosity var (atom)
see_infrared var (mob)
sight var (mob)
view proc
Default value:
0

This causes the object to be visible in the dark to mobs that can see infrared light. Nothing but the object itself is lit up by the infrared emission. The scale is identical to luminosity: 1 makes it visible only from the same location; 2 makes it visible from a neighboring position; and so on.


invisibility var (atom)

See also:
invisibility setting (verb)
opacity var (atom)
see_invisible var (mob)
sight var (mob)
view proc
Default value:
0
Possible values:
0 to 101

This determines the object's level of invisibility. The corresponding mob variable see_invisible controls the maximum level of invisibility that the mob may see.

A value of 101 is absolutely invisible, no matter what, and it is filtered from all lists of possible values for verb arguments. This is intended for objects that exist purely for some internal purpose, such as "verb containers".


layer var (atom)

See also:
overlays var (atom)
z var (atom)
Default value:
1 (AREA_LAYER)
2 (TURF_LAYER)
3 (OBJ_LAYER)
4 (MOB_LAYER)

This numerical value determines the layer in which the object is drawn on the map. By default, the order is area, turf, obj, mob, followed by missiles and images (in FLY_LAYER).

Example:

turf archway layer = MOB_LAYER+1 //overhead

When making objects to be used as graphical overlays, you should also be aware of the special FLOAT_LAYER value. This causes the overlay (or underlay) to be in the same drawing layer as the base object, no matter how that layer changes after the addition of the overlay. Otherwise, the overlay object's own drawing layer is used.


loc var (atom)

See also:
contents list var (atom)
x var (atom)
y var (atom)
z var (atom)
Default value:
The location of the object or null if there is none.

The container is always an atom (or null). For areas, this value is always null, since an area may not be contained by any other object.


luminosity var (atom)

Default value:
0
1 (areas)

This sets the object's luminosity (how far it casts light). It must be an integer in the range 0 to 6.

Areas are a little different. Any non-zero value in an area results in all objects within the area being bathed in light.


mouse_drag_pointer var (atom)

See also:
MouseDrag proc (atom)
MouseDrop proc (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_over_pointer var (atom)
mouse_pointer_icon var (client)
Default value:
MOUSE_INACTIVE_POINTER (0)

This defines how the mouse looks when dragging this object. Assigning this to MOUSE_ACTIVE_POINTER (1) enables the default dragging indicator.

This variable may also be assigned to any of the other built-in mouse pointers, or a custom icon or icon state. If an icon state is specified, this is applied against the object's main icon to find a custom pointer.

Note that all mouse pointers are purely visual indicators. They do not effect what objects may actually be manipulated with the mouse. You control all of the real behavior in the associated procedures.


mouse_drop_pointer var (atom)

See also:
MouseDrag proc (atom)
MouseDrop proc (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
mouse_pointer_icon var (client)
Default value:
MOUSE_ACTIVE_POINTER (1)

This defines how the mouse looks when dragging this object over another object that has mouse_drop_zone set. The default value enables the addition of a standard "droppable" indicator to whatever mouse_drag_pointer is (unless mouse_drag_pointer is turned off).

This variable may also be assigned to any of the other built-in mouse pointers, or a custom icon or icon state. If an icon state is specified, this is applied against the object's main icon to find a custom pointer.

Note that all mouse pointers are purely visual indicators. They do not effect what objects may actually be manipulated with the mouse. You control all of the real behavior in the associated procedures.


mouse_drop_zone var (atom)

See also:
MouseDrag proc (atom)
MouseDrop proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
mouse_pointer_icon var (client)
Default value:
0

Setting this to 1 indicates that this object is a valid site on which to drop other objects. While dragging, mouse_drop_cursor of the object being dragged will become active in this case. Note that this is a purely visual effect. It does not control what the user may do with the mouse. You control the real behavior with the associated procedures.


mouse_opacity var (atom)

See also:
mouse control
Default value:
1
Possible values:
0 //transparent to mouse
1 //opaque where icon is also opaque
2 //completely opaque

This may be used to control how mouse operations on an object are interpreted. A click or mouse movement over an object's icon normally applies to that object only if it is the top-most object that is not transparent at the position of the mouse. Setting mouse_opacity to 0 would cause the object to be ignored completely, and setting it to 2 causes it to always be chosen over any lower-level objects, regardless of the transparency of its icon.


mouse_over_pointer var (atom)

See also:
Click proc (atom)
MouseEntered proc (atom)
MouseExited proc (atom)
mouse_drag_pointer var (atom)
mouse_drop_pointer var (atom)
mouse_drop_zone var (atom)
mouse_opacity var (atom)
mouse_pointer_icon var (client)
Default value:
MOUSE_INACTIVE_POINTER (0)

This defines how the mouse looks when no buttons are pressed and it is held over this object. Assigning this to MOUSE_ACTIVE_POINTER (1) enables the default indicator that there is something special under the mouse (crosshairs).

This variable may also be assigned to any of the other built-in mouse pointers, or a custom icon or icon state. If an icon state is specified, this is applied against the object's main icon to find a custom pointer.

Note that all mouse pointers are purely visual indicators. They do not effect what objects may actually be manipulated with the mouse. You control all of the real behavior in the associated procedures.


name var (atom)

See also:
gender var (atom)
Default value:
The name of the object type with underscores converted to spaces.

opacity var (atom)

Default value:
0

This turns the object's opacity on or off (1 or 0). Opaque objects block light.


overlays var (atom)

See also:
icon var (atom)
layer var (atom)
list
underlays var (atom)
Default value:
empty list

This is a list of icons which are displayed on top of the object's main icon.

The individual items in the list may not be directly accessed, since they are stored in a special internal format. However, the list operators +=, -=, and the procedures Add, Remove, and Cut work normally.

Example:

turf/verb/AddOverlay(I as icon) overlays += I turf/verb/RemoveOverlay(I as icon) overlays -= I

The data types that may be used as overlays are icons, icon states (text strings), objects, and object types. When an icon state is used, the corresponding image in the object's icon is displayed. When another object is used as an overlay, a static "snapshot" of the object is taken at the time when the overlay is created. Future changes to the object will not change the appearance of the overlay.

Overlays have their own independent drawing layer. It is normally the special value FLOAT_LAYER, which makes them float above the base object. If the overlay is a snapshot of another object, the drawing layer of that object is used. The important advantage of using FLOAT_LAYER is that if the layer of the base object changes, the overlays will move with it into the new layer.

Any negative number may be used in place of FLOAT_LAYER (which happens to be -1). They all cause the same "floating" behavior. However, the overlays are ordered amongst themselves according to their own relative layer values (-2 below -1 and so on). This may be useful if you have several classes of overlays that should always appear in a certain order, because you would not have to worry about the order in which you add them to the list.

Example:

var/const ARMOR_LAYER = FLOAT_LAYER-1 CLOTHES_LAYER = FLOAT_LAYER-2 obj/overlay armor icon = 'armor.dmi' layer = ARMOR_LAYER clothes icon = 'clothes.dmi' layer = CLOTHES_LAYER mob/verb wear_clothes() overlays += /obj/overlay/clothes wear_armor() overlays += /obj/overlay/armor remove_clothes() overlays -= /obj/overlay/clothes remove_armor() overlays -= /obj/overlay/armor

That example used object types, but you can use instances of objects as well. Rather than using different "float" layers, you can also just make your own list of overlays with the order you want and assign that to the actual overlays list.

Example:

mob/var boots clothes armor mob/proc ShowOverlays() var/L[0] if(boots) L += boots if(clothes) L += clothes if(armor) L += armor overlays = L

pixel_x var (atom)

See also:
animate_movement var (movable atoms)
pixel_step_size var (movable atoms)
pixel_y var (atom)
Default value:
0

This displaces the object's icon on the x-axis by the specified number of pixels, which can range from -32 to +32. (You can get away with larger displacements, but they are not guaranteed to work for objects off the edge of the map.)

Since overlays and images can each have their own additional displacements, this makes it possible to create visual effects that extend beyond the object's own cell in the turf grid, but which automatically move around with the object.

This effect is purely visual and does not influence such things as movement bumping or view() range calculations.


pixel_y var (atom)

See also:
animate_movement var (movable atoms)
pixel_step_size var (movable atoms)
pixel_x var (atom)
Default value:
0

This displaces the object's icon on the y-axis by the specified number of pixels, which can range from -32 to +32. (You can get away with larger displacements, but they are not guaranteed to work for objects off the edge of the map.)

Since overlays and images can each have their own additional displacements, this makes it possible to create visual effects that extend beyond the object's own cell in the turf grid, but which automatically move around with the object.

This effect is purely visual and does not influence such things as movement bumping or view() range calculations.


suffix var (atom)

Default value:
null

This is an optional text string that follows the object's name in the stat panels. For example, items in an inventory list are displayed as an icon, a name, and a suffix.


text var (atom)

Default value:
The first letter of the object's name.

This is the character used to represent the object on text clients.

Entering several characters produces a text movie (the state of the art!). In that case, each character is displayed for a 10th of a second.

HTML tags in the text can be used to modify the colors of the text characters. As a convenience, the <font> tag may include a bgcolor attribute, so you don't have to do a CSS style setting to accomplish the same thing.

Example:

world maxx = 10 maxy = 10 area text = "<font bgcolor=blue> " turf text = "<font color=#F00>....<font color=#C00>.."

The example above produces a map with a blue background (from the area) and turfs (depicted by ".") that flash from bright red to a shorter span of light red.

Note that in order to see text icons, the user must switch to the text map in Dream Seeker. If your DM code never does anything with the icon variable, then this is the default configuration. Such applications are known as advanced iconic text games:)


underlays var (atom)

See also:
icon var (atom)
list
overlays var (atom)
Default value:
empty list

This is a list of icons which are displayed underneath the object's main icon.

The individual items in the list may not be directly accessed, since they are stored in a special internal format. However, the list operators +=, -=, and the procedures Add, Remove, and Cut work normally.

Example:

turf/verb/AddUnderlay(I as icon) underlays += I turf/verb/RemoveUnderlay(I as icon) underlays -= I

The data types that may be used as underlays are icons, icon states (text strings), objects, and object types. When an icon state is used, the corresponding image in the object's icon is displayed. When another object is used as an underlay, a static "snapshot" of that object is taken at the time when the underlay is created. Future changes to the object will not change the appearance of the underlay.

Underlays have their own independent drawing layer. It is normally the special value FLOAT_LAYER, which makes them float directly below the base object. If the underlay is a snapshot of another object, the drawing layer of that object is used.

See the discussion of FLOAT_LAYER for overlays, because the same applies here.


verbs list var (atom)

See also:
list
typesof proc
Default value:
The list of verbs defined for the object's prototype.

This is a list of the object's verbs. Initially, it contains all of the verbs defined in the prototype. It may be used to add and remove verbs at runtime.

Note that this variable is not automatically saved when the object is written to a savefile. That behavior may change in the future. In the mean time, you must save any necessary changes yourself or they will not be preserved when the object is loaded.

Example:

mob/proc/kazaam() usr << "Kazaam!" mob/verb/add_kazaam() verbs += /mob/proc/kazaam mob/verb/remove_kazaam() verbs -= /mob/proc/kazaam

x var (atom)

See also:
loc var (atom)
Default value:
The x coordinate of the object on the map.

You may assign the coordinates of movable objects (mobs and objs), but this is not advisable. It is better to compute the new location (with locate()) and move them to that. Then you can use the normal Move() procedure, which enables all the normal movement behavior.

For areas that are on the map, this is the coordinate of the turf with the lowest z, y, and x coordinate (in that order) that is contained by the area.


y var (atom)

See also:
loc var (atom)
Default value:
The y coordinate of the object on the map.

You may assign the coordinates of movable objects (mobs and objs), but this is not advisable. It is better to compute the new location (with locate()) and move them to that. Then you can use the normal Move() procedure, which enables all the normal movement behavior.

For areas that are on the map, this is the coordinate of the turf with the lowest z, y, and x coordinate (in that order) that is contained by the area.


z var (atom)

See also:
layer var (atom)
loc var (atom)
Default value:
The z coordinate of the object on the map.

The z coordinate is how objects move between maps. When you include several maps in a project, they are placed on different z levels so that the full map is a single 3-dimensional space. It is also possible for a single map file to contain multiple z levels.

Do not confuse this with drawing layer. The z coordinate moves an object between different maps. The layer variable determines the order in which an object is drawn graphically relative to other objects at the same position on the map.

You may assign the coordinates of movable objects (mobs and objs), but this is not advisable. It is better to compute the new location (with locate()) and move them to that. Then you can use the normal Move() procedure, which enables all the normal movement behavior.

For areas that are on the map, this is the coordinate of the turf with the lowest z, y, and x coordinate (in that order) that is contained by the area.


client

See also:
client var (mob)
key var (mob)
procs (client)
vars (client)

Each connected player has a corresponding client object. It has variables and procedures which control aspects of player input/output. This object is also responsible for linking the player up to a mob.

The client can be reassigned from its original mob M to a new mob N by setting N.client = M.client. This process disconnects the player from M (calling M.Logout()) and connects the player to N (calling N.Login()). Setting the mob's key has the same effect.

Additional vars, procs, and verbs may be added to the client in order to give the player properties that are independent of the mob.


procs (client)

Built-in client procs:

client/proc
Center
CheckPassport
Click
Command
DblClick
Del
East
Export
Import
IsByondMember
MouseDown
MouseDrag
MouseDrop
MouseEntered
MouseExited
MouseUp
Move
New
North
Northeast
Northwest
SendPage
South
Southeast
Southwest
Stat
Topic
West

Center proc (client)

See also:
walk proc
Format:
Center()
When:
Called when the player presses the "center" key or cursor.
Default action:
Cancels any automated movement by calling walk(usr,0).

CheckPassport proc (client)

Format:
CheckPassport(passport_identifier)
Args:
passport_identifier: a text string assigned to you by BYOND Hub.

This built-in procedure checks to see if the user is subscribed to a particular BYOND Hub entry.

Example:

world hub = "My.Hub" //change this to your own hub entry mob/var full_access mob/Login() if(client.CheckPassport("0123456789abcdef")) full_access = 1 else src << "For full access, <a href=\ 'http://www.byond.com/hub/[world.hub]' >subscribe</a>!" return ..()

Note that in general the value of world.hub has nothing to do with the passport you happen to check. This example assumes the passport number belongs to world.hub just for the purpose of forwarding the user to the appropriate subscription page.


Click proc (client)

See also:
Click proc (atom)
DblClick proc (client)
MouseDown proc (client)
MouseDrag proc (client)
MouseDrop proc (client)
MouseEntered proc (client)
MouseExited proc (client)
MouseUp proc (client)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
Click(object,location,control,params)
When:
Called when the player clicks on the map or in the stat panels.
Args:
object: the object clicked
location: the client stat panel, location (turf) of object on map, grid cell, or other control-specific info
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control
Default action:
Call object.Click(location,control,params).

Example:

client Click(O) usr << "You clicked [O]" ..() // do default action

Note that due to network lag, it is possible when clicking on moving objects for the location of those objects to have changed by the time the Click() proc is executed. That is the reason for the location argument. It tells you where the click originally took place.


Command proc (client)

Format:
Command(command as command_text)
When:
Called when the player types in something that is not understood as a valid command, or if the player is connected via telnet.
Default action:
None.

If this proc is used, players will be able to connect to your world via telnet. All telnet users' commands are routed through this proc instead of being parsed into verbs. Players who join the world through Dream Seeker will have their commands parsed as verbs first, and those commands will end up here only if there is no applicable verb.

Note that text received by this proc is not interpreted beforehand, so quotes " and backslashses \ should come through unaltered.

This proc is primarily useful if you want to handle parsing yourself (like for a MUD), or if your world is a chat server and verbs are not used much.


DblClick proc (client)

See also:
Click proc (client)
DblClick proc (atom)
MouseDown proc (client)
MouseDrag proc (client)
MouseDrop proc (client)
MouseEntered proc (client)
MouseExited proc (client)
MouseUp proc (client)
mouse_opacity var (atom)
mouse_over_pointer var (atom)
show_popup_menus var (client)
Format:
DblClick(object,location,control,params)
When:
Called when the player double-clicks on the map or in the stat panels.
Args:
object: the object double-clicked
location: the client stat panel, location (turf) of object on map, grid cell, or other control-specific info
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control
Default action:
Call object.DblClick(location,control,params).

Example:

client DblClick(O) usr << "You double-clicked [O]" ..() // do default action

Note that due to network lag, it is possible when clicking on moving objects for the location of those objects to have changed by the time the DblClick() proc is executed. That is the reason for the location argument. It tells you where the click originally took place.


Del proc (client)

See also:
Logout proc (mob)
Format:
Del()
When:
Called when the player disconnects from the world.
Default action:
If the player is connected to a mob, call mob.Logout() to disconnect. If the player's connection to the world is still not dead, kill it.

Note that this does not automatically delete the player's mob. If you want to do that, you could do so in mob.Logout().


East proc (client)

See also:
Move proc (client)
Format:
East()
Returns:
1 on success; 0 on failure.
When:
Called when the player presses the "right" key or cursor.
Default action:
Calls src.Move() towards the east.

Export proc (client)

See also:
Import proc (client)
New proc (client)
hub var (world)
savefile
Format:
client.Export(url,file)
client.Export(file)
Args:
url: a Dream Seeker action url
file: optional file to attach

The default action, when no url is specified, is to store the given file on the user's computer in a special location unique to each registered world.hub setting. This is most useful for writing a client-side savefile, but any type of file may be stored. The purpose of this is to exchange information between different worlds running under the same hub path.

When a savefile is exported to the player's computer, it replaces any previous savefile stored by a game with the same world.hub value. This should not be used for anything requiring high security, because any other world could make use of the same hub path and access the savefile. It is also possible for the user to tinker with the file, since it resides on their computer.

To delete the client-side savefile completely, call client.Export() with no argument at all.

The url parameter may be used to make Dream Seeker do one of various other operations on the file. You normally do not call it directly but various procedures and libraries use it internally. The URL has the following format:

"Address##action=ActionName"

In most cases, Address is blank, because the destination of the file is simply the user's own computer. ActionName may be any one of the following:

ftp
offer to store the attached file on the user's computer (generated by ftp()
run
offer to run the attached file on the user's computer (generated by run)
browse_rsc
store the attached file for subsequent use by a browser page (generated by browse_rsc)
browse_file
display the attached file as a browser page (generated by browse)
hubfile
store the attached file at BYOND Hub (see hublib)

If no action is specified, the attached file is stored as a client-side savefile.

Example:

mob/verb/save() var/savefile/F = new() F << usr //write the player's mob usr.client.Export(F) client/New() var/client_file = Import() if(client_file) var/savefile/F = new(client_file) //open it as a savefile F >> usr //read the player's mob return ..()

Import proc (client)

See also:
Export proc (client)
New proc (client)
savefile
Format:
client.Import(Query)
Args:
Query: optional query parameters

When no query parameters are given, this returns the client-side file last exported with client.Export(). This comes as an entry in the resource cache, which can be opened as a savefile among other things. If there is no file, null is returned. For an example, see client.Export.

When there are query parameters, these may be used to import a file from some alternate source. Currently, that applies only to the user's hubfiles stored at BYOND Hub. The specific query syntax is not documented here, because those details are all taken care of by the hublib DM library. You can use it to create a savefile shared between one or more users, useful, for example, in turn-based games where the users can make moves whenever they happen to log in rather than all having to play at the same time.


IsByondMember proc (client)

Format:
IsByondMember()
Args:
None.

This built-in procedure checks to see if the user is a BYOND Member. Use it to give special in-game rewards to those who support BYOND.

Example:

mob/var special_features mob/Login() if(client.IsByondMember()) special_features = 1 else src << "For special features, <a href=\ 'http://members.byond.com/' >become a BYOND Member</a>!" return ..()

MouseDown proc (client)

See also:
Click proc (client)
DblClick proc (client)
MouseDown proc (atom)
MouseDrag proc (client)
MouseDrop proc (client)
MouseEntered proc (client)
MouseExited proc (client)
MouseUp proc (client)
mouse_opacity var (atom)
mouse_pointer_icon var (client)
show_popup_menus var (client)
Format:
MouseDown(object,location,control,params)
Args:
object: the object under the mouse pointer
location: the turf, stat panel, grid cell, etc. containing the object where it was clicked
control: the name of the skin control involved
params: other parameters including mouse/keyboard flags, icon offsets, etc.; see mouse control
Default action:
Call object.MouseDown(location,control,params).

This is called when the a mouse button is pressed while pointing to the object. Note that MouseUp() will always be called after MouseDown() is called, even if over empty space. That means object and location may be null.

Don't define this unless you need it, because it generates extra communication that is otherwise avoided. Most operations can be done through Click(), DblClick(), and MouseDrop(). The other procedures are simply available for completeness.

Note: In BYOND 3.5 this procedure took four different arguments: object, location, icon_x, and icon_y. Since icon_x and icon_y have been replaced, old code will need to be modified. Games compiled before this change will still work normally.


MouseDrag proc (client)

See also:
Click proc (client)
DblClick proc (client)
MouseDown proc (client)
MouseDrag proc (atom)
MouseDrop proc (client)