Weapon Script Changes
Mapbase adds a few new keyvalues specifically for weapon scripts defined in the scripts folder.
- viewmodel_fov <float>
Overrides the viewmodel FOV. Otherwise defers to the
Overrides the viewmodel FOV. Otherwise defers to the
viewmodel_fov cvar, which defaults to 54.
- bob_scale <float>
Scales how much the viewmodel moves when the player walks.
Scales how much the viewmodel moves when the player walks.
- sway_scale <float>
Scales how much the viewmodel sways when the player looks around.
Scales how much the viewmodel sways when the player looks around.
- sway_speed_scale <float>
Scales how quickly the viewmodel sways when the player looks around.
Scales how quickly the viewmodel sways when the player looks around.
- droppedmodel <string>
If specified, the weapon will use the specified model when on the floor instead of its worldmodel. Inspired by a similar keyvalue from Counter-Strike: Source.
If specified, the weapon will use the specified model when on the floor instead of its worldmodel. Inspired by a similar keyvalue from Counter-Strike: Source.
Half-Life 2
The following keyvalues are primarily relevant/usable in Half-Life 2 mods.
- AllowFlipping <bool>
Indicates whether this viewmodel can be flipped when the
Indicates whether this viewmodel can be flipped when the
cl_righthand cvar differs from the BuiltRightHanded value. This is based on reactivated functionality from Counter-Strike: Source.
- BuiltRightHanded <bool>
Indicates whether this viewmodel was built to be used right-handed when
Indicates whether this viewmodel was built to be used right-handed when
AllowFlipping is enabled. Defaults to 1, but if set to 0, then the viewmodel's flip state will be inverted. (i.e. flips when cl_righthand is enabled, rather than disabled)
- uses_hands <bool>
Indicates whether this weapon is intended to support c_arms. Disabled by default.
Indicates whether this weapon is intended to support c_arms. Disabled by default.
💡 Tip:
uses_hands can also be set through the Protagonist System.
- usage_restriction <string>
Restricts this weapon from use by NPCs or players by specifying either
Restricts this weapon from use by NPCs or players by specifying either
player_only or npc_only.
