Radius Trigger Script

From 3DGE Wiki
Revision as of 02:18, 10 October 2014 by Corbin (talk | contribs)

Jump to: navigation, search
Doomwiki
For more information on this article, visit the Radius Trigger Script page on the Doom Wiki.

RTS ("Radius Trigger Script") is the scripting language invented by DOSDoom and greatly expanded upon in 3DGE. It was one of the first such languages to be implemented.

Introduction

RTS is not intended to replace DDF, but accents and enhances DDF. Using both DDF and RTS together, you can create amazing events that even Quake 2 is not capable of.

With RTS, you can create scripted events that cannot be controlled by linedef triggers alone, such as a simple on-screen tip message, multiple linetypes being triggered by one switch, or a complex event where an entire structure is destroyed, monsters are spawned, sounds are played, and light levels are changed dramatically.

Somewhat more technically defined, a script is something a person writes in a text editor of some sort, that contains individual scripts (kind of like subroutines), commands, variable declarations, and so on. You cannot use word processor files (like "DOC" files), because these are not text files and EDGE cannot read them.

Some general points about RTS scripting:

  • #CLEAR_ALL (if used) must be at the top of your script, or else everything before it will be cleared.
  • #VERSION and #DEFINE values (if used) must be after #CLEARALL, but before the rest of your script
  • You must place all your radius triggers between START_MAP and END_MAP.
  • All other commands can only exist between RADIUS_TRIGGER (or RECT_TRIGGER) and END_RADIUS_TRIGGER.
  • Commands are not case sensitive, hence "start_map", "Start_Map" and "START_MAP" are all acceptable. Whether you use lowercase or uppercase is just a matter of personal taste.

You can include comments (text which will be ignored by 3DGE) by simply placing a double slash "//" at the beginning of a line and then typing your text after it. For example:

//This is a comment //and this is another one

Commands in RTS scripts can be extended over two (or more) actual lines by placing the \ character at the end. There must not be any spaces after the \ character, otherwise it doesn't work.

General Tips

Check your spelling and values carefully, and add a few functions at a time, then test. Just like DDF development, adding a lot of entries without testing makes it much harder to find problems. If you add a little and test often, you have less scripting to rummage through to find errors.

Conventions

Most RTS commands take one or more parameters. Some parameters must be given, and the remaining parameters are optional (may be left out). Throughout this documentation the following bracket styles are used:

<Name> : a compulsory parameter [Name] : an optional parameter

Subpages

more coming soon!