Setting a default weapon

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
phlum
Posts: 41
Joined: Mon Feb 15, 2010 6:58 am
Contact:

Setting a default weapon

Post by phlum »

Hey,

So, I've made a new punching weapon and I've made it replace the fist. I've no idea how to make it a default weapon, however; in KEYCONF I've bound it to key 1 and I've also made a new DoomPlayer actor to replace the normal DoomPlayer.

Here's the DECORATE:

Code: Select all

actor NewPunch : Weapon replaces Fist
{
	States
	{
		Spawn:
			PUNG D -1
			Loop
		Ready:
			PUNG A 1 A_WeaponReady
			Loop
		Deselect:
			PUNG A 1 A_Lower
			Loop
		Select:
			PUNG A 1 A_Raise
			Loop
		Fire:
			PUNG B 3
			PUNG C 3 A_Punch
			PUNG D 2
			PUNG C 3
			PUNG B 3 A_Refire
			Goto Ready
		AltFire:
			PUN2 A 10
			PUN2 B 2
			PUN2 C 3 A_CustomPunch (15, 0, 0, "BulletPuff", 0)
			PUN2 D 13 Radius_Quake (2, 10, 0, 1, 1)
			PUN2 C 4
			PUN2 B 3
			PUNG A 0 A_Refire
			Goto Ready
	}
}

actor NewPlayer : DoomPlayer replaces DoomPlayer
{
	Game Doom
	player.startitem "NewPunch"
}
The weapon "NewPunch" replaces the Fist weapon but when I test the WAD I still seem to start with the normal fist - which I can't actually equip because it's not in KEYCONF.
How do I set this weapon as the default starting weapon? I actually took a look at Action Doom II's DECORATE to see what I could decipher and that's where I got the notion that I should have a DoomPlayer replacement actor. I don't know how to implement him though.
User avatar
Skutarth
Posts: 87
Joined: Sun Aug 13, 2006 11:57 am
Location: Hell

Re: Setting a default weapon

Post by Skutarth »

You have to define it in a player class:
http://zdoom.org/wiki/Classes:PlayerPawn

You're looking for:
Player.StartItem classname [amount]
Player.WeaponSlot slot, weapon1[, weapon2, weapon3, ...]

You also have to set the game up to remove the original player class, IIRC. It's not just a matter of replacing it via Decorate, but removing the old and inserting the new.

EDIT: Here you go:
http://zdoom.org/wiki/KEYCONF
User avatar
phlum
Posts: 41
Joined: Mon Feb 15, 2010 6:58 am
Contact:

Re: Setting a default weapon

Post by phlum »

Ah, right. Thanks.
Locked

Return to “Editing (Archive)”