I don't remember where the exact wiki entries are, so here it is in one post:
DECORATE can't wholly replace internal inventory items, just (as far as I know) actors on a map. If you have a weapon that replaces, say, the shotgun, grabbing a shotgun on the ground will give you the new weapon, but if you type "give shotgun" in the console you'll end up with the original Doom shotgun rather than the new weapon.
Which means that, to replace the fist, you'll have to set things up so that the player will 1) start with the sword in their inventory, and 2) be able to select the sword as part of weapon slot 1.
Create the following playerclass in DECORATE:
Code: Select all
actor Swordsman : DoomPlayer
{
player.displayname "Swordsman"
player.startitem Pistol
player.startitem Clip 50
player.startitem Sword
}
This creates a new player class that starts out with a pistol and sword, instead of pistol and fist. If you want the fist as well add "player.startitem Fist" - note that whatever you have as the first player.startitem entry is the weapon you first have out when the game starts.
Create a lump with "keyconf" with the following:
Code: Select all
clearplayerclasses
addplayerclass Swordsman
weaponsection doomerlsawesomeswordmodorwhateveryou'regonnacallit
setslot 1 Fist Sword Chainsaw
"clearplayerclasses" gets rid of the default doomguy as a player class and "addplayerclass" adds your new playerclass. Without the clearplayerclasses line, the player will still be able to start as the vanilla, swordless marine.
The name after weaponsection can be anything you want, just make sure it's unique and recognizable. The usual convention is to use capitals but no spaces, e.g., VaesIncrediblyAwesomeModOfExcellentness.
The setslot line is pretty self-explanatory. Putting a weapon name later means the weapon has higher priority (i.e., with the above configuration hitting 1 changes to the saw first, hitting 1 again changes from saw to sword, etc.), so if the sword's better overall than the chainsaw you might want to put the sword after. And, of course, if you're getting rid of the fist altogether you can delete "Fist" from that line.
If you only want the sword to be a pickup instead of a starting item, the only thing you need from here is the setweaponslot line and you won't have to define a new player class.