Skip to content

RTS Flow Control

Lobo edited this page Jul 5, 2024 · 2 revisions

These commands control the flow of RTS scripts. They let you jump around the script, make the script temporarily go to sleep, and cause other scripts to be enabled or disabled.

Commands

COMMAND ARGUMENTS DESCRIPTION DETAILS
JUMP <Label> [Chance] This command is used to define a point in your script, JUMP, where you want to have a chance of going to another point, LABEL. <Label> is the point in your script you want to jump to.

[Chance] is a percentage value which represents the likelyhood of the jump taking place. A value of 0% would mean that it would never jump to the Label, and 100% would mean it would always jump. If no [Jump Chance] is specified then it will always Jump.

See also LABEL below.

LABEL <Name> This creates a point inside a script you can JUMP to/from another part of your script. It's similar to the NAME property, but refers to part of a script, not a whole script. <Name> is the name we want to give to this point in the script. The LABEL command is used with the JUMP and JUMP_ON commands.
DISABLE_SCRIPT <Name> Use this in a script to disable another script. <Name> is the NAME of the other script which we wish to disable.

NOTE: if the other script(s) are already disabled, then nothing will happen.
DISABLE_TAGGED <Tag Number> Use this in a script to disable another script. <Tag Number> is the TAG of the other script(s), when using DISABLE_TAGGED. This method allows multiple scripts to be disabled (every one with a matching tag number).

NOTE: if the other script(s) are already disabled, then nothing will happen.
ENABLE_SCRIPT <Name> Use this in a script to enable another script. <Name> is the NAME of the other script which we wish to enable.

NOTE: if the other script(s) are already enabled, then nothing will happen.
ENABLE_TAGGED <Tag Number> Use this in a script to enable another script. <Tag Number> is the TAG of the other script(s), when using ENABLE_TAGGED. This method allows multiple scripts to be enabled (every one with a matching tag number).

NOTE: if the other script(s) are already enabled, then nothing will happen.
SLEEP This command causes the trigger to be disabled. The script will not run again until another script enables it (with the ENABLE_SCRIPT or ENABLE_TAGGED commands). You can also enable scripts with certain line-types on the map, and with the RTS_ENABLE_TAGGED action in a custom DDF thing or weapon.
WAIT <time> Use this where you want to create a pause in your script. Since the script is read like a book, from top down, place it exactly where you want it to wait. <time> a time value indicating how long to wait (in either ticks or seconds).
  • 0 = no delay
  • 0.5 = half a second
  • 2 = two seconds
  • 1T = one tick (shortest possible time)
  • 35T = one second

For example, if you have a script that gives a tip that says "something wicked this way comes.", and you want to make it pause for 4 seconds before going to the next line to spawn a Cyberdemon, add WAIT 4 after the TIP, but before the SPAWN_THING commands.

RETRIGGER Causes the conditions that activated the radius trigger script to be re-checked (possibly pausing the trigger again). Must be used in conjunction with TAGGED_INDEPENDENT. Most useful used at the bottom of a TAGGED_REPEATABLE sleep-less script (for example a repeatable trigger script which uses SHOW_MENU).

Examples

The next example shows how to enable, disable and sleep scripts

START_MAP map01
    RADIUS_TRIGGER 0 0 -1
        NAME Jeff
        SLEEP
        TIP "First script: one" 1
        SLEEP
        TIP "First script: two" 1
        SLEEP
        TIP "First script: three" 1
    END_RADIUS_TRIGGER

    // this second script will wake up the first one
    RADIUS_TRIGGER 0 0 -1
        TIP_SLOT 10 // red text
        TIP "Second script begun..." 2
        WAIT 3
        ENABLE_SCRIPT Jeff
        WAIT 3
        ENABLE_SCRIPT Jeff
        WAIT 3
        ENABLE_SCRIPT Jeff
    END_MAP

WAIT is especially useful for when you have various TIPS, one after the other. Without WAIT, the TIPs would be shown simultaneously and "run over" each other, so you would only see the final TIP.

START_MAP MAP01
    RADIUS_TRIGGER 0 0 -1   // script applies to whole map
        TAGGED_IMMEDIATE
        TIP "Here for 3 seconds" 3 TRUE
        WAIT 3 // wait time is same as TIP's display time
        TIP "Here for 2 seconds" 2 TRUE
        WAIT 2 // wait time is same as TIP's display time
        TIP "Last tip" 5 TRUE
    END_RADIUS_TRIGGER
END_MAP




_RTS docs written by many contributors. _

Home

EDGE-Classic Mod Downloads

COAL

DDF     Introduction
    Animations
    Attacks
    Colormaps
    Flats
    Fonts
    Games
    Images
    Languages
    Levels
    Lines and Sectors
    Playlist
    Sounds
    Styles
    Switches
    Things
    Weapons
RTS     Introduction
    Conditions
    Directives
    Flow Control
    Level Commands
    Maps and Triggers
    Properties
    Thing Commands
    Tips and Menus
Tutorials     Creating a Weapon
    Creating an Enemy
    Creating a Friendly Creature

Compiling EDGE-Classic

Clone this wiki locally