Global Parameters

XashXT

Global Parameters

Global parameters apply to most entities or all entities. Exceptions are cases where applying the parameter makes no sense (for example, rendering options for an object without a model) or there is a limitation introduced out of necessity. Such limitations are documented in the usage notes for individual entities. Note that this section mentions not only new but also customary Half-Life global parameters. The new ones are marked “(new)”.

targetname Found in most entities that have multiple states (normally they are two states: “on” and “off”) and for objects that cannot be controlled directly but can have their internal state read, for example through the use of multi_watcher.
target Contains the name of the target that the object can control. Controlling means not only state change, but also smooth analogue adjustment for some entities (such as momentary_door).
classname Class of the object. The class cannot be changed by the mapper and is used as a key name with some code attached to it for controlling this class of object. For example, the code attached to the name func_door simulates door behaviour, the code attached to the name monster_barney acts like a regular Black Mesa security guard, and so on.
globalname The object's global name used for unconditional transfer of the object to a new level if object transfer is not implied by default. For example, there is no point in setting this name for NPCs, because they are transferred to new levels anyway. The main purpose of globalname is to carry over logical objects and objects with brush models that are part of the current map. For successful transfer, set the same name for the necessary objects on all the maps you need.
Note: The decals on the object will be transferred along with it.
rendermode Defines the object's drawing mode. Not all modes are applicable to all types of entities and all models. This is what GoldSource does, and this behaviour was kept in XashXT.
  • 0 — normal. Opaque objects. Applies to brushes, models and sprites.
  • 1 — color. Translucent objects without textures. The rendercolor parameter controls object colour. Applies to brushes.
  • 2 — texture. Translucent objects with textures. The renderamt parameter controls transparency. Applies to models, brushes and sprites. Ignores rendercolor.
  • 3 — glow. Glow sprites with depth testing disabled. The sprite size increases in proportion with distance. The sprites observe the rendercolor and renderamt parameters. Applies only to sprites.
  • 4 — solid. Textures with transparent areas in them, as in grates and bars. The rendercolor и renderamt are ignored. Applies only to brushes.
    Note: Models and sprites have an internal flag that enables this rendermode, overriding the user setting.
  • 5 — additive. Contrary to its name, doesn't support applying an arbitrary colour to entities (except sprites). Models in this mode observe lighting.
  • 6 — world glow. Additional mode from Half-Life 2. Used only for sprites. The difference from glow is that the size of the sprite in world space is fixed, rather than in screen space (which really means scaling the sprite to compensate for the distance from the observer).
rendercolor Colour in RGB format in the range 0–255. The default value is 255 255 255 (set in the game engine). Works together with rendermode color (for models, sprites and brushes) and rendermode glow, worldglow (only for sprites).
renderamt Object transparency in the range 0–255. Works in the following rendermodes: color, texture, glow, additive, world glow.
renderfx A set of predefined effects, mainly for models. Normally used for changing model transparency by a preset function.
Includes flickering, smooth fade, holographic effect, glow shell and a few special modes for internal use.
colormap Specified as run-together literals of two numbers in the range from 0 to 255: topcolor and bottomcolor (from the palette). For example, for colours 48 and 132 specify 48132.
When the value is ambiguous (for example, colours 11 and 12), consider using a hexadecimal value instead of a decimal one—this ensures that each colour gets exactly two places in a four-digit number (for example, 11 and 12 will be represented by 0x0B0C).
In practice, only the topcolor is often specified, and bottomcolor omitted.
Works only for models that contain so called remap textures, where part of the palette can be replaced by custom values.
This feature is normally used for colouring the players on different teams, but it can be used in singleplayer as long as the model contains remap textures. The textures have special naming conventions and distribute the palette in a particular way; for details, see the appropriate documentation.
Remember also that this parameter increases map loading times, because the engine takes some time to create texture copies.
spawnflags A set of option flags individual to entities. This is where you should put the values documented in the Spawnflags sections of entity description pages. Most editors represents these flags as a group of check boxes for the convenience of mappers.
m_iClass (new) Found in all objects whose names begin with monster_ and for func_tank. Lets you set the attitude towards the player and other monsters.
For a detailed description of classes, see Monster Classes and Behaviour.
m_iPlayerReact (new) Found in all objects whose names begin with monster_. Lets you set the monster's attitude towards the player. For a detailed description, see the description of the env_customize entity.
parent (new) Name of the parent entity to attach the object to. The objects will be attaches exactly as arranged by the level designer on the map.
movewith (new) Alias for the parent field. Introduced for compatibility with the Spirit of Half-Life mod.
reflection (new) How the entity is reflected in mirrors:
  • 0 — default
  • 1 — do not draw in mirrors
  • 2 — draw only in mirrors
master Name of the blocking entity. Applies to nearly all objects that can be enabled and disabled.