start_map [mapid]Specifies the beginning of this map's trigger(s), everything after this will be allocated to that map. This is the start of a map block.
[mapid] = map name
end_mapSpecifies the end of this map's trigger(s).
radiustrigger [x] [y] [radius]Specifies the beginning of a radius trigger, it's position on the map, and it's radius. This is the start of a trigger block.
[x] - x position on the map
[y] - y position on the map
[radius] - any # greater than zero
radiustrigger [x] [y] [radius] [z low] [z high]You can use the 3D radius trigger to define something that is only triggered from a certain height. For example, if using a 3D bridge, you only want this trigger accessible from above the bridge and not below, you can make it spawn at [z low] height of the top of the bridge, and specify the [z high] height by adding 64. This way, you can walk below the bridge and not trigger anything.
[x] - x position on the map
[y] - y position on the map
[radius] - any # greater than zero
[z low] - bottom z height in the map
[z high] - top z height in the map
end_radiustriggerSpecifies the end of this radius trigger.
tagged_repeatable [# times] [delay]This causes a trigger to be repeatable, or to loop. If you do not use "tagged_repeatable", the trigger will only occur once.
[# times] - 0=infinite, or any # greater than zero
[delay] - 0=instant, or any # greater than zero
No delay: 0So if you have a trigger you want to repeat a total of 5 times at one second intervals:
1/16 Second: 2T
1/8 Second: 4T
1/4 Second: 0.25 or 9T
1/2 Second: 0.5 or 18T
3/4 Second: 0.75 or 26T
1 Second: 1 or 35T
2 Seconds: 2 or 70T
3 Seconds: 3 or 105T
.
.
5.5 Seconds: 5.5 or 193T
and so on....
tagged_repeatable 5 1
tagged_immediateForces the trigger to activate immediately. Useful if you want something to happen when the map starts, like an onscreen tip message, or spawning monsters right away.
tagged_independentOnce the trigger is activated it will continue running until all required functions have been completed.
tagged_useForces a trigger to only be activated by the player pressing the use key (spacebar) while standing within the radius of the trigger.
#define [identifier] [value]Allows you to define aliases, like in Quake and Quake 2 bindings and advanced config files (like zooms and rocket jumps).
[identifier] - CHAR[80]
[value] - thing number from THINGS.DDF
spawnthing [thingid] [angle]Spawns a thing on the radius triggers center point, and faces it according to the [angle]. Note that spawnthing_ambush can also be used in an identical fashion to spawn a deaf monster. It is also possible to use spawnthing_flash to spawn things using a respawn flash (for a grander entrance).
[thingid] - thing number from THINGS.DDF
[angle] - angle to face on the map
spawnthing [thingid] [x] [y] [angle]Spawns a thing at the specified [x][y] coordinates, and faces it according to the [angle]. Use the advanced one to spawn something remote of the actual trigger.
[thingid] - thing number from THINGS.DDF
[x] - x position on the map
[y] - y position on the map
[angle] - angle to face on the map
spawnthing [thingid] [x] [y] [angle] [z] [mlook]The [mlook] angle used for cameras: "0" is straight forward, "-45" is all the way down, and "45" is all the way up. Use numbers between 45 and -45 to set the angle you want, positive numbers are up, negative numbers are down.
[thingid] - thing number from THINGS.DDF
[x] - x position on the map
[y] - y position on the map
[angle] - angle to face on the map
[z] - z height on the map
[mlook] - mlook angle to spawn the thing at -used for cameras too!
East: 0
NorthEast: 45
North: 90
NorthWest: 135
West: 180 ; W
SouthWest: 225
South: 270
SouthEast: 315
healplayer [amount] [limit]When this trigger is active, it gives the player health at [amount], but no more than the [limit].
[amount] - any number greater than zero
[limit] - any number greater than zero and less than MAXHEALTH
healplayer 100 120If the player is at 100 health already, they won't receive another 120, but will cap at 120 max health. If you leave out [limit], the parser will default to MAXHEALTH (which is 200).
givearmor [value] [limit]When this trigger is active, it gives the player armor at [amount], but no more than the [limit].
[value] - any number greater than zero
[limit] - any number greater than zero and less than MAXARMOR
givearmor 100 120If the player is at 100 armor already, they won't receive another 120, but will cap at 120 max armor. If you leave out [limit], the parser will default to MAXARMOR (which is 200).
damageplayer [value]When this trigger is active, it damages all players that are inside the trigger radius (decreasing health and armour).
[value] - any number greater than zero
exitlevelWhen this trigger is activated, it causes the level to end.
gotomap [mapid]Causes the end of the map screen (a normal end of map trigger), and then calls the next map specified in [mapid]. Useful if you want different exits, like a secret level exit.
[mapid] = map name
ondeath [thingid] [threshold]This trigger will not activate until all things of [thingid] are killed/no longer exist on the map. This can be used for special events like a door opening when certain monsters are killed, or spawning a monster when a weapon is picked up.
[thingid] thing number or name from THINGS.DDF.
[threshold] any positive number (optional)
The threshold value means that the trigger will only be activated when
a certain number of the things exist. For example, 2 means that the
trigger doesn't activate until all but 2 of the monsters have been
killed. The threshold can be omitted, it defaults to 0 which means
all the things must be killed or removed from the map.
playsound [sound] {[x] [y]}Spawns a sound remotely at the optional [x][y] coordinates (if specified), otherwise, spawns the sound at the [x][y] of the radius trigger. Combine with "tagged_repeatable" for a looping sound.
[sound] - sound name from SOUNDS.DDF (DS is omitted!)
Optional:
[x] - x position on the map
[y] - y position on the map
tip "[text]" [displaytime] [sound]Displays text on the screen. Use "\n" for a line break, and "\n \n" for an empty line. You are limited to about 80 characters across and 8 lines total (I'm pretty sure). All text is currently centered, but there are plans for allowing alignment.
[text] - text to display
[displaytime] - any number greater than zero (optional. defaults to 3)
[sound] - (True/False) (optional, defaults to false)
skill [num] [respawnmonsters] [fastmonsters]Changes the skill level while in mid-game.
[num] - 1 through 5
[respawnmonsters] - true/false
[fastmonsters] - true/false
I'm too young to die - 1
Hey, not too rough - 2
Hurt me plenty - 3
Ultra-violence - 4
Nightmare - 5 (should set [respawnmonsters] and [fastmonsters] to "true" for this skill)
sectorv [sector num] [height] [type]Raises or lowers the referenced sectors floor or ceiling.
[sector num] - literal sector number in any map editor
[height] - how far the sector is to move
[type] - floor/ceiling
When this trigger is activated, sector #295's floor will move up by 1 unit, and since it's "tagged_repeatable", it keeps moving up one unit every second 64 times.radiustrigger 1480 3400 1000 // X=1480 // Y=3400 // RADIUS=1000 -yes it's big // START OF THIS RADIUS TRIGGER tagged_repeatable 64 1 // "64" IS 64 REPEATS (TOTAL OF 64 UNIT MOVEMENT UP -SEE "sectorv" SECTION!) // "1 1" IS 1/32nd SECOND DELAY BEFORE REPEATING sectorv 295 1 floor // "295" IS THE MAPS SECTOR # I WANT TO ACTIVATE // "1" IS THE DISTANCE TO MOVE IT *PER REPEAT* (POSITIVE = UP) // "floor" MEANS THE FLOOR IS THE PART THAT WILL MOVE end_radiustrigger // END OF THIS RADIUS TRIGGER
sectorl [sector num] [light change]Changes the light intensity in the specified sector.
[sector num] - literal sector number in any map editor
[light change] - light level to change to (255 max, -255 min)
when_appear [1:2:3:4:5:sp:coop:dm]For example:
[1:2:3:4:5:sp:coop:dm] - omit the ones you don't want this trigger to exist on
when_appear 1:2:sp -only active on skills 1 and 2 in single player onlyIf you want a trigger to be active in different skills, use two triggers, like if you want a trigger to only be active in skills 1 and 2 single player and skills 4 and 5 in coop, use one trigger for the single player and another for the coop settings, but make the triggers coordinates and other contents identical.
when_appear 4:5:sp:coop -only active on skills 4 and 5 in single player and coop only
when_appear 1:2:3:4:5:dm -active in death match only, all skill levels
when_appear 1:2:3:4:5:sp:dm:coop -active in all skills, all modes
name [name]Names a radius trigger, useful to label a trigger to be turned on or off by another trigger, or for paths. Each trigger in a level should have unique names (when used), but the same name can be re-used in different levels.
[name] - the name of the radius trigger
enable_script [name]First name a radius trigger, then use another with "enable_script" and put the name of the first script there. When the second trigger is activated, the first will activate as well.
[name] - the name of the radius trigger to enable
disable_script [name]First ame a radius trigger, then use another with "disable_script" and put the name of the first script there. When the second trigger is activated, the first will deactivate (i.e. immediately stop if it was running).
[name] - the name of the radius trigger to disable
tagged_disabledIf a trigger is "tagged_disabled", it won't be active intil it's activated. Use "enable_script" and "name" functions for this.
This makes a radius trigger disabled until triggered.
tagged_path [name]Specifies that this trigger is actually a node in a path.
[name] - the name of the radius trigger to target as a path
To make them non-looping, omit the last radius trigger's "tagged_path" entry, and the monster will stop there.start_map MAP01 radiustrigger -64 800 0 128 128 tagged_immediate name walk_01 tagged_path walk_02 spawnthing IMP -96 1000 0 0 end_radiustrigger radiustrigger 300 800 0 128 128 name walk_02 tagged_path walk_03 end_radiustrigger radiustrigger 300 200 0 128 128 name walk_03 tagged_path walk_01 end_radiustrigger end_map
This trigger will only activate when the floor of a sector is between two heights. If no sector number is included, the sector containing the trigger is used.
onheight [low Z] [high Z] [sector num]
Makes the trigger pause for the set amount of time before proceeding with the remaining actions in a particular radiustrigger. Can be used to slowly change floors / ceilings or lighting. The time value is either seconds (e.g. 5) or tics (e.g. 70T).
wait [time]
[monster name or "any"] use a monster name from THINGS.DDF, or "any" (meaning any monster within the active trigger's radius)
damage_monsters [monster name or ANY] [value]
[value] any number greater than zero
When this trigger is active, it damages a specific monster from
THINGS.DDF, or if "any" is used, it damages any monster within the
active trigger. The value controls the amount of damage dished out.
NOTE: it will only damage things that have COUNT_AS_KILL or MONSTER in
the things special. So you can't damage scenery.
[name] text string that can be referenced by the jump function
label [name]
This is used to label and then jump between parts of a RTS script
[label name] name of label to jump to
jump [label name] [chance to jump]
[chance to jump] optional percentage from 0% (never jump) to 100% (always jump). When omitted, it always jumps.
This specifies the chance that the script will jump to a specified label
This is like a pause, similar to a wait statement, but lasts until something else wakes it up again. Use it anywhere in your script.
sleep
[tag number] any positive number
tag [tag number]
Used to link RTS with a trigger in a map. You must create a special line type in LINES.DDF that uses RADIUS_TRIGGER= ENABLE_TAGGED/DISABLE_TAGGED; (you can either enable or disable with this line type setup).
You then use your map editor to assign the new line type in LINES.DDF
to a line in your map, and the tag number in the map will be the [tag
number] in your radius script. When the tagged line in your map is
triggered, it will activate the radius trigger it's targeting (or
deactivate it, when DISABLE_TAGGED is used).
[line type] the line type defined in lines.ddf
activate_linetype [line type] [tag]
[tag] the tag give to your line type in a map editor
Activates a particular line type as if the player had activated it
using walk, push or shoot.
Error Codes:
The parser will produce message like this when an error occurs in the script:
Radius Triggers v1.1........In version 1.0 and up, the parser will actually tell you what line it's having a problem with and the code it's choked on -super easy to find your mistake (much easier than DDF :).
Error: END_MAP with no START_MAP, at line 194.
END_MAP
-= or =-
Radius Triggers v1.1.
Error: Unknown Function, at line 33.
RADIUSTRIGGERED -672 -32 64
Unknown Error -will never happen, so don't worry about ever seeing this one.
START_MAP, block not terminated - parser was unable to find the "end_map" command to terminate the current map block.
END_MAP with no START_MAP - pretty obvious, the parser came across a "end_map" but there was no "start_map" previously defined.
RADIUS_TRIGGER, block not terminated - parser found "radiustrigger" or "end_map" instead of "end_radiustrigger".
END_RADIUSTRIGGER with no RADIUS_TRIGGER - parser came across an "end_radiustrigger" but there was no "radiustrigger" to mark the beginning of the trigger block.
Unknown Function - cannot locate the function name.
Parameter is not of integer type - the input is not an integer.
Wrong number of parameters - either too little or too many parameters were passed through to the function.
Invalid number of quotes - either no starting or closing quotes (or neither).
Variable Unknown - has tried to look up a #define declared in one the functions in the defines namespace but was unsuccessful. Will only occur when redefining boolean types.
Function cannot be redefined - an attempt has been made to reuse a function which is allowed only once in a trigger block.
Integer not within range specified - a number was passed to a function which was out of the parameters given range.