by Dan_The_Noob » Fri May 17, 2019 9:12 pm
Spoiler:Code: Select all
Ready:
TNT1 A 0 A_JumpIfInventory ("clip", 0, "ReadyFull")
PPIS A 1 A_WeaponReady (WRF_ALLOWRELOAD)
Loop
I can't find "ReadyFull" but i may be blind.
also, it shouldn't take any ammo if it skips to ready... i'll look through the code it just seems really intense with all the animation frames
--EDIT--
OHHHHHH you want the revolver to fanfire when you AltFire!
i took out all the offsets n crap jus to read it and i see now ...
OK let me see.
--EDIT 2--
here's what the code looks like without all the animation offsets (just "do stuff" code left) and i removed
A_AlertMonsters playing each shot and the weapon flags etc.
and honestly... I think removing
+Weapon.AMMO_OPTIONAL is probably your solution. but you could cleanup things like AltFire could be a
reloadcheck loop check.
or you could replace AltFire with just a "Hold:" state for Fire (since it doesn't seem too different anyway?) then use AltFire for the punch stuff.
Spoiler:Code: Select all
ACTOR Revolver : ModWeapon replaces Pistol
{
Weapon.SelectionOrder 2000
Weapon.SlotNumber 2
Weapon.AmmoType "PistolMag"
Weapon.AmmoUse 1
Weapon.AmmoGive 0
Weapon.AmmoType2 "clip"
Weapon.AmmoGive2 6
Weapon.AmmoUse2 0
Inventory.PickupMessage "You got your Revolver back!"
Inventory.PickupSound "weapons/pistol/slide"
Weapon.UpSound "weapons/pistol/equip"
Tag "Revolver"
States
{
Ready:
TNT1 A 0 A_JumpIfInventory ("clip", 0, "ReadyFull")
PPIS A 1 A_WeaponReady (WRF_ALLOWRELOAD)
Loop
Select:
PPIS A 1 A_Raise
TNT1 A 0 A_PlaySound("weapons/pistol/slide", CHAN_AUTO)
Goto Ready
Deselect:
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("AnimToggle")==1, "DeadSelect")
TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO)
TNT1 A 0 A_PlaySound("weapons/pistol/holster", CHAN_AUTO)
PPIS A 1 A_Lower
Wait
Fire:
TNT1 A 0 A_JumpIfNoAmmo ("Dryfire")
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 1 A_FireBullets(2, 2, -1, 30, "BulletPuff", 1)
Goto Ready
AltFire:
TNT1 A 0 A_JumpIfNoAmmo ("dryfire")
TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1)
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1)
TNT1 A 0 A_JumpIfNoAmmo ("Dryfire")
TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1)
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1)
TNT1 A 0 A_JumpIfNoAmmo ("Dryfire")
TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1)
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1)
TNT1 A 0 A_JumpIfNoAmmo ("Dryfire")
TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1)
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1)
TNT1 A 0 A_JumpIfNoAmmo ("Dryfire")
TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1)
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1)
TNT1 A 0 A_JumpIfNoAmmo ("Dryfire")
TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1)
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1)
Goto dryfire
NoReloadFire:
TNT1 A 0 A_JumpIfInventory("clip", 1, 1)
Goto Fire+1
TNT1 A 0 A_GunFlash
TNT1 A 0 A_PlaySound("weapons/pistol/fire")
TNT1 A 0 A_TakeInventory("clip", 1, TIF_NOTAKEINFINITE)
TNT1 A 0 A_FireBullets(2, 2, -1, 30, "BulletPuff", 1)
TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner", 0, 0, 8, 0)
TNT1 A 0 A_FireCustomMissile("9mmCasingSpawner", 0, 0, 8, 0)
Goto Ready
Dryfire:
TNT1 A 0 A_PlaySound("weapons/pistol/dryf", 6)
Reload:
TNT1 A 0 A_JumpIfInventory("PistolMag", 6, 2)
TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadWork")
PPIS A 1 A_WeaponReady
Goto Ready
ReloadWork:
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, "ReloadWork2")
PPIS GHIJKLLL 1
TNT1 A 0 A_PlaySound("weapons/pistol/cout", 6)
PPIS MMMNNN 1
Goto ChamberCheck
ReloadWork2:
PPIS GHIJKLLL 1
TNT1 A 0 A_PlaySound("weapons/pistol/cout", 6)
PPIS MMMNNN 1
Goto ChamberCheck
ChamberCheck:
TNT1 A 0 A_JumpIfInventory("PistolMag", 1, "ReloadLoop2")
Goto ReloadLoop
ReloadLoop:
TNT1 A 0 A_TakeInventory("clip", 1)
TNT1 A 0 A_GiveInventory("PistolMag", 1)
TNT1 A 0 A_JumpIfInventory("PistolMag", 6, "ReloadFinish")
TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadLoop")
Goto ReloadFinish
ReloadLoop2:
TNT1 A 0 A_TakeInventory("clip", 1)
TNT1 A 0 A_GiveInventory("PistolMag", 1)
TNT1 A 0 A_JumpIfInventory("PistolMag", 6, "ReloadFinish2")
TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadLoop2")
Goto ReloadFinish2
ReloadFinish:
PPIS OOPPPQQQRRR 1
TNT1 A 0 A_PlaySound("weapons/pistol/cin", 6)
PPIS SSSTTTTUUU 1
Goto Ready
ReloadFinish2:
PPIS OOPPPQQQRRR 1
TNT1 A 0 A_PlaySound("weapons/pistol/cin", 6)
PPIS SSSTTTTUUU 1
Goto Ready
DoPunch:
TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO)
TNT1 A 0 A_TakeInventory("Punching",1)
TNT1 A 0 A_PlaySound("swing")
ActualPunch:
TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "BerserkPunch")
TNT1 A 0 A_FireCustomMissile("FistAttack",0,0,0,0)
TNT1 A 3
Goto PunchDone
BerserkPunch:
TNT1 A 0 A_PlaySound("bsrkswing", CHAN_AUTO)
TNT1 A 0 A_FireCustomMissile("BerserkFistAttack",0,0,0,0)
TNT1 A 3
Goto PunchDone
PunchDone:
Goto Ready
Flash:
BRTF B 1 Bright A_Light2
BRTF A 1 Bright A_Light1
Goto LightDone
Spawn:
PIST A -1
Stop
}
}
ACTOR PistolMag : Ammo
{
Inventory.PickupMessage ""
Inventory.Amount 0
Inventory.MaxAmount 6
Ammo.BackpackAmount 0
Ammo.BackpackMaxAmount 6
Inventory.PickupSound ""
}
[spoiler][code] Ready: TNT1 A 0 A_JumpIfInventory ("clip", 0, "ReadyFull") PPIS A 1 A_WeaponReady (WRF_ALLOWRELOAD) Loop[/code][/spoiler] I can't find "ReadyFull" but i may be blind. also, it shouldn't take any ammo if it skips to ready... i'll look through the code it just seems really intense with all the animation frames [b]--EDIT-- [/b] OHHHHHH you want the revolver to fanfire when you AltFire! i took out all the offsets n crap jus to read it and i see now ... OK let me see. [b]--EDIT 2--[/b] here's what the code looks like without all the animation offsets (just "do stuff" code left) and i removed[i][b] A_AlertMonsters[/b][/i] playing each shot and the weapon flags etc. and honestly... I think removing [i][b][u]+Weapon.AMMO_OPTIONAL[/u][/b][/i] is probably your solution. but you could cleanup things like AltFire could be a[i][b] reloadcheck[/b][/i] loop check. or you could replace AltFire with just a "Hold:" state for Fire (since it doesn't seem too different anyway?) then use AltFire for the punch stuff. [spoiler][code]ACTOR Revolver : ModWeapon replaces Pistol { Weapon.SelectionOrder 2000 Weapon.SlotNumber 2 Weapon.AmmoType "PistolMag" Weapon.AmmoUse 1 Weapon.AmmoGive 0 Weapon.AmmoType2 "clip" Weapon.AmmoGive2 6 Weapon.AmmoUse2 0 Inventory.PickupMessage "You got your Revolver back!" Inventory.PickupSound "weapons/pistol/slide" Weapon.UpSound "weapons/pistol/equip" Tag "Revolver" States { Ready: TNT1 A 0 A_JumpIfInventory ("clip", 0, "ReadyFull") PPIS A 1 A_WeaponReady (WRF_ALLOWRELOAD) Loop Select: PPIS A 1 A_Raise TNT1 A 0 A_PlaySound("weapons/pistol/slide", CHAN_AUTO) Goto Ready Deselect: TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("AnimToggle")==1, "DeadSelect") TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO) TNT1 A 0 A_PlaySound("weapons/pistol/holster", CHAN_AUTO) PPIS A 1 A_Lower Wait Fire: TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 1 A_FireBullets(2, 2, -1, 30, "BulletPuff", 1) Goto Ready AltFire: TNT1 A 0 A_JumpIfNoAmmo ("dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) TNT1 A 0 A_JumpIfNoAmmo ("Dryfire") TNT1 A 0 A_TakeInventory("PistolMag", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_JumpIfInventory("PistolMag", 1, 1) TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_FireBullets(2, 2, -1, 24, "BulletPuff", 1) Goto dryfire NoReloadFire: TNT1 A 0 A_JumpIfInventory("clip", 1, 1) Goto Fire+1 TNT1 A 0 A_GunFlash TNT1 A 0 A_PlaySound("weapons/pistol/fire") TNT1 A 0 A_TakeInventory("clip", 1, TIF_NOTAKEINFINITE) TNT1 A 0 A_FireBullets(2, 2, -1, 30, "BulletPuff", 1) TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner", 0, 0, 8, 0) TNT1 A 0 A_FireCustomMissile("9mmCasingSpawner", 0, 0, 8, 0) Goto Ready Dryfire: TNT1 A 0 A_PlaySound("weapons/pistol/dryf", 6) Reload: TNT1 A 0 A_JumpIfInventory("PistolMag", 6, 2) TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadWork") PPIS A 1 A_WeaponReady Goto Ready ReloadWork: TNT1 A 0 A_JumpIfInventory("PistolMag", 1, "ReloadWork2") PPIS GHIJKLLL 1 TNT1 A 0 A_PlaySound("weapons/pistol/cout", 6) PPIS MMMNNN 1 Goto ChamberCheck ReloadWork2: PPIS GHIJKLLL 1 TNT1 A 0 A_PlaySound("weapons/pistol/cout", 6) PPIS MMMNNN 1 Goto ChamberCheck ChamberCheck: TNT1 A 0 A_JumpIfInventory("PistolMag", 1, "ReloadLoop2") Goto ReloadLoop ReloadLoop: TNT1 A 0 A_TakeInventory("clip", 1) TNT1 A 0 A_GiveInventory("PistolMag", 1) TNT1 A 0 A_JumpIfInventory("PistolMag", 6, "ReloadFinish") TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadLoop") Goto ReloadFinish ReloadLoop2: TNT1 A 0 A_TakeInventory("clip", 1) TNT1 A 0 A_GiveInventory("PistolMag", 1) TNT1 A 0 A_JumpIfInventory("PistolMag", 6, "ReloadFinish2") TNT1 A 0 A_JumpIfInventory("clip", 1, "ReloadLoop2") Goto ReloadFinish2 ReloadFinish: PPIS OOPPPQQQRRR 1 TNT1 A 0 A_PlaySound("weapons/pistol/cin", 6) PPIS SSSTTTTUUU 1 Goto Ready ReloadFinish2: PPIS OOPPPQQQRRR 1 TNT1 A 0 A_PlaySound("weapons/pistol/cin", 6) PPIS SSSTTTTUUU 1 Goto Ready DoPunch: TNT1 A 0 A_PlaySound("weapons/deselect", CHAN_AUTO) TNT1 A 0 A_TakeInventory("Punching",1) TNT1 A 0 A_PlaySound("swing") ActualPunch: TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "BerserkPunch") TNT1 A 0 A_FireCustomMissile("FistAttack",0,0,0,0) TNT1 A 3 Goto PunchDone BerserkPunch: TNT1 A 0 A_PlaySound("bsrkswing", CHAN_AUTO) TNT1 A 0 A_FireCustomMissile("BerserkFistAttack",0,0,0,0) TNT1 A 3 Goto PunchDone PunchDone: Goto Ready Flash: BRTF B 1 Bright A_Light2 BRTF A 1 Bright A_Light1 Goto LightDone Spawn: PIST A -1 Stop } } ACTOR PistolMag : Ammo { Inventory.PickupMessage "" Inventory.Amount 0 Inventory.MaxAmount 6 Ammo.BackpackAmount 0 Ammo.BackpackMaxAmount 6 Inventory.PickupSound "" }[/code][/spoiler]