|
 |
|
|
|
|
|
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
|
Weapon Weight realism mod: guns and ammo slow you down
 |
|
 |
| |
AngryAmoeba  |
|
Symbiont

Group: Members
Joined: Jan 12, 2009


|
WHAT IT DOES — Slowed MovementThis script decreases your speed on foot, depending on the weapons, ammo, and cash you're carrying. (All speed penalties can be tweaked.) — HurryingHolding 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 BagLarge 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 RemovalPressing * on the numpad drops the current weapon permanently. While unarmed, hold PageDown and press * to remove armor. (This can be disabled.)HOW TO INSTALLThis 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, 2012ADF.LY DOWNLOADIf you'd like to support me and my mods, please take 5 seconds and use this download link! NORMAL DOWNLOADIf 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 LOGv1.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
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
AngryAmoeba  |
|
Symbiont

Group: Members
Joined: Jan 12, 2009


|
| 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 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!
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ikt  |
Posted: Tuesday, Apr 26 2011, 06:07
|

Group: Members
Joined: Oct 2, 2006

|
| 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 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.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ikt  |
Posted: Tuesday, Apr 26 2011, 09:47
|

Group: Members
Joined: Oct 2, 2006

|
| 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. 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
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Prof_Farnsworth  |
Posted: Tuesday, Apr 26 2011, 13:04
|
Ambient Modder

Group: Members
Joined: Feb 25, 2011

|
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
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
lolleroz  |
Posted: Tuesday, Apr 26 2011, 13:06
|
Playa

Group: Members
Joined: Jul 29, 2010


|
| 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.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
ikt  |
Posted: Tuesday, Apr 26 2011, 14:28
|

Group: Members
Joined: Oct 2, 2006

|
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
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
AngryAmoeba  |
Posted: Thursday, Apr 28 2011, 12:31
|
Symbiont

Group: Members
Joined: Jan 12, 2009


|
| 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.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(3) [1] 2 3
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|