UE2 - UT2kX Reloading Tutorial

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Gruntkiller4000

New Member
Jul 11, 2011
49
0
0
Is there any reloading/iron sights tutorial for UT-2004 because I want to add those features to my weapons. I looked at Ballistic Weapons but their code is too complicated. Any suggestions? Thanks.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
It's always complicated to a certain extent. You can try looking for tutorials, but the question is whether those will do what you had in mind.

Then again, what is iron sights? It's really just the weapon mesh's aiming direction aligned to the view direction.
 

Gruntkiller4000

New Member
Jul 11, 2011
49
0
0
Hi I have performed basic reloading (I got it's magazine ammo to show on the HUD), and firing it takes off Mag Ammo not the normal ammunition. When it gets to 0 it takes it's value off the normal ammunition and resets it back to it's normal maximum mag. The problem is, I want a delay (when) it reaches 0, so it completes the animation and Then does the calculations after. I tried ways but there's No delay! I wanted a variable to increase by one using Level.TimeSeconds, but it's not increasing.

Is there some sort of event that allows that to happen? Thanks!
 

Nathaniel3W

Member
Nov 11, 2012
48
0
6
I'm a total beginner in UDK, so take this as advice from someone who's figuring things out as he's going. If I had to program that, I would add a boolean to the firing function to check whether or not you're currently reloading, and make the function refuse to fire if reloading == True. Set the reloading boolean to True when you start reloading. I think you might be able to use SetTimer() to turn reloading back to False. Either that, or you might be able to add up the DeltaTime from tick to tick until enough time has passed. Change the ammo counter at the same time you re-enable shooting.