Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
D_GARG

Semi Automatic Weapons?

Recommended Posts

Yes, you have probably seen these before, ZDoom forums is probalby better bust still ..

normal fire is full-auto standard, you hold the fire button and it keeps going.
AltFire is suposed to be a single shot, no continuing fire even tho you hold the fire button.

I am coding in decorate, I kinda suck at it, but here is the code

Spoiler

  ALTFIRE:
    M16G B 0 A_JumpIfNoAmmo("Deselect")
    M16G B 0 A_GiveInventory("M16Single", 1)
    M16G B 0 A_JUMP (47,"AM161")		//    M16F A 3 bright A_FireBullets (6.4,6,1,5.5,"BulletPuff")
    M16G B 0 A_JUMP (47,"AM162")
    M16G B 0 A_JUMP (47,"AM163")
    M16G B 0 A_JUMP (47,"AM164")
    M16G B 0 A_JUMP (47,"AM165")
    M16G B 0 A_JUMP (47,"AM166")
    M16G B 0 A_JUMP (47,"AM167")
    M16G B 0 A_JUMP (47,"AM168")
    M16G A 1 A_Refire
  Goto Ready

	
    
    AM161:
         
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F A 3 bright A_FireBullets (3,3,1,5,"BulletPuff")
    M16G A 7 (-altfire A_WeaponReady
    M16G A 0 A_Refire
    Goto Ready
    
    AM162:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F B 3 bright A_FireBullets (2.5,2.5,1,5.5,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
    
    
    AM163:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F A 3 bright A_FireBullets (6,6,1,5.8,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
    
    
    AM164:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F B 3 bright A_FireBullets (2.5,2.5,1,4,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
   
    
    AM165:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F A 3 bright A_FireBullets (6,6,1,4.5,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
    
    
    AM166:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F B 3 bright A_FireBullets (2.5,2.5,1,6,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
    
    
    AM167:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F A 3 bright A_FireBullets (2.5,2.5,1,6.5,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
    
    
    AM168:
    M16G A 0 A_jumpIfInventory("Clip", 0, "Deselect" )
    M16G A 0 A_jumpIfInventory("M16Single", 0, "Reload" )
    M16G A 0 A_TakeInventory("M16Single", 1)
    M16F B 3 bright A_FireBullets (6,6,1,7.5,"BulletPuff")
    M16G A 7
    M16G A 0 A_Refire
    Goto Ready
   
    
    Reload:    
    M16G A 1 
    M16G A 1 
    M16G A 1 
    
    

so how should I do to make this work? it has been spinning in my head for days now

Share this post


Link to post

Give "+WEAPON.NOAUTOFIRE" flag to the weapon, and remove all lines with A_Refire from the ALT attack states.

Or: Give "+WEAPON.NOAUTOFIRE" flag to the weapon, then define an "AltHold" state that immediately jumps into "Ready" state, and keep the lines with A_Refire.

Share this post


Link to post

It Works! however, if I make AltHold call the Refire, then wouldnt accuracy be added if I tap the fire button instead of holding it, while holding it will add spread?

edit: the ideal would be that the faster you click the larger is the chance that the shot will be affected by the set A_FIREBULLETS(X,Y) spread

Share this post


Link to post
D_GARG said:

however, if I make AltHold call the Refire, then wouldnt accuracy be added if I tap the fire button instead of holding it, while holding it will add spread?

Yes, indeed. But I told you something different: Make an AltHold state that contains only one instruction: "Goto Ready". The "A_Refire" should stay in AltFire only. When I said "keep the lines with A_Refire", I meant "keep them where you already have them".

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×