A_ReFire Question(Solved)

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A_ReFire Question(Solved)

Re: A_ReFire Question

by MrToots » Mon Jan 15, 2018 5:01 pm

figured out both problems
the ammo problem was weird,it wasn't using the ammouse at first and thats why I have TakeInventory, but now its using both I got rid of take inventory and it take nothing so I set Ammouse to 0 and that works

the second problem was my mouse was sticking so it thought the button was still held down

man this stuff baffles me sometimes, fun to learn, but baffling(looks at acs...faints)

Re: A_ReFire Question

by wildweasel » Fri Jan 12, 2018 11:02 pm

A_Refire doesn't get cleared until it runs into another A_Refire to check the fire button's pressed status again. If you need to clear it without it responding to the button, try A_ClearRefire at the end of the state.

A_ReFire Question(Solved)

by MrToots » Fri Jan 12, 2018 8:01 pm

I'm trying to figure out holding attacks and i'm having a problem I can't seem to figure out

When I hit the fire button it should only take 1 Ammo but it takes 2 instead

Code: Select all

Spawn:
      TNT1 A -1
      loop
   Ready:
      BKNF A 10 A_WeaponReady
	  TNT1 A 0 A_GiveInventory("StaminaAmmo",1)
	  TNT1 A 0 A_TakeInventory("AdrenalineAmmo",1)
      Loop
   Deselect:
      TNT1 A 1 A_Lower
      Loop
   Select:
      BKNF A 1 A_Raise
	  loop
   Fire:
      TNT1 A 0 A_JumpIf(CountInv("StaminaAmmo")<1,"Ready")
	  BKNF B 4 
	  TNT1 A 0 A_TakeInventory("StaminaAmmo",1)
	  TNT1 A 0 A_PlayWeaponSound("Knife/Slash")
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-35,0,-35)
	  BKNF C 2 
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-35,0,-35)
	  BKNF D 2 A_FireCustomMissile("KnifeAttack")
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-35,0,-35)
	  TNT1 A 0 A_WeaponReady(WRF_NOSWITCH)
	  BKNF E 4 
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashGuard",-35,0,-35)
      TNT1 A 0 A_WeaponReady(WRF_NOSWITCH)
	  TNT1 A 0 A_Refire("FireHold")
	  Goto Ready
	FireHold:
	  BKNF B 4
	  TNT1 A 0 A_Refire("FireHold")
	  GoTo FireRelease
	FireRelease:
	  TNT1 A 0 A_TakeInventory("StaminaAmmo",3)
	  TNT1 A 0 A_PlayWeaponSound("Knife/Slash")
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-35,0,-35)
	  BKNF C 2 
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-35,0,-35)
	  BKNF D 2 A_FireCustomMissile("KnifeAttack2")
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-35,0,-35)
	  BKNF E 4 
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",35,0,35)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",20,0,20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",0,0)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-20,0,-20)
	  TNT1 A 0 A_FireCustomMissile("SlashReflect",-35,0,-35)
	  GoTo Ready
the other which I don't have the code for atm is I have a hold for a weapons primary fire and when i tap the button it goes straight to the ReFire instead

I tried fallowing the Wiki page but I can't seem to figure it out

Top