env_customize

XashXT

env_customize

Faithful recreation of the identically named entity from Spirit of Half-Life. Lets you change a variety of parameters for NPCs.

Spawnflags

SF_CUSTOM_AFFECTDEAD 1 (allows applying settings to dead monsters)
SF_CUSTOM_ONCE 2 (delete the object after use)
SF_CUSTOM_DEBUG 4 (output debugging messages about the object in the console)

Options

m_iVisible Show or hide the visible model. Works for all objects that have a model, not just for NPCs.
m_iSolid Make the model solid or intangible. Works for most objects. Note that if a model is originally intangible, you cannot make it solid. You can only switch between solid and non-solid in a model that is originally solid.
m_iszModel The parameter is the path to a new model. Lets you dynamically change the model for any object. Mind that the object with a new model can get stuck in the level architecture. Besides, the physics hull will not be recalculated for it. Use with caution.
m_voicePitch Range: 75–120. The pitch of a talking monster's voice. Has no effect on other types of object.
m_iPrisoner Makes the monster stop attacking its adversaries. Has the same meaning as the PRISONER spawnflag in monster properties.
m_iMonsterClip Makes the monster unaware of invisible barriers called func_monsterclip or aware of them again.
m_iClass New monster class. Determines the attitude towards all other monsters and the player. For details, see Monster Classes and Behaviour.
m_iPlayerReact The monster's reaction to the player:
  • 0—class-specific
  • 1—totally oblivious of the player
  • 2—friendly until hurt
  • 3—friendly if hurt inadvertently, meaning that the player hit it with a stray bullet rather than placed an aimed shot; whether or not the shot was aimed is determined by the hit spot
  • 4—unconditionally hostile
m_iProvoked Makes the NPC remember or forget who it was that hurt them. In other words, makes a friendly monster hostile without changing its other parameters. Shooting a monster with the player's weapon does the same.
m_iBloodColor Colour of the NPC's blood. The colour is a number in the range from 0 to 255 that corresponds to an index in the palette. Red is 247. Yellow is 195.
m_fFramerate Lets you change the framerate for an arbitrary entity that uses the pev->framerate variable. Whether or not a particular entity will behave as expected is strictly a matter of trial and error, because this has not been carefully tested.
m_fController0 Changes the position of bone controller 0 for an NPC or env_model.
m_fController1 Changes the position of bone controller 1 for an NPC or env_model.
m_fController2 Changes the position of bone controller 2 for an NPC or env_model.
m_fController3 Changes the position of bone controller 3 for an NPC or env_model.
skin Sets the skin number for a model or the type of contents for a brush. For example, water or lava.
body Changes the model body. Works for all entities that have models.
m_iReflection Lets you change mirror reflection settings:
  • 0—default
  • 1—not reflected in mirrors
  • 2—visible only in mirror reflections

Usage Details

  • For parameters where you can perform an explicit switch (turn on or off), response to activation types is highly configurable.
    This parameter is specified next to the corresponding option:
    CUSTOM_FLAG_NOCHANGE 0 (do not change this parameter)
    CUSTOM_FLAG_ON 1 (apply this parameter regardless of the activation type)
    CUSTOM_FLAG_OFF 2 (disable this parameter regardless of the activation type)
    CUSTOM_FLAG_TOGGLE 3 (invert the state of the parameter)
    CUSTOM_FLAG_USETYPE 4 (take into account the activation type—for example, USE_ON will result in turning on, USE_OFF in turning off and USE_TOGGLE in toggling)
    CUSTOM_FLAG_INVUSETYPE 5 (the same as CUSTOM_FLAG_USETYPE, but the effects of USE_ON and USE_OFF are inverted)
    For objects with multiple possible values, such as body, skin or m_iClass, use the reserved value of -1 to ignore parameter application.
  • The entity also supports the *locus keyword in the target field for applying settings to the activator of the entity.