Difference between revisions of "Radius Trigger Script"

From 3DGE Wiki
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
RTS ("'''Radius Trigger Script'''") is the scripting language invented by [[DOSDoom]] and greatly expanded upon in [[3DGE]]. It was one of the first such scripting languages to be implemented in any source port.
+
RTS ("'''Radius Trigger Script'''") is the scripting language invented by [[DOSDoom]] and greatly expanded upon in [[3DGE]]. It was the first such scripting language to be implemented in any source port.
  
 
=Introduction=
 
=Introduction=
Line 7: Line 7:
  
 
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 3DGE cannot read them.
 
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 3DGE cannot read them.
 +
 +
The RTS specs were originally written by [[John Cole]] for [[DosDoom]] v[[0.64]].
  
 
=Getting Started=
 
=Getting Started=
'''Please check out RTS Online to the left sidebar!'''
+
This guide is still being migrated over from the old EDGE SourceForge RTS Documentation website. [http://edge.sourceforge.net/rts_online/start.htm Please visit the old site until this guide is completed].
  
 
==Some general points about RTS scripting:==
 
==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.
 
* [[#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
 
* [[#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]].
 
* 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]].
 
* 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.
 
* '''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.
  
Line 25: Line 31:
 
//and this is another one
 
//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.  
+
<div style="background: #f2e0ce; border: 2px solid #bfb1a3; padding: 0.6em; margin-top: 0.8em;">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.'''
+
'''There must not be any spaces after the \ character, otherwise it doesn't work.'''</div>
  
 
==General Tips==
 
==General Tips==

Latest revision as of 10:39, 20 April 2018

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

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 3DGE cannot read them.

The RTS specs were originally written by John Cole for DosDoom v0.64.

Getting Started

This guide is still being migrated over from the old EDGE SourceForge RTS Documentation website. Please visit the old site until this guide is completed.

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
  • 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



Radius Trigger Scripts
RTSlogo.gif