AN-94 Weapon: Two round burst secondary fire?

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.
User avatar
Graaicko
Posts: 534
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

AN-94 Weapon: Two round burst secondary fire?

Post by Graaicko »

Im making progress. with my mod, shadow elite, Added some custom real world weapons, and even managed to put together some russian bad guys. I'm having trouble trying to make one of the weapons (AN-94) have a two round burst firemode using the secondary fire technique. I can get it to fire the two bullets no problem, but only in automatic fire. I would like the secondary fire that lets off two bullets to be semi-auto but still have the primary fire of automatic like an AK-74 for example. was wondering what the code would look like to make it fire only in semi-auto using the secondary fire. I know +NOAUTOFIRE will not work for the secondary fire function.

Heres the current code I have from the decorate if its any help :):
Spoiler:
Image
high res image upload
User avatar
phantombeta
Posts: 2214
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: AN-94 Weapon: Two round burst secondary fire?

Post by phantombeta »

Uhhh... The NOAUTOFIRE flag works perfectly fine with secondary fire AFAIK. You'll just have to add A_Refire to the end of the normal fire states, or it'll only fire one shot.
User avatar
TheRailgunner
Posts: 1556
Joined: Mon Jul 08, 2013 10:08 pm

Re: AN-94 Weapon: Two round burst secondary fire?

Post by TheRailgunner »

Code: Select all

AltFire:
TNT1 A 0 A_Jump(128,3)         //50% chance that it'll use the alternate firing frame
AN9F A 2 BRIGHT A_FireBullets (0,0,1,9)        //Decreased frame duration - the AN-94 fires the two-round burst at a staggering 1800 RPM, technically warranting a frame duration of 1
TNT1 A 0 A_Jump(256,2)         //Prevents second bullet from being fired until burst-fire catch
AN9F B 2 BRIGHT A_FireBullets (0,0,1,8)
PDRG A 0 A_JumpIfInventory("BurstCounter", 2, 2)            //Skips firing second bullet if already fired
TNT1 A 0 A_Jump(256, "Altfire")                                      //Returns to Altfire state if only one bullet has fired
TNT1 A 0 A_TakeInventory("BurstCounter",999)                //Allows weapon to keep firing bursts
AN94 C 2 A_SetPitch(pitch-0.2)
AN94 A 1 A_SetPitch(pitch-0.3)
AN94 A 1 A_SetPitch(pitch+0.3)
AN94 A 0 A_SetPitch(pitch+0.2)
AN94 A 0 A_WeaponReady          //Weapon can be fired semi-automatically, but won't refire if the trigger is held
Goto Ready 

Code: Select all

ACTOR BurstCounter : Inventory
{
	Inventory.MaxAmount 2
}
This should do the trick, Morty! It's AN-94 mixed with state jumps, Decorate inventory-based memory cells, and just a smidge of Pulsar-D - should add up to normal burst-fire.
User avatar
Graaicko
Posts: 534
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: AN-94 Weapon: Two round burst secondary fire?

Post by Graaicko »

I put this in but it does not want to work for some reason, I tried deleting and pasting the code in several times...
User avatar
TheRailgunner
Posts: 1556
Joined: Mon Jul 08, 2013 10:08 pm

Re: AN-94 Weapon: Two round burst secondary fire?

Post by TheRailgunner »

Graaicko wrote:I put this in but it does not want to work for some reason, I tried deleting and pasting the code in several times...
Can you PM me with a link to the mod, perhaps? I can see what the issue is more easily when I have freedom to playtest.
User avatar
Graaicko
Posts: 534
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: AN-94 Weapon: Two round burst secondary fire?

Post by Graaicko »

Alright will do.

Return to “Editing (Archive)”