Skip to content

Base Entity

Blixibon edited this page Dec 14, 2019 · 7 revisions

This page lists changes to CBaseEntity, which every single entity in the Source engine derives from. This means every entity in Hammer technically possesses these changes, but whether they actually show up depend on how relevant the changes are to a certain entity. (e.g. "Enable/DisableDraw" is irrelevant on logic entities)

Some I/O were ported from other games or were already possible through other, more complicated means (e.g. keyvalues changed with AddOutput).

Inputs


New User I/O that could pass parameters:

  • PassUser1 <any> - Fires OutUser1 with the any parameter.
  • PassUser2 <any> - Fires OutUser2 with the any parameter.
  • PassUser3 <any> - Fires OutUser3 with the any parameter.
  • PassUser4 <any> - Fires OutUser4 with the any parameter.

  • FireRandomUser <void> - Fires OnUser1, OnUser2, OnUser3, or OnUser4 with a 25% chance of each.
  • PassRandomUser <any> - Fires OutUser1, OutUser2, OutUser3, or OutUser4 with a 25% chance of each, passing any parameter.

  • SetTarget <string> - A special new input designed to change an entity's "target", including things like path_track paths and env_gunfire targets. By default, this changes the common target keyvalue on entities. Some entities override SetTarget for their own keyvalues, e.g. scripted_sequence's target NPC. In code, this also calls Activate(), which is commonly used to assign m_target to cached entity handles.
  • SetOwnerEntity <ehandle> - Sets this entity's "owner entity". Owner entities are used for kill credit, non-collision, etc.

  • SetHealth <integer> - Sets this entity's health. This input already existed on several entities, but now it's part of all entities.
  • AddHealth/RemoveHealth <integer> - Adds to/removes from this entity's health. These inputs already existed on props and func_breakables, but now they're part of all entities, including NPCs.
  • SetMaxHealth <integer> - Sets this entity's maximum health. This will not change the entity's current health unless it exceeds the new maximum.

  • FireOutput <string> - Fires the named output on this entity. Format: <output name>:<activator>:<caller>:<parameter>:<delay> (OnDeath:hl3cardgame:gaben). Everything beyond the output name is optional.
  • RemoveOutput <string> - Removes all instances of the named output on this entity. Wildcards are supported, meaning you could just pass '*' to wipe all outputs from this entity.
  • AcceptInput <string> - Fires the named input an this entity. Format: <input name>:<parameter>:<activator>:<caller>:<output ID> (SetTarget:cheese). Everything beyond the input name is optional. Mind the fact this is arranged differently from FireOutput, having the parameter right after the input name.
  • CancelPending <void> - Cancels any events fired by this entity that are currently pending in the I/O event queue. This input originated from logic_relay, but it's been promoted to a base input so any entity could cancel their outputs.

  • FreeChildren <void> - Unparents all entities parented to this entity in a movement hierarchy.

  • SetLocalOrigin <vector> - Sets this entity's origin in local space, relative to its parent if one exists. Otherwise relative to the world.
  • SetLocalAngles <vector> - Sets this entity's angles in local space, relative to its parent if one exists. Otherwise relative to the world.
  • SetAbsOrigin <vector> - Sets this entity's origin in the map, always relative to the world origin.
  • SetAbsAngles <vector> - Sets this entity's angles in the map, always relative to the world origin.
  • SetLocalVelocity <vector> - Sets this entity's current velocity.
  • SetLocalAngularVelocity <vector> - Sets this entity's current angular velocity.

  • AddSpawnFlags <integer> - Adds spawnflag(s) to this entity. Many spawnflags have their respective numbers suffixed in Mapbase's FGD.
  • RemoveSpawnFlags <integer> - Removes spawnflag(s) from this entity. Many spawnflags have their respective numbers suffixed in Mapbase's FGD.
  • SetRenderMode <integer> - Sets this entity's render mode.
  • SetRenderFX <integer> - Sets this entity's render FX.
  • SetViewHideFlags <flags> - Sets view ID hide flags. See Drawing entities in specific view IDs for more information.
  • AddEffects <integer> - Adds to this entity's effects flags.
  • RemoveEffects <integer> - Removes from this entity's effects flags.
  • EnableDraw <void> - Draws this entity if it was undrawn before. Equivalent to RemoveEffects > 32. This was originally named DrawEntity, but it was changed to EnableDraw for the input in Portal 2.
  • DisableDraw <void> - Undraws this entity if it was drawn before. Equivalent to AddEffects > 32. This was originally named UndrawEntity, but it was changed to DisableDraw for the input in Portal 2.
  • AddEFlags <integer> - Adds to this entity's EFlags.
  • RemoveEFlags <integer> - Removes from this entity's EFlags.
  • SetMoveType <integer> - Sets this entity's movetype.
  • SetCollisionGroup <integer> - Sets this entity's collision group.

  • Touch <ehandle> - Simulates the specified entity touching the entity receiving this input. (e.g. a trigger receiving this input with a player as the parameter will be triggered by that player)

  • KillIfNotVisible <void> - Kills this entity if it's not visible to any players.
  • KillWhenNotVisible <float> - Kills this entity when it's not visible to any players. A specific amount of time before this is evaluated can be passed.

  • SetThinkNull <void> - Sets this entity's general think function to NULL. A string can be passed to clear the think of a specific context.

  • ChangeVariable <string> - A special version of AddOutput that changes a datadesc variable instead of a keyvalue, similar to logic_datadesc_accessor.

Outputs


  • OutUser1 <any> - Fires in response to the PassUser1 input, outputting any parameter.
  • OutUser2 <any> - Fires in response to the PassUser2 input, outputting any parameter.
  • OutUser3 <any> - Fires in response to the PassUser3 input, outputting any parameter.
  • OutUser4 <any> - Fires in response to the PassUser4 input, outputting any parameter.

  • OnKilled <void> - Fires when this entity is removed with the 'Kill' or 'KillHierarchy' input.

KeyValues


  • View ID nodraw <flags> - Controls whether an entity shouldn't be drawn in specific parts of the view rendering process. See Drawing entities in specific view IDs for more information.

The owner entity can now be accessed with the OwnerEntity keyvalue and m_fFlags can now be accessed with the aptly named m_fFlags keyvalue, but neither are actually used in any base FGD classes to avoid clutter.

Clone this wiki locally