Panda Posted April 26, 2023 I managed to make a weapon that reloads, but even though it doesn't need to reload, if I press the reload button, it reloads again and again no matter how many times I press the button. What can I do so that it only reloads when it needs to refill ammunition, and that it has at least fired a miserable bullet to reload? Spoiler Actor WPistol_Phantom : Weapon 11025//Rename this!!! { Scale 0.75 Obituary "%o was splattered by %k pistol" Radius 20 Height 16 AttackSound "WPSTL10" // "Weapon/PistolFire" Inventory.pickupmessage "You got the Pistol" Weapon.SelectionOrder 500 Weapon.SlotNumber 2 Weapon.kickback 100 Weapon.ammotype "CLIP" Weapon.ammouse 1 Weapon.ammogive 25 States { Spawn: 3PIS E -1 Loop Ready: 3PIS A 2 A_WeaponReady(WRF_ALLOWRELOAD) 3PIS A 0 A_JumpIfInventory("PhantomReload",10,"Reload") Loop Deselect: 3PIS A 1 A_Lower Loop Select: 3PIS A 1 A_Raise Loop Fire: 3PIS A 0 A_JumpIfInventory("PhantomReload",10,"Reload") 3PIS A 0 A_TakeInventory("Waiting",10) 3PIS A 1 3PIS B 1 bright A_FireBullets(3.5, 3.5, -1, 15, "BulletPuff", FBF_NORANDOM,0,0,3,3) 3PIS CD 1 3PIS E 1 A_GiveInventory("PhantomReload",1) 3PIS A 3 //3PIS A 4 A_ReFire Goto Ready Reload: 3PIS JKLMNOPQRS 1 3PIS T 15 A_PlaySound("9MPKUP10") 3PIS T 15 A_PlaySound("9MPKUP9") 3PIS T 10 3PIS T 2 A_TakeInventory("PhantomReload",12) 3PIS T 5 3PIS SRQPONMLKJ 1 3PIS J 0 A_ReFire Goto Ready } } actor PhantomReload : Inventory { inventory.amount 0 inventory.maxamount 10 +INVENTORY.INVBAR } 0 Quote Share this post Link to post
Kan3 Posted April 26, 2023 Because you're not checking if you have ammo left, the game doesn't automatically know when you run out of ammo, so, as long as the weapon is "ready", if you press the reload key, you'll be able to reload. I suggest you to check this tutorial, even if outdated, otherwise, I'll show you how I did it. 0 Quote Share this post Link to post
Panda Posted April 27, 2023 19 hours ago, Kan3 said: Because you're not checking if you have ammo left, the game doesn't automatically know when you run out of ammo, so, as long as the weapon is "ready", if you press the reload key, you'll be able to reload. I suggest you to check this tutorial, even if outdated, otherwise, I'll show you how I did it. Thank you very much, it helped me a lot! 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.