Skip to content

Player entities

Roman Chistokhodov edited this page Jul 25, 2024 · 6 revisions

This page describes player related entities.

Special entity names

Certain played related events automatically trigger entities with special targetnames, providing the player as activator (in most cases).

See also: Special Entity Names on TWHL wiki

game_playerspawn

Triggered when player spawns. This can be used to configure some player parameters. It also can serve as an indicator that the map was loaded via a Start game menu or a console command and not through the changelevel.

In original Half-Life entities named game_playerspawn are triggered on the new player spawn only in multiplayer. Featureful SDK fires them in singleplayer as well.

game_playerdie

Triggered when player dies.

In original Half-Life entities named game_playerdie are triggered only in multiplayer. Featureful SDK fires them in singleplayer as well.

New Entities

game_player_settings

This entity allows to give/remove weapons and ammo to the player, configure player's health, armor and some other settings.

The game_player_settings without a targetname is triggered automatically when player spawns unless the map .cfg file exists (then it takes the priority and contents of game_player_settings are ignored).

player_capabilities

Enable/disable certain player's capabilities such as jump, duck (crouch), attack and use.

player_deployweapon

Force player to deploy a specified weapon.

Useful if your map defines some starting equipment and you want to make sure the player holds the specific weapon on spawn.

player_hasitem

Check if player has a specified item (suit, flashlight, NVG or longjump) and fire triggers accordingly.

Can be used as a master. If player has a specified item, the master state is On.

player_hasweapon

Check if player has a specified weapon (defined by weapon's classname) and fire triggers accordingly.

Can be used as a master. If player has a specified weapon, the master state is On.

player_inventory

Add, remove or set the specified count of the specific inventory item. Read Player inventory.

player_hasinventory

Check if player has a specified inventory item.

Can be used as a master. If player has a specified inventory item, the master state is On.

player_calc_ratio

The entity which reports the specified player value as its Locus Ratio. Can report the current health, armor, ammo amount and the inventory item count. Use it together with trigger_compare to implement the map logic that depends on these player parameters.

trigger_playerfreeze

Disable player movement and take away the weapon and use control.

trigger_player_teleport

Teleport player from its current position to the defined destination point.