1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

UE2 - UT2kX Reloading Tutorial

Discussion in 'Programming' started by Gruntkiller4000, Apr 1, 2012.

  1. Gruntkiller4000

    Gruntkiller4000 New Member

    Joined:
    Jul 11, 2011
    Messages:
    49
    Likes Received:
    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.
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    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.
     
  3. Gruntkiller4000

    Gruntkiller4000 New Member

    Joined:
    Jul 11, 2011
    Messages:
    49
    Likes Received:
    0
    Ok thank you I will look for some unreal script tutorials first then go to do some reloading.
     
  4. Gruntkiller4000

    Gruntkiller4000 New Member

    Joined:
    Jul 11, 2011
    Messages:
    49
    Likes Received:
    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!
     
  5. Nathaniel3W

    Nathaniel3W New Member

    Joined:
    Nov 11, 2012
    Messages:
    44
    Likes Received:
    0
    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.
     

Share This Page