by DenTheUA » Sat Dec 16, 2017 2:48 am
So I am actually working on a project, and I've done a weapon with sights.
The problem is that when I press the altfire button first time, gun becames aimed, but when I press Altfire second time, it doesn't go to Ready state, but instead it flickers and stays aimed.
Here's my lump:
Spoiler:
ACTOR Sights: Inventory
{
Inventory.MaxAmount 1
}
ACTOR BioPistol: Weapon
{
Weapon.AmmoType "Clip"
Weapon.AmmoGive 60
Weapon.AmmoUse 1
AttackSound "Pestol/pew"
Weapon.SelectionOrder 10
Weapon.SlotNumber 1
Inventory.PickupMessage "Got a Broadsider pistol!"
States
{
Spawn:
PSTP A -1
Stop
Ready:
PSTL A 0 A_JumpIfInventory("Sights", 1, "ReadyA")
PSTL A 1 A_WeaponReady
loop
Select:
PSTL A 1 A_Raise
loop
Deselect:
PSTL A 0 A_TakeInventory("Sights",1)
PSTL A 0 A_ZoomFactor(1)
PSTL A 1 A_Lower
wait
Fire:
PSTL A 0 A_JumpIfInventory("Sights", 1, "FireZ")
PSTL B 3 A_FireBullets(5,5,1,10)
PSTL CD 3
PSTL A 0 A_Refire
goto Ready
Altfire:
PSTL A 3 A_JumpIfInventory("Sights", 1, "ZoomN")
PSTL A 3 A_GiveInventory ("Sights", 1)
PSTL A 0 A_ZoomFactor(3)
goto Ready
ReadyA:
AIMP A 1 A_WeaponReady
loop
ZoomN:
TNT1 A 0 A_TakeInventory ("Sights",1)
TNT1 A 0 A_ZoomFactor(1)
goto Ready
FireZ:
AIMP A 3
AIMP B 3 A_FireBullets(3,3,1,15)
AIMP C 3
AIMP C 0 A_ReFire
Goto ReadyA
}
}
So I am actually working on a project, and I've done a weapon with sights. The problem is that when I press the altfire button first time, gun becames aimed, but when I press Altfire second time, it doesn't go to Ready state, but instead it flickers and stays aimed. Here's my lump: [spoiler]ACTOR Sights: Inventory { Inventory.MaxAmount 1 } ACTOR BioPistol: Weapon { Weapon.AmmoType "Clip" Weapon.AmmoGive 60 Weapon.AmmoUse 1 AttackSound "Pestol/pew" Weapon.SelectionOrder 10 Weapon.SlotNumber 1 Inventory.PickupMessage "Got a Broadsider pistol!" States { Spawn: PSTP A -1 Stop Ready: PSTL A 0 A_JumpIfInventory("Sights", 1, "ReadyA") PSTL A 1 A_WeaponReady loop Select: PSTL A 1 A_Raise loop Deselect: PSTL A 0 A_TakeInventory("Sights",1) PSTL A 0 A_ZoomFactor(1) PSTL A 1 A_Lower wait Fire: PSTL A 0 A_JumpIfInventory("Sights", 1, "FireZ") PSTL B 3 A_FireBullets(5,5,1,10) PSTL CD 3 PSTL A 0 A_Refire goto Ready Altfire: PSTL A 3 A_JumpIfInventory("Sights", 1, "ZoomN") PSTL A 3 A_GiveInventory ("Sights", 1) PSTL A 0 A_ZoomFactor(3) goto Ready ReadyA: AIMP A 1 A_WeaponReady loop ZoomN: TNT1 A 0 A_TakeInventory ("Sights",1) TNT1 A 0 A_ZoomFactor(1) goto Ready FireZ: AIMP A 3 AIMP B 3 A_FireBullets(3,3,1,15) AIMP C 3 AIMP C 0 A_ReFire Goto ReadyA } }[/spoiler]