SetWeapon

From ZDoom Wiki

Jump to: navigation, search
void SetWeapon(str weaponname);

Usage

Sets the player's current weapon to weaponname. Here's a listing of the weapons for each game:

Doom
  • Fist
  • Chainsaw
  • Pistol
  • Shotgun
  • SuperShotgun (Doom 2/Final Doom only)
  • Chaingun
  • RocketLauncher
  • PlasmaRifle
  • BFG9000
Heretic
  • Staff
  • Gauntlets
  • GoldWand
  • Crossbow
  • Blaster
  • SkullRod
  • PhoenixRod
  • Mace
Hexen
  1. Fighter
    • FWeapFist
    • FWeapAxe
    • FWeapHammer
    • FWeapQuietus
  2. Cleric
    • CWeapMace
    • CWeapStaff
    • CWeapFlame
    • CWeapWraithverge
  3. Mage
    • MWeapWand
    • MWeapFrost
    • MWeapLightning
    • MWeapBloodscourge
Strife
  • PunchDagger
  • StrifeCrossbow
  • StrifeCrossbow2
  • AssaultGun
  • MiniMissileLauncher
  • StrifeGrenadeLauncher
  • StrifeGrenadeLauncher2
  • FlameThrower
  • Mauler
  • Mauler2

Note that in the case of Hexen one class cannot use another classes weapons, so if you make new sprites for the Fighter's Axe and then play as the Cleric you'll be able to pick up the Axe but not use it. Outside of playing a Hexen game though, any weapon can be used anywhere else.

Although the above list is complete, a full list of inventory can be seen at Inventory along with details of how to make a textfile containing a list.

Examples

This is the worst script ever:

script 666 ENTER
{
    while(1)
    {
        if (Random(0, 1))
            SetWeapon("Fist");
        else
            SetWeapon("RocketLauncher");
	
        Delay(35*2);
    }
}

It randomly selects either the fist or rocket launcher every two seconds, making the player extremely frustrated and annoyed. Note that, if the player does not have the weapon, there will be no result from this command. See CheckInventory to check for the weapon.

Personal tools