trigger_random

From Sven Co-op
Jump to navigation Jump to search
trigger_random
Type

point

Status

supported

 


Trigger which will pick one of its targets randomly and fire it when triggered (may use random time delay). Can be set to trigger only target that haven't been triggered before by this trigger_random (when multiple triggering).

1 Keyvalues

Target Count : target_count

Amount of random targets you have specified. E.g., specify 'Target 1' and 'Target 2' and set this to '2'. The other three target fields will be ignored!

Target # : target#

Specify up to 16 targets of which one will be picked randomly whenever the trigger_random entity is triggered.

Minimum delay : min_delay

Minimum delay, in seconds, till a random target will be fired. Set it to 0 to disable minimum value.

Maximum delay : max_delay

Maximum delay, in seconds, till a random target will be fired. Set it to 0 to disable maximum value.

2 Flags

1 : Start On (Timed only)

Makes trigger_random (with 'Timed' flag) enabled at map start, so it will start it's timer and trigger random target on game start. If 'Trigger Once' flag isn't selected, it will continue until deactivated by trigger.

2 : Trigger Once (Timed only)

When using random delays ('Timed' flag), this tells to trigger a random target once, instead of continuously triggering random targets until deactivation (in that case, disable timer by triggering this entity again).

4 : Reusable (Unique only)

If set, the trigger_random with 'Unique' flag can be used again after having fired its targets, handling all of them as if not triggered before again.

8 : Timed

Enables 'Minimum/Maximum delay' keyvalues so you can specify to wait a random amount of time before triggering random targets. When 'Trigger Once' and 'Start On' flags are NOT selected, triggering this trigger_random starts the timer, and it will fire it's targets with random delays repeatedly until triggered again, what pauses it.

16 : Unique

Trigger will pick target (each time it's triggered), that haven't been triggered yet, randomly. So if four targets are specified, the combination in which they can be picked may be: 3th, 1th, 2th, 4th. It never repeats the same target unless 'Reusable' flag is selected- the list will be "shuffled", and targets can be picked all over again.

3 Changes

5.02 Update: Updated entity so it now have functionality of trigger_random_unique and trigger_random_time. Added 'Minimum delay' and 'Maximum delay' keyvalue, 'Start On', 'Trigger Once', 'Reusable', 'Timed' and 'Unique flags, updated 'Target #' keyvalue so it can now have up to 16 targets specified.