-
Notifications
You must be signed in to change notification settings - Fork 13
RTS Conditions
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.
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:
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:
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:
Any condition can be prefixed with "EXACT_", which means you must have exactly this value for the script to run: for example: 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. |
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. _