Super Shotgun keeps autofiring...

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
Skwirl
Posts: 214
Joined: Sun Feb 01, 2015 11:38 pm
Location: 'merica
Contact:

Super Shotgun keeps autofiring...

Post by Skwirl »

So I got rid of A_Refire and included +NOAUTOFIRE in my super shotgun DECORATE, but it still autofires. I'm trying to make it so you have to keep clicking in order for it to fire, kind of like a real trigger. What am I doing wrong here?

Code: Select all

actor zxSuperShotgun : Weapon replaces SuperShotgun {

	Weapon.SlotNumber 3
	Weapon.SelectionOrder 400
	Weapon.AmmoUse 2
	Weapon.AmmoGive 8
	Weapon.AmmoType "Shell"
	Inventory.PickupMessage "$GOTSHOTGUN2"
	Obituary "$OB_MPSSHOTGUN"
	Tag "$TAG_SUPERSHOTGUN"
	+NOAUTOFIRE

	States {
		Ready:
			SHT2 A 1 A_WeaponReady
			Loop
		Deselect:
			SHT2 A 1 A_Lower
			Loop
		Select:
			SHT2 A 1 A_Raise
			Loop
		Fire:
			SHT2 A 3 Offset(0, 35) A_FireShotgun2
			SHT2 B 3 Offset(0, 45)
			SHT2 A 3 Offset(0, 35)
			SHT2 A 3
			SHT2 C 7 A_CheckReload
			SHT2 D 3 A_OpenShotgun2
			SHT2 E 4 Offset(55, 0)
			SHT2 F 4 Offset(105, 45) A_LoadShotgun2
			SHT2 F 2 Offset(105, 65)
			SHT2 F 2 Offset(105, 55)
			SHT2 F 1 Offset(95, 40)
			SHT2 F 3 Offset(85, 35)
			SHT2 G 6 Offset(55, 0)
			SHT2 H 2 A_CloseShotgun2
			SHT2 H 2 Offset(35, 0)
			SHT2 H 2 Offset(15, 0)
			SHT2 H 1
			Goto Ready
		Flash:
			SHT2 I 2 Bright A_Light1
			SHT2 J 2 Bright A_Light2
			Goto LightDone
		Spawn:
			SGN2 A -1
			Stop
	}
}
It may look wonky because I'm using an older version of Freedoom for the super shotgun sprite that this animation suits.
User avatar
Greyfalll
Posts: 15
Joined: Sat Aug 30, 2014 11:44 pm
Location: Pokke Village

Re: Super Shotgun keeps autofiring...

Post by Greyfalll »

https://zdoom.org/wiki/A_CloseShotgun2

A_CloseShotgun2 is the equivalent of doing

Code: Select all

SHT2 H 0 A_PlaySound ("weapons/sshotc", CHAN_WEAPON)
SHT2 H 6 A_ReFire
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: Super Shotgun keeps autofiring...

Post by wildweasel »

Greyfalll has the right of it. A little known fact is that A_CloseShotgun2 has two functions; it serves as a refire as well as a sound player, which is why holding the trigger on the vanilla Super Shotgun prevents you from hearing the last click.
Locked

Return to “Editing (Archive)”