game_player_equip

From Sven Co-op
Jump to navigation Jump to search
game_player_equip
Type

point

Status

supported

 


The game_player_equip entity is a powerful entity for managing player weapons/items/ammo loadout. You can gradually enable more and more game_player_equip entities to increase the players' arsenal as your map progresses, or allow players to trigger it directly. This entity exhibits strange behaviour when used incorrectly, so set it up carefully: Basically, you disable smart edit mode when viewing its properties in Valve Hammer Editor, then add new keyvalues, whereas the key's name be the name of the weapon-/item-/ammo-entity to supply, and value the quantity in which it shall be provided, per player. When providing an uzi, provide either weapon_uzi or weapon_uziakimbo, never both. For weapon quantity, always set 1. Never supply more than the player can pick up/carry. If at least one game_player_equip entity is enabled, the default weapon and ammo loadout from your map's config file will be ignored entirely. So if your map is using game_player_equip entities, you will probably want to have one game_player_equip entity that is always enabled to provide a default loadout. Whether a game_player_equip entity is enabled or not depends on the state of its master. If no master is set, it's always enabled. When the game_player_equip is triggered normally, it will equip the activating player. Be careful with that, as giving a player things he cannot pick up/carry will spawn and lie around till collected, possibly flooding the server.

1 Keyvalues

Player targetname : target

Set the targetname of a player to be the only one to ever receive equipment from this game_player_equip, if the 'Filter playername'-flag is set. This can be used for creating maps with roleplaying (when paired with the CVar mp_dropweapons

set to '0'), or preventing a player from using the same triggerable game_player_equip entity multiple times per life.

Team master : master

Currently unusable.

Equip Mode : equipmode

If set to "Give", it will provide players with items/weapons/ammo as described above. "Modify" allows to change .cfg file inventory and enable "Inventory Mode" to be used.

Inventory Mode : inventorymode

Allows advanced inventory manipulation, changes player's equip on respawn:

Set Items: Overrides inventory with given items. Add Items: Adds given items to inventory. If any item already exists, the values are sum together. Substract Items: Removes given items from inventory. If any item already exists, the values are substracted from them. Remove Items: Removes given items from inventory (if they exists). Restock Items: Set items if given value is greater than current value. Limit Items: Set items if given value is lesser than current value.

2 Flags

1 : USE only

If set, the game_player_equip entity will not equip respawning players, but only react to direct triggering, equipping its activator. This makes its master obsolete.

2 : Filter Playername

If selected, this game_player_equip will only equip players with a targetname 'Player targetname' (see below).

4 : Re-equip on use

If set, the game_player_equip entity will strip all weapons/ammo from the triggering player and then re-equip him. This is useful for preventing the aforementioned overflow.equip players with a targetname 'Player targetname' (see below).

8 : Append Map CFG

If selected, also give weapons specified in this map configuration file (mapname.cfg) instead of ignoring it.

3 Changes

5.0 Steam Release: Added 'Equip Mode' and 'Inventory Mode' keyvalues.5.07: Added 'Append Map CFG' flag.