Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Symbiote

Real Reload

Recommended Posts

Symbiote

WHAT IT DOES
More realistic reload model!
- Switching weapons no longer refills the gun's clip.
- Reloading discards the remaining ammo in the clip (except for shotguns that don't use magazines).

HOW TO INSTALL
This is a script for HazardX's .NET scripthook. Just place RealReload.cs and RealReload.ini into the 'scripts' folder of the .NET scripthook.
Note: If you don't use the R key for reloading, you'll have to change the key setting in RealReload.ini.

----------------


Download v1.3.2

 

Last updated January 15, 2013

 

----------------

KNOWN BUGS
- Doesn't work with gamepads, unfortunately.
- When you switch weapons, your ammo will briefly look like the clip was refilled. As soon as you can aim the gun, the ammo numbers will revert back to what they were when you last used the gun.
- The sawn-off shotgun in TLAD shouldn't be affected, but I can't test it since I don't have TLAD.

----------------

CHANGE LOG
v1.3.2 — January 15, 2013
- Fixed bug where switching weapons during a reload caused a chain of reloads until all ammo disappeared

v1.3.1 — November 15, 2012
- Added INI setting for whether remaining ammo in clip is lost when you reload
- Very minor code cleanup

v1.3 — November 6, 2011
- Now you must change the default key in the INI if you don't use R (reverted from v1.2)
- Fixed bug where the reload key would be undetected if pressed too fast
- Fixed bug where switching weapons would refill the gun's clip
- Fixed bug where trying to reload with zero extra ammo would empty the clip
- You can now cancel a reload by switching weapons before it's complete
- Converted script from VB.NET to C#

v1.2 — May 24, 2011
- Bug fixed - no longer necessary to edit the code for reload keys other than R
- Bug maybe fixed - added TLAD sawn-off shotgun to unaffected weapons

v1.1 — April 22, 2011
- Bug fixed - no longer subtracts a whole clip of ammo when you try to reload with a full clip
- Bug fixed - no longer subtracts ammo multiple times when you press R multiple times
- Added info in script on how to edit for a reload key other than R

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
lolleroz

HOLY sh*t I LOVE U OMG OMG OMG OMG MARRY ME

 

I was about to request such mod on PM to BR_Goianiense having idea how to build such script, although I was pretty sure it's impossible. DUDEILOVEUOMG

Share this post


Link to post
Share on other sites
metacortex

Damn nice work there sir, I like it a lot. Source is short but quite effective tounge.gif

cheers

Share this post


Link to post
Share on other sites
Symbiote

I had a feeling there were other people out there who wanted this feature. smile.gif

 

Edit: Heads up, I uploaded a new version with some stupid bugs fixed.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
HippieCommunist

great job! biggrin.gificon14.gif

 

Share this post


Link to post
Share on other sites
hkboondoggle

Nice & neat indeed, good work!

Hope it will be compatible with gamepads in later version.

Share this post


Link to post
Share on other sites
vava720

I download the file, and I have "Real Raload v1.1" without extension (with the extension .1) so I can't extract it (I think this is an archive ?).

 

I've tried to put ".rar" at the end, ".zip", and ".7z" but nothing worked.

Help please ! I'd like to use your fantastic mod !

Share this post


Link to post
Share on other sites
Symbiote

The file should have a .vb extension. Thanks for letting me know it was missing! It's fixed now. (How many people downloaded the file without the extension? confused.gif)

 

This problem affected some of my other mods too, since I didn't realize renaming the files on Mediafire changed the actual file names...

Share this post


Link to post
Share on other sites
vava720

Ok thank you for telling me ! I try your mod right now biggrin.gif

Share this post


Link to post
Share on other sites
ikt

I might have another approach to your 'problem': Instead of checking for a key press, you could also check for the reloading animation to be active. I found HasReloadedWithMotionControl in the dirty, maybe you--

wait, that's the PS3 reloading with the motion controller, isn't it? Well crap. tounge.gif

 

It's awesome anyway. wink.gif

Share this post


Link to post
Share on other sites
Symbiote

On the gtamodding.com list of animations, it looks like there are nine different reload animations for the various weapons. I don't think I want to check for each of those animations all the time...

 

I tried detecting GameKey.Reload, which seems like it would be perfect, but then the script just stopped working altogether. I never figured out why. bored.gif

Share this post


Link to post
Share on other sites
ikt

Can't you use or (||) to check for the reloading anims?

Share this post


Link to post
Share on other sites
Symbiote

New version in first post! Thanks to ikt for motivating me to work on this. biggrin.gif (I got the GameKey.Reload method working... It was really simple.)

 

Changes in v1.2

- Bug fixed - no longer necessary to edit the code for reload keys other than R

- Bug maybe fixed - gamepad support added?

- Bug maybe fixed - added TLAD sawn-off shotgun to unaffected weapons

 

If you have TLAD and/or a gamepad, please let me know if those bugs are fixed!

Share this post


Link to post
Share on other sites
ikt

Tested it with gamepad, ammo doesn't substract. I'm using the x360 emu for the controller. It does work with kb/mouse, so that's working smile.gif

Share this post


Link to post
Share on other sites
Fitfit

Really good !

You should try to do something about " - When you switch weapons, the game refills the gun's clip using your stored ammo, if you have any. "

It would be perfect then ^^

 

 

Share this post


Link to post
Share on other sites
TriXigT

Hi, does not seem to work on 1.0.4.0 smile.gif

Share this post


Link to post
Share on other sites
Symbiote

I'm using 1.0.4.0 and it works... Are you using a gamepad, perhaps?

Share this post


Link to post
Share on other sites
TriXigT
I'm using 1.0.4.0 and it works... Are you using a gamepad, perhaps?

No I'm not, I've placed the .vb script inside the "scripts"-folder as instructed - I can remove some of my other scripts to see if this one is working tomorrow.. I have contact missions, car store, ragdoll by pain(hippiec.) and first person scripts running. There may be an incompatibility or something!

 

Is there any way to test/see if a script is loaded and executed without errors in GTA IV?

 

(no gamepad)

Share this post


Link to post
Share on other sites
Symbiote

I think those are all ASI scripts. Are you sure you have the .NET scripthook? Look for a file called ScriptHookDotNet.log, and if it's there, see if it has any error messages.

Share this post


Link to post
Share on other sites
TriXigT

EDIT: Fixed the script!

 

I checked my log and it occurred to me that the tlad shotgun isn't present in my game as I'm only on IV - so I simply removed that line.. Here's the edited code:

 

 

Imports SystemImports System.Windows.FormsImports GTA' More realistic reload model. Discarding a clip discards the remaining ammo in the clip.' Does not apply to shotguns from vanilla GTA4. I don't know about EFLC.Public Class RealReload   Inherits Script      Dim pc As ped = Player.Character   Private Sub RealReload_KeyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown       If Game.isGameKeyPressed(GameKey.Reload) _       AndAlso pc.Weapons.Current.AmmoInClip < pc.Weapons.Current.MaxAmmoInClip _       AndAlso pc.Weapons.Current <> Weapon.Shotgun_Basic _       AndAlso pc.Weapons.Current <> Weapon.Shotgun_Baretta Then           pc.Weapons.Current.AmmoInClip = 0       End If   End SubEnd Class

 

 

I'm only coding in java (for android, as a note) so I don't have any experience in the language used here =)

 

Improvements to be done > if there is no more ammo except in the clip, the ammo in the shouldn't be affected by pressing R - make the current ammo condition of a weapon not be affected by changing the gun, it's very unrealistic.. I have a clue about how this could be done, but my experience is very limited outside Java confused.gif

Edited by TriXigT

Share this post


Link to post
Share on other sites
Symbiote

 

The log said that the tlad shotgun wasn't found and therefore the script failed, so I simply removed that line - although a new error says "an identifier is expected"..

Hm, I wonder why the TLAD shotgun couldn't be found. Are you using the latest version of the scripthook? (v1.7.1.7)

 

Anyway, you can fix the new error by deleting the _ before "Then". So it should be:

 

AndAlso pc.Weapons.Current <> Weapon.Shotgun_Baretta Then

 

Share this post


Link to post
Share on other sites
TriXigT
The log said that the tlad shotgun wasn't found and therefore the script failed, so I simply removed that line - although a new error says "an identifier is expected"..

Hm, I wonder why the TLAD shotgun couldn't be found. Are you using the latest version of the scripthook? (v1.7.1.7)

 

Anyway, you can fix the new error by deleting the _ before "Then". So it should be:

 

AndAlso pc.Weapons.Current <> Weapon.Shotgun_Baretta Then

 

I edited my post right about the moment you posted your answer tounge.gif

 

Anyway; According to the log I'm using this version "ScriptHookDotNet v0.893 BETA", I believe it's the only one working with 1.0.4.0?

 

Yeah I compared your script with my edited one and found the thing with the " _ " - thx for the help anyway! biggrin.gif

 

When I edited my post yesterday I added some suggestions to it, I'll paste them here:

Improvements to be done > if there is no more ammo except the ammo in the clip, the ammo in the shouldn't be affected by pressing R - make the current ammo condition of a weapon not be affected by changing the gun, it's very unrealistic.. I have a clue about how the later could be done, but my experience is very limited outside Java confused.gif

Share this post


Link to post
Share on other sites
Symbiote

 

Anyway; According to the log I'm using this version "ScriptHookDotNet v0.893 BETA", I believe it's the only one working with 1.0.4.0?

v0.893 is quite old! I'm using the latest scripthook with patch 1.0.4.0. And I don't have EFLC, but the TLAD shotgun doesn't break the script for me.

 

 

Improvements to be done > if there is no more ammo except the ammo in the clip, the ammo in the shouldn't be affected by pressing R

Wow, you're right. I could've sworn I checked for that, but looking at the code, obviously I didn't. You can just add this line to the list of conditions:

 

AndAlso pc.Weapons.Current.AmmoInClip < pc.Weapons.Current.Ammo _

 

 

 

make the current ammo condition of a weapon not be affected by changing the gun, it's very unrealistic.. I have a clue about how the later could be done, but my experience is very limited outside Java confused.gif

I agree, but I've been reluctant to make this script much bigger. I like it tiny. tounge.gif

 

The best way I can think of to solve that problem would be to keep a list of all previously selected weapons, as well as a list of how much ammo they each had before switching weapons. Then restore the ammo amount if they switch back to that weapon. Maybe there's a simpler way?

Share this post


Link to post
Share on other sites
Symbiote

 

make the current ammo condition of a weapon not be affected by changing the gun, it's very unrealistic.. I have a clue about how the later could be done, but my experience is very limited outside Java confused.gif

I agree, but I've been reluctant to make this script much bigger. I like it tiny. tounge.gif

 

The best way I can think of to solve that problem would be to keep a list of all previously selected weapons, as well as a list of how much ammo they each had before switching weapons. Then restore the ammo amount if they switch back to that weapon. Maybe there's a simpler way?

So I did this, and the script is no longer tiny. Update is in the first post.

 

Changes in v1.3

- Now you must change the default key in the INI if you don't use R (reverted from v1.2)

- Fixed bug where the reload key would be undetected if pressed too fast

- Fixed bug where switching weapons would refill the gun's clip

- Fixed bug where trying to reload with zero extra ammo would empty the clip

- You can now cancel a reload by switching weapons before it's complete

- Converted script from VB.NET to C#

 

New bug

- When you switch weapons, your ammo will briefly look like the clip was refilled. As soon as you can aim the gun, the ammo numbers will revert back to what they were when you last used the gun.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.