Template:BasicCSGOweapon: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Revised OnCacheInteraction output.)
(Added HideWeapon input, BaseAnimating I/O. Omitted BaseAnimating KV for now because it's long and no one cares.)
Line 1: Line 1:
==Keyvalues==
==Keyvalues==
{{KV|Is this weapon allowed to be picked up?|intn=CanBePickedUp|boolean|Determines if players are able to pick up the weapon.}}
{{KV|Is this weapon allowed to be picked up?|intn=CanBePickedUp|boolean|Determines if players are able to pick up the weapon.}}
{{KV Targetname}}
{{KV Targetname|csgo=1}}
<!--{{KV BaseAnimating|csgo=1}}-->
{{KV Angles}}
{{KV Angles}}


Line 12: Line 13:
{{IO|SetReserveAmmoAmount|param=integer|Sets the reserve (secondary) ammo which is usually the number of bullets in reserve for reloading. Values that are greater than the weapon's reserve ammo limit are clamped to it (e.g. 90 for the [[weapon_ak47]]). Negative values make the ammo display disappear and reloading is impossible.}}
{{IO|SetReserveAmmoAmount|param=integer|Sets the reserve (secondary) ammo which is usually the number of bullets in reserve for reloading. Values that are greater than the weapon's reserve ammo limit are clamped to it (e.g. 90 for the [[weapon_ak47]]). Negative values make the ammo display disappear and reloading is impossible.}}
{{IO|ToggleCanBePickedUp|param=boolean|Toggles if the weapon can be picked up by players. Visually, nothing changes and there is no event if picking up fails. Hover texts like "[E] Swap for AK-47" remain in both cases.}}
{{IO|ToggleCanBePickedUp|param=boolean|Toggles if the weapon can be picked up by players. Visually, nothing changes and there is no event if picking up fails. Hover texts like "[E] Swap for AK-47" remain in both cases.}}
{{IO|HideWeapon|Hides the [[viewmodel]] of this weapon for the [[player]] having it deployed until it is deployed again.}}
{{I BaseAnimating}}
{{I Targetname}}
{{I Targetname}}


==Outputs==
==Outputs==
{{ScrollBox|title=Weapon|
{{ScrollBox|title=Weapon|
{{IO|OnPlayerUse|Fires when a player [[+use]]s this weapon '''''but does not pick it up''''', e.g. during the pickup cooldown immediately after dropping it or if <code>CanBePickedUp</code> is false {{PlAct}}.}}
{{IO|OnPlayerUse|Fires when a player [[+use]]s this weapon '''''but does not pick it up''''', e.g. during the pickup cooldown immediately after dropping it or if <code>CanBePickedUp</code> is false {{PlAct}}.}}
Line 21: Line 23:
{{IO|OnCacheInteraction|nofgd=1|Fires when a player picks this weapon up {{PlAct}}. Also fires rapidly when a player touches the weapon but automatic pickup fails, e.g. if he already has a weapon in that slot. Does not fire if <code>CanBePickedUp</code> is false.}}
{{IO|OnCacheInteraction|nofgd=1|Fires when a player picks this weapon up {{PlAct}}. Also fires rapidly when a player touches the weapon but automatic pickup fails, e.g. if he already has a weapon in that slot. Does not fire if <code>CanBePickedUp</code> is false.}}
{{IO|OnNPCPickup|nofgd=1|Fires when an [[NPC]] picks up this weapon {{activator|NPC}}}}. However, bots in {{csgo}} are considered players, so this output has no functionality.
{{IO|OnNPCPickup|nofgd=1|Fires when an [[NPC]] picks up this weapon {{activator|NPC}}}}. However, bots in {{csgo}} are considered players, so this output has no functionality.
{{O BaseEntity}}<includeonly>[[Category:Weapons]]</includeonly>
{{O BaseAnimating}}
{{O BaseEntity}}
}}
}}


<includeonly>[[Category:Weapons]]</includeonly>
<includeonly>[[Category:Counter-Strike: Global Offensive Entities]] [[Category:Counter-Strike: Global Offensive Weapons]]</includeonly>
<includeonly>[[Category:Counter-Strike: Global Offensive Entities]] [[Category:Counter-Strike: Global Offensive Weapons]]</includeonly>

Revision as of 15:00, 13 April 2021

Keyvalues

Is this weapon allowed to be picked up? (CanBePickedUp) <boolean>
Determines if players are able to pick up the weapon.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Flags

  • 1 : Start Constrained
Prevents the model from moving.

Inputs

SetAmmoAmount <integer>
Sets the (primary) ammo which is usually the number of bullets in the active magazine. Every value behaves like its congruent value in the range 0-255 in modulus 256 (e.g. -255 and 257 behave like 1 etc.). When set to 0, a player holding this weapon will reload automatically, if possible. Other values congruent to 0 (-256, 256, 512, ...) might cause undefined behavior. Values congruent to -1 (mod 256) make the ammo numbers disappear. If set to a value outside the weapon's clip size, reloading might deliver unexpected results.
SetReserveAmmoAmount <integer>
Sets the reserve (secondary) ammo which is usually the number of bullets in reserve for reloading. Values that are greater than the weapon's reserve ammo limit are clamped to it (e.g. 90 for the weapon_ak47). Negative values make the ammo display disappear and reloading is impossible.
ToggleCanBePickedUp <boolean>
Toggles if the weapon can be picked up by players. Visually, nothing changes and there is no event if picking up fails. Hover texts like "[E] Swap for AK-47" remain in both cases.
HideWeapon
Hides the viewmodel of this weapon for the player having it deployed until it is deployed again.
Note.pngNote:Content moved to Rendering and studio model related KIO/Inputs for continuation of page history


Outputs

Weapon:
OnPlayerUse
Fires when a player +uses this weapon but does not pick it up, e.g. during the pickup cooldown immediately after dropping it or if CanBePickedUp is false (!activator is the player.).
OnPlayerPickup
Fires when a player picks this weapon up (!activator is the player.).
OnCacheInteraction  !FGD
Fires when a player picks this weapon up (!activator is the player.). Also fires rapidly when a player touches the weapon but automatic pickup fails, e.g. if he already has a weapon in that slot. Does not fire if CanBePickedUp is false.
OnNPCPickup  !FGD
Fires when an NPC picks up this weapon (!activator is the NPC). However, bots in Counter-Strike: Global Offensive are considered players, so this output has no functionality.
Note.pngNote:Content moved to Rendering and studio model related KIO/Outputs for continuation of page history