logic_random_outputs
Jump to navigation
Jump to search
Code classes:
CLogicRandomOutputs
CLogicalEntity
CServerOnlyEntity
CBaseEntity
(all ents)
logic_random_outputs
is a point entity present in all games since Alien Swarm. It randomly fires outputs when told to. The entity will prevent itself from firing while any delayed inputs are waiting to go through, meaning it has an optional cooldown on how often it can fire.
Flags[edit | edit source]
- 1: Only trigger once - Entity removes itself after firing any output.
- 2: Allow fast retrigger - If the entity has any delayed inputs, this flag will allow it to refire even if those inputs have not fully sent.
Keyvalues[edit | edit source]
- OnTrigger1 Chance
(OnTriggerChance1)
to OnTrigger8 Chance(OnTriggerChance8)
<float>
- How likely a given output is to fire as a decimal percent (0.45 = 45% of the time). NOT a ratio; all chance values are independent of each other.
- Start Disabled
(StartDisabled)
<boolean>
- Stay inactive until Enabled.
Inputs[edit | edit source]
- Trigger
- Randomly does or doesn't fire the OnTrigger outputs based on their Chance keyvalues.
- CancelPending
- Cancels any delayed inputs from this entity which haven't gone through.
- EnableRefire (Not in FGD)
- Tells the entity it can refire even if it has delayed inputs waiting to fire. Delayed inputs will not be cancelled. The entity automatically sends this to itself once all its delayed inputs have gone through.
- Enable
- Makes the entity active.
- Disable
- Makes the entity inactive.
- Toggle
- If on, turn off. If off, turn on.
Outputs[edit | edit source]
- OnSpawn
- Fires when the entity spawns into the map.
- OnTrigger1 to OnTrigger8
- May fire when the Trigger input is sent.