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

Weapon Weight

Recommended Posts

Symbiote

WeaponWeight_DuffelBag.pngWeaponWeight_Adrenaline.png

WHAT IT DOES
Slowed Movement
This script decreases your speed on foot, depending on the weapons, ammo, and cash you're carrying. (All speed penalties can be tweaked.)
Hurrying
Holding ALT increases movement speed by 20%. Doing so while sprinting uses Adrenaline, shown as a white bar under the radar. (This can be tweaked or disabled.)
Weapon Bag
Large amounts of cash and all weapons except the knife and pistols are stored in a backpack or duffel bag, not in your magic pockets. (This can be tweaked or disabled.)
Weapon Removal
Pressing * on the numpad drops the current weapon permanently. While unarmed, hold PageDown and press * to remove armor. (This can be disabled.)

HOW TO INSTALL
This is a script for HazardX's .NET scripthook. Just place the files in the 'scripts' folder of the .NET scripthook.

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


Download v1.2.8

 

Last updated October 28, 2012


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

TIPS
- Tweak the settings in the INI file to suit your preferences.
- Carrying lots of guns and ammo can have a major effect on your speed. Drop weapons you don't need.
- I recommend using my Weapon Storage mod if you want to get rid of weapons without losing them forever.
- Having 1 armor affects your speed the same as 100 armor. When your armor gets low, it might be a good idea to just remove it.
- To avoid being slowed down too much by your cash, use my Bank Account mod to store money at ATMs. Or set the cash speed penalty to 0.0.
- For realism, I recommend editing your WeaponInfo.xml file and decreasing the max ammo for every weapon to something realistic.
- Adrenaline recharges more slowly when you're moving fast.
- After the "MaxTotalPenalty" is reached, additional weight just makes the hurry button less effective, until hurrying has no effect.

KNOWN BUGS
- Unfortunately, you can't get weapons back after dropping them, due to script limitations. See this post for an alternate (sometimes buggy) version that I use, which allows dropped weapons to be picked back up.
- Melee weapons disappear when dropped, instead of falling to the ground.

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


CHANGE LOG
v1.2.8 — October 28, 2012
- When bags are unavailable for the current player model, they are disabled to prevent errors.
- Fixed bug where OtherMeleeBag INI setting applied to all melee weapons.

v1.2.7 — October 23, 2012
- Added support for non-vanilla thrown/melee weapons (INI settings OtherThrownPenalty, OtherMeleePenalty, OtherMeleeBag).
- Fixed bug where grenades slowed you down much more than intended.

v1.2.6 hotfix 2 — September 29, 2012
- Fixed bug where cash never gave you a bag.
- Very minor optimization when loading.

v1.2.6 hotfix — September 3, 2012
- Fixed constant player animation twitching caused by updating the bag too often.

v1.2.6 — September 3, 2012
- Added INI settings for bag behavior.
- Fixed incorrect setting in INI file (was RemoveArmorModifier instead of RemoveArmorModifierKey).
- Renamed AdrenRechargePerSec INI setting to AdrenRegenPerSec.
- Code cleanup.

v1.2.5 — September 1, 2012
- Ammo is measured per round instead of per clip.
- Fixed bug where sniper rifles and heavy weapons wouldn't give you a duffel bag.
- Fixed bug where dropped melee weapons weren't removed from your inventory.
- Minor optimization and significant cleanup.

v1.2.4 — December 31, 2011
- Added readme.
- Fixed bug where sprinting while the sprint key wasn't pressed wouldn't drain Adrenaline properly.
- Fixed bug where the cell phone could be dropped like a weapon.
- Minor optimization and cleanup.

v1.2.3 — September 27, 2011
- Added MaxTotalPenalty INI setting, default is 30%. This prevents super-slow-mo movement.
- Removed AdrenBarHeight INI setting. The bar now approximately matches the health/armor bar size.
- Fixed bug where a very high total penalty would make you slide around really fast.
- Minor optimization.

v1.2.2 — September 6, 2011
- Cash is now carried in a backpack if you have at least $65,000, a duffel bag for at least $500,000.
- Cash also has a speed penalty now, 0.003% per $1,000. Adds up if you carry a lot of money.

v1.2.1 — August 8, 2011
- Adrenaline is now shown as a bar under the radar.
- Adrenaline now recharges faster when not running.
- Minor fixes and optimization.
- Changed version numbering scheme.

v1.2 — May 6, 2011
- Compiled script and included INI file for settings.
- Incorporated my "Hurry Up" script into the mod. Holding Alt increases movement speed, and while sprinting it drains adrenaline. Without adrenaline, sprinting speed is normal.
- Changed default drop-weapon key to * on the numpad.
- Added "ModifierKey" (PageDown by default), which has to be held down to remove armor, to avoid removing accidentally.
- SMG, grenades, and molotovs are stored in backpack instead of duffel bag.
- Misc. fixes

v1.1b — April 26, 2011
- Removed guns now fall to the ground instead of disappearing (melee weapons still just disappear, all weapons still can't be picked up again)
- Pressing the remove weapon key while unarmed will remove armor

v1.1 — April 26, 2011
- Added ability to remove weapons with Y

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
HippieCommunist

NICE!

 

keep it up dude!!

cookie.gifcookie.gifcookie.gifcookie.gif

Share this post


Link to post
Share on other sites
lolleroz

'Conflicts with my Hurry Up script. I use this and Hurry Up merged together into one script, so if anyone wants that I can post it.'

Yeah, post it please.

 

Great job, matey. Will prove as an useful realism thingy, long time ago I tried to trunk mod, but having sh*tload of weps didn't slow you down at all, and this is where you come in. Thanks alot for the mod.

Share this post


Link to post
Share on other sites
Symbiote

 

'Conflicts with my Hurry Up script. I use this and Hurry Up merged together into one script, so if anyone wants that I can post it.'

Yeah, post it please.

Ask and ye shall receive! biggrin.gif

 

http://www.mediafire.com/?ma284z8uz9118mg

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
lolleroz

Thanks alot, bro.

One thing by the way...in future, you need to make a script where Niko can dump the weapons tounge.gif It will be useful for two things - first, for dropping the weapons you don't need which slow u down, and second, for roleplaying. Getting rid of the gun after you kill someone etc

Share this post


Link to post
Share on other sites
ikt

Maybe a realistic weapon carrying mod in combination of this? 2 main weapons, one on your back, a knife and pistol. Heavier penalties for all weapons.

 

Dropping weapons like in Crysis 1. (Shooting all your ammo to get rid of that shotgun you never use anyway isn't the most silent approach to dump weapons)

 

 

Share this post


Link to post
Share on other sites
Symbiote

 

Maybe a realistic weapon carrying mod in combination of this? 2 main weapons, one on your back, a knife and pistol. Heavier penalties for all weapons.

Well, what I did for my own game is edit WeaponInfo.xml (in common\data) so that the sniper rifles, assault rifles, and RPG all use the same slot.

 

To do that, change the "slot" of a weapon to the same slot as another weapon. For example, change the sniper slot from "SNIPER" to "RIFLE" to make snipers use the same slot as assault rifles.

 

The problem with this method is that you can't have two generic 'main weapon' slots that accept any main weapon. Instead, one slot accepts some weapons and the other slot accepts different weapons. I'll try to figure out a better way to do this...

 

And then for heavier penalties, you can just open up the script file and change the values for any of the penalties.

 

 

One thing by the way...in future, you need to make a script where Niko can dump the weapons tounge.gif It will be useful for two things - first, for dropping the weapons you don't need which slow u down, and second, for roleplaying. Getting rid of the gun after you kill someone etc
Dropping weapons like in Crysis 1. (Shooting all your ammo to get rid of that shotgun you never use anyway isn't the most silent approach to dump weapons)

I did try to include weapon dropping, but it always dropped the weapon right where I was standing, forcing me to pick it up again immediately. The other solutions I tried were to just 'remove' the weapon instead of dropping it, or set the weapon ammo to 0, but then you can't pick it back up.

 

I'll keep thinking about it, and maybe I'll come up with a solution. Any programmers: advice is welcome!

Share this post


Link to post
Share on other sites
lolleroz

How about for now you include script where you can dump the weapons (setting the ammo to 0) and in future you'll make something better out? tounge.gif

Share this post


Link to post
Share on other sites
ikt
Maybe a realistic weapon carrying mod in combination of this? 2 main weapons, one on your back, a knife and pistol. Heavier penalties for all weapons.

Well, what I did for my own game is edit WeaponInfo.xml (in common\data) so that the sniper rifles, assault rifles, and RPG all use the same slot.

 

To do that, change the "slot" of a weapon to the same slot as another weapon. For example, change the sniper slot from "SNIPER" to "RIFLE" to make snipers use the same slot as assault rifles.

 

The problem with this method is that you can't have two generic 'main weapon' slots that accept any main weapon. Instead, one slot accepts some weapons and the other slot accepts different weapons. I'll try to figure out a better way to do this...

 

And then for heavier penalties, you can just open up the script file and change the values for any of the penalties.

 

 

One thing by the way...in future, you need to make a script where Niko can dump the weapons tounge.gif It will be useful for two things - first, for dropping the weapons you don't need which slow u down, and second, for roleplaying. Getting rid of the gun after you kill someone etc
Dropping weapons like in Crysis 1. (Shooting all your ammo to get rid of that shotgun you never use anyway isn't the most silent approach to dump weapons)

I did try to include weapon dropping, but it always dropped the weapon right where I was standing, forcing me to pick it up again immediately. The other solutions I tried were to just 'remove' the weapon instead of dropping it, or set the weapon ammo to 0, but then you can't pick it back up.

 

I'll keep thinking about it, and maybe I'll come up with a solution. Any programmers: advice is welcome!

Could you maybe add force to it for it to fly away?

Remove ammo for when player is in range, if out of range, add ammo again.

 

Although I don't know if you can add ammo to a dropped weapon, since I've not seen anything in Scripting.h that relates to that.

Share this post


Link to post
Share on other sites
Symbiote

I found that dropping the weapon always had a chance to fire on hitting the ground, which is instant death with a rocket launcher. suicidal.gif The native function "STOP_PED_WEAPON_FIRING_WHEN_DROPPED" didn't do anything, and even when ammo is set to 0 before dropping, they can still fire.

 

So to implement it, I ended up just removing the weapons, which sucks. The weapon disappears into thin air. But it's better than having to shoot all your ammo, so I've updated the files in the first post.

Share this post


Link to post
Share on other sites
ikt

 

I found that dropping the weapon always had a chance to fire on hitting the ground, which is instant death with a rocket launcher. suicidal.gif The native function "STOP_PED_WEAPON_FIRING_WHEN_DROPPED" didn't do anything, and even when ammo is set to 0 before dropping, they can still fire.

 

So to implement it, I ended up just removing the weapons, which sucks. The weapon disappears into thin air. But it's better than having to shoot all your ammo, so I've updated the files in the first post.

Have you tried ForceCharToDropWeapon(Ped ped)?

Maybe that's the one used when you empty your guns.

 

Also try emptying the ammo in the clip.

Edited by ikt

Share this post


Link to post
Share on other sites
Symbiote

Good call on the clip ammo, that fixed the gun firing problem. So now I've gotten it to where you can drop weapons (except melee, those still force you to pick them up). But you still can't pick them up again.

 

I started looking into creating pickups via native functions... Does anyone know how that works? I found some that look useful, like CREATE_PICKUP_WITH_AMMO, but I can't figure out how to use them.

Share this post


Link to post
Share on other sites
lolleroz

We already have dumping weapons, that's good.

Now, you need to make a script where we will be able to store the guns in trunk of our car. Someone has already done it, but it was...not too good. The script remembered the ammo in your guns and the guns you've had, though, so when you took the guns out of the trunk you got all of them back with proper ammo.

Share this post


Link to post
Share on other sites
Prof_Farnsworth

Sweet work Ameoba. I especially like the duffel bag. Nice ambient touch.

 

Off the top of my head, here is what I would try for dropping the weapon.

 

1. When weapon is dropped, set player weapon of same slot to different type of weapon(i.e. combat and regular shotgun). When you carry a different type, the game prompts you to swap the replacement.

2. Apply force to weapon (ideally forward) to act as weapon throw, while also setting player weapon select to an adjacent slot (lower or higher, can't remember default in game).

3. Once player is "x" distance away. Set new weapon ammo to 0 and it should just disappear, allowing you to pick up your dropped gun again.

 

Doing this, you should not need to set the ammo to 0 each time for weapon dropped.

 

Worst case is if the player switches back to their previous weapon before being out of range, they will see their weapon disappear (Though the range would be small, so less likely). Also, this will not work for the rocket launcher, as I am fairly certain there is only one type of those.

 

Great work on the mod!

Edited by Prof_Farnsworth

Share this post


Link to post
Share on other sites
lolleroz
Sweet work Ameoba. I especially like the duffel bag. Nice ambient touch.

 

Off the top of my head, here is what I would try for dropping the weapon.

 

1. When weapon is dropped, set player weapon of same slot to different type of weapon(i.e. combat and regular shotgun). When you carry a different type, the game prompts you to swap the replacement.

2. Apply force to weapon (ideally forward) to act as weapon throw, while also setting player weapon select to an adjacent slot (lower or higher, can't remember default in game).

3. Once player is "x" distance away. Set new weapon ammo to 0 and it should just disappear, allowing you to pick up your dropped gun again.

 

Worst case is if the player switches back to their previous weapon before being out of range, they will see their weapon disappear. Also, this will not work for the rocket launcher, as I am fairly certain there is only one type of those.

 

Great work on the mod!

The point is, if Amoeba will make the dumped weapon change to pickup, the ammo on it will change to one clip anyway (like 30 instead of 300) so it doesn't make sense.

Share this post


Link to post
Share on other sites
ikt

CreatePickupWithAmmo(eModel model, ePickupType pickupType, u32 unknown, f32 x, f32 y, f32 z, Pickup *pPickup)

 

eModel is character models or object models, so I assumt you get the niko skin for that

PickupType: isn;t in enums. try using Ammo or numbers. In the worst case this only handles picked up objects like cans, but i doubt this since it has ammo.

u32 unknown: don't know for sure, but this might be ammo (because of u32, so this is how many ammo it will have on pickup)

x, y, z are the position, I think you know what this does.

*pPickup: don't know, but it might be data that could be saved, maybe you won't need it. just try putting &bla there and see if it doesn't return errors.

 

I suggest you just try it and see what the error messages say, those saved me a lot of times already tounge.gif

Share this post


Link to post
Share on other sites
Symbiote

Alright guys, I had to write a couple essays for school but now I have some time to work on this...

 

While I was experimenting with native functions, I discovered a much easier function:

Pickup.CreateWeaponPickup(Vector3 position, GTA.Weapon weapon, int ammo, Vector3 rotation).

 

So using that I got it to where I can create a pickup of the appropriate weapon with the appropriate amount of ammo. But my new problems are: the pickup is not physics-enabled, and I don't know how to check whether the pickup will be created inside a wall or another object.

 

Can anyone help with these issues?

Share this post


Link to post
Share on other sites
ikt

After the weapon is created, add force to it (just a very little bit) and hope the weapon will get launched outwards a building.

 

By the way, what do you mean with non-native functions?

Share this post


Link to post
Share on other sites
Symbiote

 

After the weapon is created, add force to it (just a very little bit) and hope the weapon will get launched outwards a building.

The pickups don't seem to be objects, just models without physics, so I can't apply force to them.

 

 

By the way, what do you mean with non-native functions?

To invoke a native function, you do this: GTA.Native.Function.Call("CREATE_WEAPON_PICKUP", params).

 

But there is also a comparable function in the Pickup class, invoked like this: GTA.Pickup.CreateWeaponPickup(params).

 

I couldn't get the native function working, but the Pickup one works, except for the physics.

Share this post


Link to post
Share on other sites
Symbiote

Sorry for the double post...

 

I realized that pickups get saved in the save game... This means that if I create a pickup inside a wall or something, and I can't get to it, there's no way to get rid of it. I made a 'cleanup' function to delete pickups after a length of time, but that can't guarantee that they will all be deleted before the game is saved.

 

Does anyone know of a way to trigger cleanup code right before saving?

Share this post


Link to post
Share on other sites
ikt
Sorry for the double post...

 

I realized that pickups get saved in the save game... This means that if I create a pickup inside a wall or something, and I can't get to it, there's no way to get rid of it. I made a 'cleanup' function to delete pickups after a length of time, but that can't guarantee that they will all be deleted before the game is saved.

 

Does anyone know of a way to trigger cleanup code right before saving?

IsAutoSaveInProgress()

 

This is probably the same R* uses for when missions are over, and to remove wanted level and such.

Share this post


Link to post
Share on other sites
Symbiote

New version in first post!

 

Changes in v1.2:

- Compiled script and included INI file for settings.

- Incorporated my "Hurry Up" script into the mod. Holding Alt increases movement speed, and while sprinting it drains adrenaline. Without adrenaline, sprinting speed is normal.

- Changed default drop-weapon key to * on the numpad.

- Added "ModifierKey" (PageDown by default), which has to be held down to remove armor, to avoid removing accidentally.

- SMG, grenades, and molotovs are stored in backpack instead of duffel bag.

- Misc. fixes

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
Symbiote

New version in first post. I updated my Hurry Up mod, which is included in this mod. Also fixed some things.

 

Changes in v1.2.1

- Adrenaline is now shown as a bar under the radar.

- Adrenaline now recharges faster when not running.

- Minor fixes and optimization.

- Changed version numbering scheme.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
ricardo8086

 

Sorry for the double post...

 

I realized that pickups get saved in the save game... This means that if I create a pickup inside a wall or something, and I can't get to it, there's no way to get rid of it. I made a 'cleanup' function to delete pickups after a length of time, but that can't guarantee that they will all be deleted before the game is saved.

 

Does anyone know of a way to trigger cleanup code right before saving?

IsAutoSaveInProgress()

 

This is probably the same R* uses for when missions are over, and to remove wanted level and such.

Where did you find this function IsAutoSaveInProgress() ? I want to use it, but couldn't find it.

 

Excelent mod, by the way, AngryAmoeba!

Share this post


Link to post
Share on other sites
janusantsky

hello i have a bug when i use this mod luis go superslow or superfast , if someone has already that and know how to fix it,

maybe the reason is that i use a lot of other mod but maybe someone has the response, thanks

Share this post


Link to post
Share on other sites
Symbiote

When does he go super-slow, and when does he go super-fast?

 

And does it happen even when carrying only default weapons (no added weapons)?

Share this post


Link to post
Share on other sites
janusantsky

i think this is with added weapons when i spawn with trainer, but i have a question is there a script to carry medikit, it would be cool cause i'm playing with a bigger difficulty or a script to heal with a small animation

Share this post


Link to post
Share on other sites
lolleroz

hey man, sorry for dissapointing you while we were testing the script, i had some IRL probs and stopped playing IV for a while, but I see you did a great job, nice work!

Share this post


Link to post
Share on other sites
Symbiote

Small update in first post.

 

 

v1.2.2

- Cash is now carried in a backpack if you have at least $65,000, a duffel bag for at least $500,000.

- Cash also has a speed penalty now, 0.003% per $1,000. Adds up if you carry a lot of money.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
Symbiote

New update in first post. This is mainly a bug fix update, but the alternate version received some significant changes behind the scenes.

 

 

Changes in v1.2.3

- Added MaxTotalPenalty INI setting, default is 30%. This prevents super-slow-mo movement.

- Removed AdrenBarHeight INI setting. The bar now approximately matches the health/armor bar size.

- Fixed bug where a total penalty of over 100% would make you slide around really fast.

- Minor optimization.

Edited by AngryAmoeba

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.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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