Skip to main content

Entity keyvalues

Every entity in a map is a list of keys and values, and SBO adds new kinds of keys: model scale, object hints that mark what players can use, custom keys that work as your map's variables, and special names for the entities in a chain of triggers. The keys hold an entity's class name, its position and the settings the editor shows, and the game reads them when the map loads. Some entities can also change them while the map runs, see Changing keys for more details.

Keys shared by many entities​

Many entities share the same keys, such as Name, Target, Delay before trigger, KillTarget, Master and the render keys Render Mode, FX Amount and FX Color. An env_render changes the render keys while the map runs, at once or with a smooth fade (see Props, models and fades). See Common keys for every shared key and its values.

Model scaleSpirit of Half-Life​

The key scale (Model scale) draws a model at this many times its size, so 0.5 is half size and 2 is twice the size, and an empty value or 1 is the normal size. See Model scale for the entities that read it and what else grows or shrinks with the model.

Object hints​

An object hint is a sprite that marks an object a player can use or pick up, so players can find buttons and chargers in a busy room. You turn it on for one entity with the key objecthint (Object Hint Template), which the FGD offers on buttons, func_recharge, doors, items and ammo_reserve, and which any other entity accepts too. The template decides what the player sees:

A player walks up to a button with objecthint button: the brackets around it grow as the player comes near and turn yellow when the use key would press it

Object hints on a suit charger (charger), a lock button and a lamp button (button)

TemplateWhat the player sees
EmptyNo hint
buttonBrackets in the HUD color when the player is near, which turn yellow when the use key would press the button and orange while its master locks it
chargerBrackets in the HUD color when the player is near, which turn green when the use key would use the charger and red when it is empty or the player has no suit
eyescannerBrackets in the HUD color when the player is near, which turn yellow when the use key would use it
pickupBrackets in the HUD color when the player is near, which turn yellow when the use key would pick it up, and no hint while it waits to respawn or the player can't take it

Near means within the hint distance of the player's eyes, in front of the player and not behind a wall. The key objecthint_distance (Hint Distance) sets that distance in units, up to 4096, and an empty value or 0 gives 512. The colored look only shows on the object the use key would use right now, within 64 units. If you write a template name that doesn't exist, the entity shows no hint, and with developer 1 set in the console, the console shows a line when the map loads.

Each player sees the hints of the objects near them, while spectators and dead players see none. With the setting cl_objecthint, players choose whether they see every hint, only the hint on the object the use key would use, or none.

Custom keys​

A key whose name starts with $i_, $f_, $v_ or $s_ is a custom key, and you can give one to any entity, in the editor or while the map runs. A custom key does nothing by itself, but it holds a value other entities read and change, so custom keys work as the variables of your map's logic. The start of the name sets the kind of value:

PrefixKind of valueExample
$i_A whole number$i_kills 0
$f_A number with decimals$f_power 0.5
$v_Three numbers, x y z$v_spot 0 128 64
$s_Text$s_status OK

trigger_changevalue, trigger_copyvalue and trigger_condition read and write them. A map can have up to 1024 custom keys, and a custom key name can have up to 31 characters. See Changing keys for more details.

Special names​

Some keys that take an entity name also accept a special name, which stands for an entity in the current chain of triggers:

NameWhat it stands forWhere it works
!activatorThe entity that started the chain of triggers, such as the player who pressed a buttonTarget and KillTarget, the keys of trigger_changevalue, trigger_copyvalue, trigger_condition and trigger_entity_iterator, and locus keys
!callerThe entity that triggered this one, but in KillTarget the entity itselfTarget and KillTarget, and the keys of trigger_changevalue, trigger_copyvalue, trigger_condition and trigger_entity_iterator
*locusThe same as !activatorLocus keys
*playerThe activator, but only when it is a playerLocus keys

Changes since 1.38​

  • The scale key draws models at that scale. SBO 1.38 always drew them at their normal size
  • Object hints, custom keys and the special names are new

See also​