Trying to understand the Pistol

Do you have a question about making weapon mods, or do you just need some tutorials and resources? Ask about all of that here.

Moderator: wildweasel

Lardarse
Posts: 4
Joined: Wed May 09, 2007 20:18
Location: Bristol, UK

Trying to understand the Pistol

Post by Lardarse »

Hi there. I was wondering if the regulars here could confirm some or all of the following, based on the DECORATE version of the Pistol code as listed on the ZDoom Wiki:

- When you press the button to fire the pistol, it first goes into 4 frames of "pre-fire", so that the gun doesn't fire straight away when you pres the button.

- After these 4 frames, the gun then fires the bullet, and displays the appropriate sprite for 6 frames, and then another sprite for 4 frames.

- At this point, it checks to see if you're still holding down the fire button. If you are, it goes through the {A4; Fire; B6; C4;} sequence again.

- If you aren't holding down the button when that check is made, then the gun goes into a "cool-down" state where you aren't able to fire again for an additional 5 frames.

- The code as shown does not account for the first bullet always being accurate.

Is there anything that I am understanding incorrectly?
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!

Post by wildweasel »

- The code as shown does not account for the first bullet always being accurate.
That's not true - the A_Refire check also enables the weapon's inaccuracy after the first shot. That's just the way A_Refire works.
Lardarse
Posts: 4
Joined: Wed May 09, 2007 20:18
Location: Bristol, UK

Post by Lardarse »

If that is true, then the code on the shotgun page would make it fire like a rifle with each first shot. I assume that the shotgun page is incorrect...
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!

Post by wildweasel »

No, the shotgun page is also correct, as refire accuracy only applies to weapons that fire a single bullet per shot. If the bullet count in A_FireBullets is set to any number greater than 1, then it automatically turns it into a spread shot weapon. If the number is set to -1, only one bullet is fired, and that shot is never accurate.
Lardarse
Posts: 4
Joined: Wed May 09, 2007 20:18
Location: Bristol, UK

Post by Lardarse »

Ok. I'll try to get used to this weirdness.

One final question: How is angle measured? Is it from center to edge or from edge to edge?
User avatar
DoomRater
Posts: 397
Joined: Tue Jul 19, 2005 4:14
Location: Programmer's Room, talking to Will Harvey

Post by DoomRater »

My guess is center to edge. I dunno really, I just fidn a value that suits my needs via experimentation.
User avatar
Marty Kirra
Posts: 364
Joined: Sat Jul 09, 2005 4:25

Post by Marty Kirra »

Since I'm here, what exactly does this, "+WEAPON.WIMPY_WEAPON", do?
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell

Post by TheDarkArchon »

Bot AI stuffage, IIRC.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!

Post by wildweasel »

The WIMPY_WEAPON flag actually tells Doom not to auto-switch to that weapon when you're out of ammo unless there's nothing else. For example, I believe the Fist has WIMPY_WEAPON on it.

Return to “Weapon Modding Help & Resources”