12-Jul-2023
Entity that triggers randomly picked target from targets pool (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). Trigger use-type for all targets is 'Toggle'.
Keyvalues |
OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.
Name targetname : Set name of trigger_random so other entities can trigger it to pick random target (or toggle constant picking with "Timed" flag enabled). Every trigger use-type works uniformly. Can be kill-targeted.
Target Count target_count : Amount of random targets you have specified below. E.g. if you used "Target 1'" "Target 2" and "Target 3" then set it to 3.
Target 1 target1 : Target no. 1 that can be triggered when picking random target.
Target 2 target2 : Target no. 2 that can be triggered when picking random target.
Target 3 target3 : Target no. 3 that can be triggered when picking random target.
Target 4 target4 : Target no. 4 that can be triggered when picking random target.
Target 5 target5 : Target no. 5 that can be triggered when picking random target.
Target 6 target6 : Target no. 6 that can be triggered when picking random target.
Target 7 target7 : Target no. 7 that can be triggered when picking random target.
Target 8 target8 : Target no. 8 that can be triggered when picking random target.
Target 9 target9 : Target no. 9 that can be triggered when picking random target.
Target 10 target10 : Target no. 10 that can be triggered when picking random target.
Target 11 target11 : Target no. 11 that can be triggered when picking random target.
Target 12 target12 : Target no. 12 that can be triggered when picking random target.
Target 13 target13 : Target no. 13 that can be triggered when picking random target.
Target 14 target14 : Target no. 14 that can be triggered when picking random target.
Target 15 target15 : Target no. 15 that can be triggered when picking random target.
Target 16 target16 : Target no. 16 that can be triggered when picking random target.
Minimum Delay (0 = off) min_delay : Requires "Timed" flag. Minimum delay, in seconds, till a random target will be fired. Set it to 0 to disable minimum value.
Maximum Delay (0 = off) max_delay : Requires "Timed" flag. Maximum delay, in seconds, till a random target will be fired. Set it to 0 to disable maximum value.
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 delay" and "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.