IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules Attention:

The Mod Showroom is only for posting previews/downloads of completed or near finished mods.
All help topics should be posted in the Editing Discussion forums. Help topics and mod requests posted here will be locked or binned. Thank you.
GTAGarage.com : Free mod hosting, attach your files and screenshots to your topics
GTAModding.com : A wiki for everything related to GTA modding, including documentation and tutorials

Pages: (3) [1] 2 3   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 Weapon Weight

 realism mod: guns and ammo slow you down
 
AngryAmoeba  
Posted: Monday, Apr 25 2011, 06:32
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



user posted image user posted image

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.

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


v1.2.8 - last updated October 28, 2012

ADF.LY DOWNLOAD
If you'd like to support me and my mods,
please take 5 seconds and use this download link!

NORMAL DOWNLOAD
If you're in a hurry, use this one.


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

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

This post has been edited by AngryAmoeba on Sunday, Oct 28 2012, 08:54

O This mod is hosted at GTAGarage.com

Screenshots:
GTAGarage screenshot GTAGarage screenshot GTAGarage screenshot

Downloads:
Download Weapon Weight v1.2.8 - 0.01MB, uploaded on Oct 28 2012, downloaded 228 times

Click here to view the mod at GTAGarage

PM
  Top
 

 
HippieCommunist  
Posted: Monday, Apr 25 2011, 07:00
Quote Post


PWR2DPPL
Group Icon
Group: Members
Joined: Jan 25, 2003

ussr.gif

XXXXX



NICE!

keep it up dude!!
cookie.gif cookie.gif cookie.gif cookie.gif
Users WebsitePMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
lolleroz  
Posted: Monday, Apr 25 2011, 08:05
Quote Post


Playa
Group Icon
Group: Members
Joined: Jul 29, 2010

pl.gif

XXXXX



'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.
PM
  Top
 

 
AngryAmoeba  
Posted: Monday, Apr 25 2011, 08:26
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



QUOTE (lolleroz @ Apr 25 2011, 02:05)
'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

This post has been edited by AngryAmoeba on Tuesday, Apr 26 2011, 11:31
PM
  Top
 

 
lolleroz  
Posted: Monday, Apr 25 2011, 08:47
Quote Post


Playa
Group Icon
Group: Members
Joined: Jul 29, 2010

pl.gif

XXXXX



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
PM
  Top
 

 
ikt  
Posted: Monday, Apr 25 2011, 12:07
Quote Post


 
Group Icon
Group: Members
Joined: Oct 2, 2006

XXXXX



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)

PM
  Top
 

 
AngryAmoeba  
Posted: Monday, Apr 25 2011, 23:26
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



QUOTE
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.

QUOTE
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
QUOTE
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!
PM
  Top
 

 
lolleroz  
Posted: Monday, Apr 25 2011, 23:43
Quote Post


Playa
Group Icon
Group: Members
Joined: Jul 29, 2010

pl.gif

XXXXX



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
PM
  Top
 

 
ikt  
Posted: Tuesday, Apr 26 2011, 06:07
Quote Post


 
Group Icon
Group: Members
Joined: Oct 2, 2006

XXXXX



QUOTE (AngryAmoeba @ Apr 26 2011, 01:26)
QUOTE
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.

QUOTE
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
QUOTE
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.
PM
  Top
 

 
AngryAmoeba  
Posted: Tuesday, Apr 26 2011, 09:15
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



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.
PM
  Top
 

 
ikt  
Posted: Tuesday, Apr 26 2011, 09:47
Quote Post


 
Group Icon
Group: Members
Joined: Oct 2, 2006

XXXXX



QUOTE (AngryAmoeba @ Apr 26 2011, 11:15)
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.

This post has been edited by ikt on Tuesday, Apr 26 2011, 09:50
PM
  Top
 

 
AngryAmoeba  
Posted: Tuesday, Apr 26 2011, 11:19
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



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.
PM
  Top
 

 
lolleroz  
Posted: Tuesday, Apr 26 2011, 12:27
Quote Post


Playa
Group Icon
Group: Members
Joined: Jul 29, 2010

pl.gif

XXXXX



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.
PM
  Top
 

 
Prof_Farnsworth  
Posted: Tuesday, Apr 26 2011, 13:04
Quote Post


Ambient Modder
Group Icon
Group: Members
Joined: Feb 25, 2011

XXXXX



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!

This post has been edited by Prof_Farnsworth on Tuesday, Apr 26 2011, 13:06
PM
  Top
 

 
lolleroz  
Posted: Tuesday, Apr 26 2011, 13:06
Quote Post


Playa
Group Icon
Group: Members
Joined: Jul 29, 2010

pl.gif

XXXXX



QUOTE (Prof_Farnsworth @ Apr 26 2011, 13:04)
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.
PM
  Top
 

 
ikt  
Posted: Tuesday, Apr 26 2011, 14:28
Quote Post


 
Group Icon
Group: Members
Joined: Oct 2, 2006

XXXXX



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
PM
  Top
 

 
AngryAmoeba  
Posted: Thursday, Apr 28 2011, 06:55
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



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?
PM
  Top
 

 
ikt  
Posted: Thursday, Apr 28 2011, 10:26
Quote Post


 
Group Icon
Group: Members
Joined: Oct 2, 2006

XXXXX



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?
PM
  Top
 

 
AngryAmoeba  
Posted: Thursday, Apr 28 2011, 12:31
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



QUOTE (ikt @ Apr 28 2011, 04:26)
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.

QUOTE
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.
PM
  Top
 

 
AngryAmoeba  
Posted: Friday, Apr 29 2011, 02:38
Quote Post


Symbiont
Group Icon
Group: Members
Joined: Jan 12, 2009

us.gif

XXXXX



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?
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (3) [1] 2 3 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG