

357, the weight value of the Magnum (being the highest in HL2 at 7) combined with this boolean ensures it is automatically selected for the scripted sequence that follows. An example of this is the initial appearance of the Magnum in the map d1_canals_08 in Half-Life 2 when the player walks within pickup range of the. Combined with the previous weight command can set the order of precedent for auto-selection. autoswitchto / bAutoSwitchTo Whether to switch to this gun on running out of ammo for another. Higher priority weapons will be selected before others when a weapon runs out of ammo, and a replacement is auto-selected by the game based on this value. The weight used in the name is often erroneously misunderstood to mean weight as a mass, but is actually the weight as a priority (A literary example being, "he's pulling his weight around"). weight / iWeight Used to determine the weapon's importance when the game auto-selects one. 0 Being the pistol in the (1) X axis by default. bucket_position / iPosition The HUD weapon selection in the Y axis. bucket / iSlot The HUD weapon selection in the X axis. Not providing a viewmodel and selecting the weapon will cause the game to crash. Relative to the game root, so be sure to include the models\ folder. viewmodel / szViewModel Path to the viewmodel seen by the player holding the weapon. Can use a localization key, as well as a definite string however, localization keys are case-insensitive, while defined strings are not.

Viewmodel and UI printname / szPrintName The friendly name shown to players in the UI max 80 characters. Note: The majority of the keys and values are case-insensitive, and as such proper capitalization such as CamelCase or full-lowercase is entirely up to personal preferences. Script keys are on the left, C++ variables on the right. These are the keyvalues that will be read by CBaseCombatWeapon. Weapons scripts should be located at game\scripts\.txt, and everything inside should be a child of a single weapondata table key.Ī weapon's scripted values are accessed from its GetWpnData() function in C++.
