FANDOM


ConstructionTemp
And a wall here...
This article is a work in progress, and is missing crucial information. Please edit the page if you can contribute any form of information!


Scripting in Classic DROD and DROD RPG is a means by which an architect can cause events to happen in DROD which will not occur by any other means.

IDs Edit

TodoTemp
Something is wrong, Gunthro.
There are known problems with this page. If you are able to fix this, please edit the page and help us out by doing so.

Reason: Change links so that they go to the Game Element and Monsters pages after they have been updated with all the elements.

To see the list of IDs for various game elements, click on the links below.

Monster ID

Element ID

Predefined variables Edit

TodoTemp
Something is wrong, Gunthro.
There are known problems with this page. If you are able to fix this, please edit the page and help us out by doing so.

Reason: Add remaining variables.

There are a number of predefined script variables that begin with an underscore. You can use these in conjunction with various scripting commands to change their behavior or examine or set certain game states.

Varaible name

Description

_LevelName

Contains the name of the level in which the script is run.

_PlayerLightType

Affects the way player's light looks in dark rooms.

Set it to value less than 0 to turn off the light, 0 to turn it on, 1-100 to use a flashlight beam. A higher value creates a more focused beam.

_PlayerLight

Set it to a value between 0 (default) and 128 to change the player's light intensity and color, as follows:

16 * (INTENSITY - 1) + LIGHT_COLOR

Where INTENSITY can be between 1 and 8 and LIGHT_COLOR can be between 1 and 16.

_ThreatClock

Affects the threat clock display.

The supported values are:

0: default

1: hide

2: always show

3: backwards time

100-129: display specific time (0-29)

200-229: display specific half-tick (0-29)

_X


_Y


_O

These variables contain player's position (_X, _Y) and orientation (_O). They can be both read and modified.

_MyX


_MyY


_MyO


_MyWeapon

These variables contain position, orientation and current weapon of the NPC that is running the script. They can be both read and modified.

_MyScriptX

_MyScriptY

_MyScriptW

_MyScriptH

_MyScriptF

These 5 variables can affect scripting commands in various ways if they're not set to their default value, which is -9999.

Usually they affect the commands in the following way:

  • If the command allows to specify a coordinate, instead of the specified coordinate it will use the coordinate at the value of _MyScriptX and _MyScriptY.
  • If the command affects a region of the room, instead of the specified region it will use the one set by values of _MyScript variables, where _MyScriptX and _MyScriptY specify the top-left coordinate of the region, _MyScriptW and _MyScriptH specify the region's width and height.

Commands Edit

TodoTemp
Something is wrong, Gunthro.
There are known problems with this page. If you are able to fix this, please edit the page and help us out by doing so.

Reason: Add more commands. Categorize commands.
Name Description

Activate Item at

Activates an item at the specified coordinate.

Can be used with _MyScript variables.

Appear

Causes the character to appear at their current position.

Appear at

Causes the character to appear at a specified position. This can also act as an instant 'Move to' command for visible characters.

Can be used with _MyScript variables.

Build

Instantly build the selected element(s) at the specified region.

Can be used with _MyScript variables. ID of the item to be built can be set with _MyScriptF.

Cut scene

Causes the start of a Cutscene. This means that any commands will be executed by all NPCs and monsters in the room (with the exception of all doubles) in a smooth motion. The value entered is the number of milliseconds that it takes per turn, therefore the higher the number, the slower the movement of the NPCs. The cutscene can be ended by setting the Cutscene value to 0 ms.

Disappear

Causes the character to disappear, thus they exhibit 'Invisibility'.

End

Instantly end the script. No commands after this one will be executed. The script will not be run again upon re-entering the room.

End on room exit

Ends the script after player exits the room. Other commands after this one will still run. The script will not be run again upon re-entering the room.

Face direction

Causes the character to face any of the 8 directions in DROD, or to turn anti-clockwise or clockwise. One 'Face Direction' command takes 1 turn.

Set shallow water traversal

Changes the way player interacts with the shallow water:

Command

Description

As player role

Reverts the player's traversal to the player role's default. See Player Role for a comprehensive list.

Cannot enter

Prevents the player from traversing shallow water.

Wades in water

The player will treat shallow water as if it was land.

Hides in water

The player will sheath his sword and become invisible while submerged.

Wait

Waits the specified amount of turns.

Can be used with _MyScript variables. _MyScriptX specifies the amount of turns to wait.

Destroy trapdoor

Select a coordinate to destroy the trapdoor there. If there is no trapdoor at that coordinate, nothing occurs.

Can be used with _MyScript variables.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.