Skip to content

RTS Conditions

Lobo edited this page Jul 5, 2024 · 5 revisions

Radius trigger scripts can be affected by different conditions, such as whether all existing monsters of a certain type are dead. Every condition must be satisfied before the script can run. The script will be stopped again if any one of the conditions becomes false.

Commands

COMMAND ARGUMENTS DESCRIPTION DETAILS
ON_DEATH <ThingID> [count] This will cause a trigger to not activate until all things of <ThingID> are killed or removed from the map. <ThingID> can be the name or number from THINGS.DDF, like IMP or 3001.

The optional [count] is a numerical value which causes a counter based on how many <ThingID> are left to kill. If used, the values should be greatest to lowest as you read down your script.

ON_HEIGHT <lowZ> <highZ> [sector] Use this to activate a radius trigger when a sectors floor or ceiling is within the specified height.
ON_CONDITION <condition> Use this to activate a radius trigger only when a specified condition has been met. It works in a similar manner to ON_DEATH and ON_HEIGHT. <Condition> is either something that the player is holding:
  • HEALTH(num)
  • ARMOUR(num)
  • BULLETS(num) -- and other ammo types
  • GREEN_ARMOUR(num) -- and other armour types
  • KEY_BLUECARD -- and the other keys
  • CHAINGUN -- and other weapons
  • POWERUP_PARTINVIS(num) -- and other powerups
  • INVENTORY01(num) -- and other inventory items
or it is something the player is doing:
  • WALKING
  • SWIMMING
  • JUMPING
  • CROUCHING
  • ATTACKING
  • RAMPAGING
  • USING

For health, ammo, armor, inventory and powerup conditions, the value (in brackets) is optional. When present it is the minimum needed to activate the trigger. For example: HEALTH(50) requires health 50 or higher to run. Without a value, the trigger activates with "any value above zero".

Any condition can be prefixed with "NOT_", which negates the condition, e.g. NOT_KEY_REDSKULL means that the trigger will only run when the player doesn't have the red skull key. This also works with values, for example: NOT_HEALTH(50) requires health below 50 to run.

Any condition can be prefixed with "EXACT_", which means you must have exactly this value for the script to run: for example: EXACT_HEALTH(50) requires health to be exactly 50 to run.

Multiple ON_CONDITION lines can be used in each trigger script, and they all have to be satisfied before the trigger will run.

TAGGED_USE This make a radius trigger script run only while the player is within the radius and is pressing the USE key.

NOTE: you may need to add the TAGGED_INDEPENDENT property to your script, especially if it has any WAIT commands, otherwise the script stops running as soon as the player lets go of the USE key.

Examples

The next script will show a message when there is only one Imp left alive and also when all the Imps are killed.

START_MAP MAP01
    RADIUS_TRIGGER 0 0 -1
        ON_DEATH IMP 1 // runs when only 1 Imp is left alive
        TIP "Only 1 Imp left!"
    END_RADIUS_TRIGGER

    RADIUS_TRIGGER 0 0 -1
        // since we don't specify a count, ALL imps must be killed
        ON_DEATH IMP
        TIP "All Imps killed!"
    END_RADIUS_TRIGGER
END_MAP

This radius trigger script checks to see if the player has too much armour for a certain map.

RADIUS_TRIGGER 0 0 -1
    // only runs if player has 200% blue armour
    ON_CONDITION BLUE_ARMOUR(200)
    TIP "I think you used IDKFA!"
    WAIT 3
    TIP "Goodbye cheater!"
    DAMAGE_PLAYER 1000
END_RADIUS_TRIGGER

This radius trigger script will fire off once if we are inside it and press the USE button.

// message when we look at something
RECT_TRIGGER 652 1440 780 1456
    TAGGED_USE
    TIP "Nothing of interest."
END_RADIUS_TRIGGER




_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