GSC reference › Built-in
CalcWeaponOptions()
Built-in (engine)
Server
Player Called on: player
Calculates weapon options
Signature
<player> CalcWeaponOptions(<custom class slot>, <weapon slot>)
Called on an entity: player CalcWeaponOptions(...)
Parameters
| Name | Required? | Details |
|---|---|---|
| custom class slot | Required | The custom class slot |
| weapon slot | Required | primary weapon=0 or secondary weapon=1 or knife weapon=2 |
Example (from Treyarch's docs)
primaryWeaponOptions = self CalcWeaponOptions( class_num, 0 )
Real uses in BO3's scripts
Called 20 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_bgb.gsc, line 686
self giveweapon(weapon, self calcweaponoptions(level.bgb[bgb].camo_index, 0, 0)); - scripts/zm/_zm_weap_nesting_dolls.gsc, line 123
weapon_options = self calcweaponoptions(var_1c3c9c82, 0, 0); - scripts/zm/_zm_weapons.gsc, line 2823
return self calcweaponoptions(0, 0, 0, 0, 0); - scripts/shared/_character_customization.csc, line 489
data_struct.weaponrenderoptions = calcweaponoptions(localclientnum, camoindex, 0, 0, 0, 0, showpaintshop, paintshopclasstype); - scripts/mp/gametypes/_loadout.gsc, line 1123
knifeweaponoptions = self calcweaponoptions(self.class_num, 2);
Related built-ins
- GetWeaponOptions()Get the weapon's render options
- UpdateWeaponOptions()Update weapon options for a weapon that the player has
- SetWeaponRenderOptions()Sets the weapon render options in the entity.
- GetBuildKitWeaponOptions()Get weapon options for the weapon from the player's build kit
- GetActorWeaponOptions()Return's the actors current weapon options, ex: weapon camo option.
- SetWeaponOptions()Sets the previously calculated weapon options of the entity.
- GetTopPlayersWeaponRenderOptions()Returns the render options for the weapon for the top player in the game by index
- ForceStreamWeaponRenderOptions()Forces all materials for the combination of weapon and render options to stream in
- GetCurrentWeapon()Gets the current player weapon
- GiveWeapon()Give a weapon to the player
- HasWeapon()Returns true if the player has the given weapon
- TakeWeapon()Take the weapon
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).