SetWeapon
Description[edit]
This is an ACS built-in function.
Changes activator's current weapon.
Usage[edit]
boolean SetWeapon(str weapon)
Parameters[edit]
- weapon: name of weapon to switch to. This name is one defined by an EDF weaponinfo block, which for the base games is stored in player.edf.
Return value[edit]
TRUE if the weapon was successfully selected or was already active, FALSE otherwise.
Examples[edit]
int result = SetWeapon("Crossbow"); // will return TRUE if player has and can use crossbow
Notes[edit]
This function only works if activator is a player.
This will not allow selecting a weapon missing from activator's playerclass weaponslot items (i.e. weapons not allowed for the given character class), even if the player holds it in the inventory.
If Heretic tome of power (from powereffect type PowerWeaponLevel2) is active, it will always choose the powered type even if you specify the unpowered weaponinfo definition name.
This function's identification in zspecial.acs is: (ACS internal).