ironmanmine12 Posted September 30, 2021 I want to make the game feel more like a realistic FPS, so I thought I could add reloading. I already have the sprites, how could I do this? 0 Quote Share this post Link to post
Kan3 Posted September 30, 2021 So, I've never actually used this "feature", in fact, I removed or modified this feature from a custom weapon from realm667, but thanks to this, I can help you a bit. I recommend you to look directly at some custom weapon/wad that has reload mechanics. I have in example the railgun. The creator used several function to obtain the weapon to reload: first you create (in the DECORATE, I don't properly know zscript yet) a new state (for example "Reloaded"), that you will use to check if the weapon has been reloaded and it's ready to fire (using A_ReFire function and pointing to the Ready state at the end) Then, in the Fire state, you have to use the function A_CheckForReload, which uses as parameters 1) the counter calling for this function, or how many (x) projectile your weapon wants to shoot (basically) and 2) the state at which it will jump if the function hasn't been called x time yet (you won't reload as long as you have projectiles in the "magazine"). In this function you use your new "Reloaded" state. Then you play your reload animation and sound and lastly you reset the counter with the A_ResetReloadCounter. And that's it. Obviously you won't get any HUD display for the magazine or anything else here, you have to create it from scratch and, unfortunately, you will only be able to reload when you finish your "magazine", you won't get any reload key, unless, again, you set it yourself, but right now I don't know how to do it. 0 Quote Share this post Link to post
Barry Burton Posted October 1, 2021 You may find WildWeasel's tutorials very helpful: http://gunlabs.blogspot.com/2011/01/tutorials.html 2 Quote Share this post Link to post
m8f Posted October 1, 2021 Also take a look at RRWM reloading system. 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.