Class BaseTrigger
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
Base of the trigger volumes: a brush that reports what is inside it. Subclasses add what a touch does.
public abstract class BaseTrigger : BaseModelEntityInheritance
object ← BaseEntity ← BaseModelEntity ← BaseTrigger
Derived
TriggerLook, TriggerMultiple, TriggerTeleport
Inherited Members
BaseModelEntity.Solid, BaseModelEntity.ModelNode, BaseModelEntity.Physics, BaseModelEntity.LoadedModel, BaseModelEntity.CreateRootNode(), BaseModelEntity.BuildsCollider, BaseModelEntity.InputColor(EntityInputData), BaseModelEntity.InputAlpha(EntityInputData), BaseModelEntity.InputLightingOrigin(EntityInputData), BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.RigidTransform, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.SpawnData, BaseEntity.NameFixup, BaseEntity.SpawnGroup, BaseEntity.KeyValues, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.SpawnTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.WorldOrigin, BaseEntity.WorldAngles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.IsShown, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.CreateRootNode(), BaseEntity.CreateEditorNode(ObjectTypeFlags), BaseEntity.CreateEffect(string?, ParticleSnapshot?, bool), BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.AcceptsTouchFrom(BaseEntity), BaseEntity.OnStartTouch(BaseEntity), BaseEntity.OnTouch(BaseEntity), BaseEntity.OnEndTouch(BaseEntity), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.JumpTo(Vector3, Vector3), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.InputKill(EntityInputData), BaseEntity.InputFireUser1(EntityInputData), BaseEntity.InputFireUser2(EntityInputData), BaseEntity.InputFireUser3(EntityInputData), BaseEntity.InputFireUser4(EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.PhysicsSimulate(float), BaseEntity.TurnsByAngleComponents, BaseEntity.IsPusher, BaseEntity.IsUnblockableByPlayer, BaseEntity.MovesWithoutPushing, BaseEntity.PushesPlayerAsTrain, BaseEntity.HasVPhysicsSolid, BaseEntity.OnStartBlocked(BaseEntity), BaseEntity.OnBlocked(BaseEntity), BaseEntity.OnEndBlocked(), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.TurnBody(Vector3, Vector3), BaseEntity.SetOriginAndAngles(Vector3, Vector3), BaseEntity.SetWorldOriginAndAngles(Vector3, Vector3), BaseEntity.AddNode(SceneNode, bool), BaseEntity.OnRemove(), BaseEntity.UpdateTransform(), BaseEntity.UpdateColliderTransform(), BaseEntity.UpdateRenderTransform(float), BaseEntity.SnapInterpolation(), BaseEntity.AngleMod(float)
Remarks
A trigger's Spawn calls BaseTrigger.InitTrigger(). Deliberately stays visible: showing a map's triggers is the point. They use tools materials, so the tools-material toggle still hides them.
Constructors
BaseTrigger(EntitySystem, EntitySpawnInfo)
Initializes a trigger from its keyvalues.
protected BaseTrigger(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
IsEnabled
Gets whether the trigger reacts to anything.
public bool IsEnabled { get; }Property Value
bool
Methods
AcceptsTouchFrom(BaseEntity)
A disabled or spent trigger accepts no touches. Filters are not applied here; BaseTrigger.OnStartTouch(BaseEntity) ignores what they refuse.
protected override bool AcceptsTouchFrom(BaseEntity other)Parameters
other BaseEntity
Returns
bool
InitTrigger()
Shared trigger setup: non-solid so things pass through, enabled unless startdisabled.
protected void InitTrigger()InputDisable(EntityInputData)
Switches the trigger off; anything inside stops touching it on the next tick.
[EntityInput("Disable")]
protected void InputDisable(EntityInputData data)Parameters
data EntityInputData
InputEnable(EntityInputData)
Switches the trigger on; anything already inside is touched on the next tick.
[EntityInput("Enable")]
protected void InputEnable(EntityInputData data)Parameters
data EntityInputData
InputEndTouch(EntityInputData)
Behaves as if the entity that sent this input had just left the volume.
[EntityInput("EndTouch")]
protected void InputEndTouch(EntityInputData data)Parameters
data EntityInputData
InputStartTouch(EntityInputData)
Behaves as if the entity that sent this input had just entered the volume.
[EntityInput("StartTouch")]
protected void InputStartTouch(EntityInputData data)Parameters
data EntityInputData
InputToggle(EntityInputData)
Switches the trigger on if it is off, and off if it is on.
[EntityInput("Toggle")]
protected void InputToggle(EntityInputData data)Parameters
data EntityInputData
InputTouchTest(EntityInputData)
Reports whether anything is inside: OnTouching and then OnTouchingEachEntity once per entity when something is, OnNotTouching when nothing is.
[EntityInput("TouchTest")]
protected void InputTouchTest(EntityInputData data)Parameters
data EntityInputData
OnEndTouch(BaseEntity)
Runs on the tick other leaves this entity's volume.
protected override void OnEndTouch(BaseEntity other)Parameters
other BaseEntity
OnStartTouch(BaseEntity)
Runs on the tick other enters this entity's volume.
protected override void OnStartTouch(BaseEntity other)Parameters
other BaseEntity
PassesTriggerFilters(BaseEntity)
Whether other matches this trigger's spawnflags. filtername filters are not read.
protected bool PassesTriggerFilters(BaseEntity other)Parameters
other BaseEntity
Returns
bool
true when the touch should register.
Remarks
The player is the only thing here that can enter a volume, so only "everything" and "clients" can pass; a trigger for NPCs, pushables or physics props, or one naming nothing, never fires.
RemoveVolume()
Removes the volume for good while the trigger stays enabled; everything inside stops touching it on the next tick. Used by a spent trigger_once before it is removed.
protected void RemoveVolume()
