Replacing fist weapon

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
superscrungus
Posts: 10
Joined: Thu Sep 27, 2018 9:30 pm

Replacing fist weapon

Post by superscrungus »

What it says on the tin. Having difficulties replacing the default fist with a new custom fist. Inherited from both the original fist and the DoomPlayer class, but the player won't spawn with it, and just starts with the default fist. Bizarrely, the scripting produced a second fist weapon, so if I use the "give all" command I have a saw, the default fist, and then my modified fist all occupying the same slot.

Here's the code, both for the replacer class and the weapon. Ommitted the States of the player class, since that's all unmodified for now and irrelevant to the problem.

Code: Select all

ACTOR Gauntlet : Fist replaces Fist
{
	Weapon.SelectionOrder 3700
	Weapon.SlotNumber 1
	Weapon.SlotPriority 0
	Obituary "$OB_MPFIST"
	Tag "$TAG_FIST"
	States
	{
	Ready:
		PUNG A 1 A_WeaponReady
		Loop
	Deselect:
		PUNG A 1 A_Lower
		Loop
	Select:
		PUNG A 1 A_Raise
		Loop
	Fire:
		PUNG B 1
		PUNG C 1 A_Punch
		PUNG D 1
		PUNG D 0 A_ReFire
		Goto Ready
	}
}

ACTOR ScrungusPlayer : DoomPlayer replaces DoomPlayer
{
  Player.DisplayName "Scrungus"
  Player.CrouchSprite "PLYC"
  Player.StartItem "Pistol"
  Player.StartItem "Gauntlet"
  Player.StartItem "Clip", 50
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Replacing fist weapon

Post by wildweasel »

Is the player class being defined for the game in a MAPINFO lump? https://zdoom.org/wiki/Creating_new_player_classes
User avatar
superscrungus
Posts: 10
Joined: Thu Sep 27, 2018 9:30 pm

Re: Replacing fist weapon

Post by superscrungus »

wildweasel wrote:Is the player class being defined for the game in a MAPINFO lump? https://zdoom.org/wiki/Creating_new_player_classes
Ah, the simplest solutions always evading me. Worked like a charm, thanks for the tip! c:
Post Reply

Return to “Scripting”