trigger_change_class

Modified

12-Jul-2023

Allows you to change the classification of an entity, e.g. a monster or a func_breakable. The classification of an entity is used by monsters to determine whether it shall be considered as an enemy, an ally, as neutral or as something to fear. Most classifications will consider themselves as allies.

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_change_class so other entities can trigger it to change class of entity specified in "Target". Only 'On' and 'Toggle' trigger use-types are accepted. Can be kill-targeted.

Target target : Entity to change class.

Classification classify : Set the classification of target entity. For a complete table of how different classes react to each other, see monster class relation table.

  • -1 : None
  • 0 : Object Default : Keep default classification.
  • 1 : Machine
  • 2 : Player
  • 3 : Human Passive
  • 4 : Human Military
  • 5 : Alien Military
  • 6 : Alien Passive
  • 7 : Alien Monster
  • 8 : Alien Prey
  • 9 : Alien Predator
  • 10 : Insect
  • 11 : Player Ally
  • 12 : Player Hornet/Snark
  • 13 : Alien Hornet/Snark
  • 14 : X-Race
  • 15 : X-Race: Shocktrooper/Voltigore
  • 16 : Team 1 : Use it to classify to custom team.
  • 17 : Team 2 : Use it to classify to custom team.
  • 18 : Team 3 : Use it to classify to custom team.
  • 19 : Team 4 : Use it to classify to custom team.

Using !activator as the target to change the classification of the activating entity does not work. trigger_changevalue can be used instead to get around this.