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.

Reloading tutorial

Discussion in 'Programming' started by Mr Evi1, Jul 17, 2003.

  1. Mr Evi1

    Mr Evi1 New Member

    Joined:
    Mar 22, 2002
    Messages:
    336
    Likes Received:
    0
  2. Mychaeel

    Mychaeel New Member

    Joined:
    Oct 3, 2001
    Messages:
    3,830
    Likes Received:
    0
    I could imagine that people might find it more useful---or find it at all, for that matter---if you put it on the Wiki. ;)

    That aside, you shouldn't use tabs to indent anything in HTML. It may look the way you want it to in Internet Explorer, but other browsers handle tabs differently (and for that matter, technically speaking they wouldn't have to handle it any differently from normal whitespace at all as far as the HTML standards are concerned). Putting your tutorial on the Wiki would fix that problem too. :)
     
  3. Mr Evi1

    Mr Evi1 New Member

    Joined:
    Mar 22, 2002
    Messages:
    336
    Likes Received:
    0
    I'll try and get around to doing that today. EDIT: The Wiki is now one page bigger :)



    The formatting went a bit funny. I used a program called 'webcpp' to provide highlighting, and normally it seems to convert tabs to spaces, but for some reason it kept the tabs for the first lot of code.
     
    Last edited by a moderator: Jul 17, 2003
  4. Romanov

    Romanov New Member

    Joined:
    May 8, 2003
    Messages:
    86
    Likes Received:
    0
    Hi,
    This is a great tutorial but Ive got one question I dont understand why you have this in the code,

    //Ignore FireMode[1] which doesn't use any ammo.

    what if I want to use fire mode 1 as well as fire mode 0 for firing ? ie i dont want to use alt fire to do the reload as I can use the exec function you have placed there instead, this is what has stopped me from using reloading because I want to keep fire mode 1 for an alt fire and just use an exec button to do the reload.

    so the question is if i use fire mode 1 should I just remove this line from the code so i dont ignore fire mode 1?

    cheers
    Romanov

    edit: I should add that gun tute u did was also really useful there wa some stuff in there about default properties I hadnt realised :)
     
    Last edited: Jul 17, 2003
  5. Mychaeel

    Mychaeel New Member

    Joined:
    Oct 3, 2001
    Messages:
    3,830
    Likes Received:
    0
  6. Mr Evi1

    Mr Evi1 New Member

    Joined:
    Mar 22, 2002
    Messages:
    336
    Likes Received:
    0
    I should have put in a comment about that. That bit is there only if alt-fire is used for reloading. If it's done solely with the a bound key, then you can take out the HasAmmo function completely and use whatever you like for alt-fire. Note that if you wanted the alt-fire mode to use different ammo to the primary, it would require some changes.
     
  7. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0
    Hey,

    I cant get this to work.

    The bind script does not make the thing come up in the menu.
    I havent changed the code of the main script for reloading and i saved it then got my deserteagle code and made it a reloadingweapon subclass then the game and the weapon does not reload and just keeps shooting like normal. What do i have to do to get it working?

    Thanks:)
     
  8. Mychaeel

    Mychaeel New Member

    Joined:
    Oct 3, 2001
    Messages:
    3,830
    Likes Received:
    0
    The tutorial (on the Wiki) links to a page about the GUIExtraKeyBinding class that elaborates on how to get custom key bindings work. Have a look at it.
     
  9. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0
    the bar thatshows clip ammo works but it does not stop when its emty whats wrong?

    thanks
     
  10. Mr Evi1

    Mr Evi1 New Member

    Joined:
    Mar 22, 2002
    Messages:
    336
    Likes Received:
    0
    Hmmm, it seems that I forgot a very important bit: The 'AllowFire' function in the FireMode class(es) must be modified to only allow firing when there is ammo on the clip. I've added the appropriate code to the version on the Wiki. I'll update the version on my website later.
     
  11. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0
    Thanks so much mr evil that was exelent and helped alot ive been trying for ages to make my own :)
     
  12. Romanov

    Romanov New Member

    Joined:
    May 8, 2003
    Messages:
    86
    Likes Received:
    0
    quick reply but yes thnx alot its really good stuff :)
     
  13. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0
    also is there a way i could get it to reload without holding it down?
     
  14. Romanov

    Romanov New Member

    Joined:
    May 8, 2003
    Messages:
    86
    Likes Received:
    0
    quote from tutorial:

    "Bullets are inserted one at a time. If you wanted to completely fill the weapon in one go (as would be the case with most modern-style weapons) then change the bit in the InsertBullet function to ClipCount = Default.ClipCount"
     
  15. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0

    i mean when reloading insted of just pressing onece u have to load the
     
  16. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0

    i mean when reloading insted of just pressing onece u have to hold the key down for it to work how can i make it so u just press once?
     
  17. Mr Evi1

    Mr Evi1 New Member

    Joined:
    Mar 22, 2002
    Messages:
    336
    Likes Received:
    0
    It stops when you let go of the key because of the 'OnRelease' bit in the bind. To not have it stop when you let go, remove that bit, so you just have something like: E=ReloadMeNow
     
  18. joshsslade

    joshsslade New Member

    Joined:
    Jun 18, 2003
    Messages:
    37
    Likes Received:
    0

    Thanks i just wasted my time i rewrote the code:( but thanks anyway
     
  19. Dark[NSF]

    Dark[NSF] Northwest Secessionalist Forces

    Joined:
    Mar 12, 2003
    Messages:
    632
    Likes Received:
    0
    Found a small bug, if you have 2 weapons on one slot and one runs out of ammo. You can access the other weapon.
     
  20. Romanov

    Romanov New Member

    Joined:
    May 8, 2003
    Messages:
    86
    Likes Received:
    0
    Yes but only if that weapon has ammo, basically the code does Bringdown if the weapon is out of ammo which would free up the other weapon if there are 2 in that slot. You'd need to code around that.
     

Share This Page