Ammo pack (TFC)

From Valve Developer Community
Jump to navigation Jump to search

Team Fortress Classic An ammopack is one of the most common ways to replenish ammo and health in Team Fortress Classic maps. It can be found in various places throughout the levels to help players keep going. Its Team Fortress 2 counterpart is the item_ammopack_<size> and item_healthkit_<size>.

An ammopack using the models/backpack.mdl model.


Creating the ammopack

Placing the ammopack into the level is relatively simple. Just place an info_tfgoal entity in the level where you want it to be. Set the Model Path/name.mdl to the filename of the model you want to represent the ammopack in-game. Most ammopacks in Team Fortress Classic uses models/backpack.mdl but there are other models that can be used, and you can even use custom models. Set the Play Sound Path/name.wav to a wav sound file you want to play when the player picks up this ammopack. Leave it empty for no sound.

Lastly set the Stay Active(sec) keyvalue to the time in seconds you want it to take for the ammopack to respawn. This is often between 10 and 20 seconds, depending on how much ammo there is in the pack.

Adding ammo to the pack

The ammopack should work in-game now, but it won't actually give you any ammo if you walk over it.

To fix this, modify the Add/Subtrack <object> and Armor Value keyvalues to give the amount of ammo you want. 0 gives no ammo/armor/health and putting a minus (-) in front of the number subtract this much from the players ammo/armor/health.

If you only want one team to be able to pick up the ammopack, set the Team Allowed To Use Goal keyvalue to that team.