trigger_portal_button

From Valve Developer Community
Jump to: navigation, search

Portal 2 trigger_portal_button is a point entity available in Portal 2. It is the actual trigger used by a prop_floor_button, prop_floor_cube_button, or prop_floor_ball_button to detect objects. When placed in a map directly, it behaves like a trigger_multiple, except it is hardcoded to ignore physics objects other than prop_weighted_cubes.

Tip.png Tip: The auto-generated triggers use their oriented bounding box as the detection area, so the SetSize() VScript function can be used to resize the trigger.

Keyvalues

Delay Before Reset <float>
Delay in seconds before OnTrigger can fire again, 0 defaults to 0.2. If set to -1, it will kill itself when triggered (as trigger_once), which means outputs like OnEntireTeamStartTouch can never fire.

TriggerOnce:
Filter Name (filtername) <filter>
Name of filter entity to test against activators.

EnableDisable:

Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Flags


TriggerOnce:
  •  [1] : Clients (in Left 4 Dead series survivors and SI)
  •  [2] : NPCs (in Left 4 Dead series commons and witches)
  •  [4] : Pushables
  •  [8] : Physics Objects
  •  [16] : Only player ally NPCs
  •  [32] : Only clients in vehicles
  •  [64] : Everything (not including physics debris)
  •  [512] : Only clients *not* in vehicles
  •  [1024] : Physics debris
  •  [2048] : Only NPCs in vehicles (respects player ally flag)
  •  [4096] : Disallow Bots
  •  [4096] : Correctly account for object mass (trigger_push used to assume 100Kg) and multiple component physics objects (car, blob...) (in all games since Alien Swarm)
Note.png Note: In Garry's Mod, flag 4096 is "Correctly account for object mass" for trigger_push only.[confirm]

Inputs

TouchTest
Tests if the trigger is being touched and fires an output based on whether the value is true or false.

Trigger:
TouchTest  (in all games since Half-Life 2: Episode Two)
Triggers either the OnTouching or OnNotTouching outputs for whether anything is touching this entity.
StartTouch  (in all games since Half-Life 2: Episode Two) !FGD
Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
EndTouch  (in all games since Half-Life 2: Episode Two) !FGD
Behave as if !caller had just exited the trigger volume.
DisableAndEndTouch  (only in Team Fortress 2)
Disables this trigger and calls EndTouch on all currently-touching entities.

TriggerOnce:
Toggle
Toggles this trigger between enabled and disabled states.

EnableDisable:

Enable
Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnStartTouchAll
Fired when an entity starts touching this trigger, and no other entities are touching it. Only entities that passed this trigger's filters are considered.

Trigger:
OnEndTouch
Fired when an entity stops touching this trigger. Only entities that passed this trigger's filters will cause this output to fire. (!activator is the exiting entity.)
Warning.png Warning: This includes entities which are deleted while inside the trigger. In this case !activator will be invalid.
OnEndTouchAll
Fires when the last entity in the entity's area exits this trigger or when this entity is disabled. Only entities that passed this trigger's filters are considered. (!activator is the last exiting entity.)
OnTouching  (in all games since Half-Life 2: Episode Two)
OnNotTouching  (in all games since Half-Life 2: Episode Two)
Fired when the TouchTest input is called.

TriggerOnce:

OnStartTouch
Fired when an entity starts touching this trigger. The touching entity must pass this trigger's filters to cause this output to fire. (!activator is the "toucher.")
OnTrigger
Fired repeatedly with a delay while an entity is within this trigger's volume. Delay is defined by Delay Before Reset key.