Quantcast

Jump to content

» «
Photo

Weapon Weight

GTA4 .NET script mod realism
64 replies to this topic
AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#31

Posted 01 January 2012 - 04:20 AM Edited by AngryAmoeba, 02 September 2012 - 02:45 AM.

Small update in the first post.

Changes in v1.2.4
- 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.

NudasPriest
  • NudasPriest

    Midnight Toker

  • Members
  • Joined: 29 Jul 2012

#32

Posted 30 August 2012 - 10:38 PM Edited by NudasPriest, 31 August 2012 - 12:46 AM.

QUOTE (AngryAmoeba @ Sunday, Jan 1 2012, 04:20)
Small update in the first post.

Changes in v1.2.4
- 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.

Hey, this mod is badass, but for some reason it doesn't seem to be fully working.

IIRC the more guns/ammo/gear you have on you, the slower you move. I used to feel the subtle difference in speed, but now no matter how much i am carrying it seems like the same speed as normal.

I was tweaking with the values to hopefully make having a full loadout (roughly 10 mags for each weapon type + 25 projectiles) be overweight, and try to make something under the default max penalty of 30 that would amount to maybe a pistol + 3 mags, rifle + 10 mags, SMG + 6 mags, rocket launcher + 4 rockets, and armor would be just about under the max penalty.

But now, as I said the speed seems unchanged except for a slight second. I use a trainer to test the mods and I would give myself a full loadout: basically what you'd get with Weapons cheat 1 or 2, and for a second Niko moves slow as if he is affected by the weight, and then it goes back to normal. Are my weight penalties incompatible or what? It seems like speed is now unchanged with i revert to the default INI file as well...

Here is my INI as of right now:

CODE
[FEATURES]
UseHurry = true
UseWeaponBag = true
UseWeaponRemoval = true

[KEYS]
HurryKey = 18
DropWeaponKey = 106
DeletePickupKey = 111
ModifierKey = 34

; Adrenaline values represent percentage of total adrenaline
[HURRY]
HurrySpeedBoost = 20
AdrenDrainPerSec = 13
AdrenRechargePerSec = 3
AdrenRestingBonus = 6
ShowAdrenalineBar = true
AdrenBarPositionX = 0.0
AdrenBarPositionY = 0.0

[SPEED PENALTIES]
; Penalty values represent speed decrease in percent
MaxTotalPenalty = 45.0

; Weapon penalties
RiflePenalty = 2.98
SniperPenalty = 3.1
ShotgunPenalty = 2.6
RocketPenalty = 4.1
SMGPenalty = 2.5
PistolPenalty = 1.5
GrenadePenalty = 0.9
MolotovPenalty = 0.75
KnifePenalty = 0.3
BatPenalty = 0.4

; Ammo penalties, per clip
RifleClipPenalty = 0.6
SniperClipPenalty = 0.46
ShotgunClipPenalty = 0.44
RocketClipPenalty = 1.3
SMGClipPenalty = 0.43
PistolClipPenalty = 0.31

; Other penalties
ArmorPenalty = 2.9
ThousandDollarPenalty = 0.008


By the way, I am using a lot of other mods but I removed some of the ones that I've installed since the speed hasn't been feeling different and it's not fixed.

Edit: Also, the RPG doesn't seem to have a bag when you have one equipped, is it supposed to be concealed in a pocket or the backpack or duffel bag?
Edit2: I think I narrowed the problem down, seems to be an issue with either BasicNeeds.cs and/or Trunk.cs and from HippieCommunist's Modpack. With these mods out of the picture the running speeds are penalized as they should be. It might be something with the way animations are used in these mods?

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#33

Posted 31 August 2012 - 12:52 AM Edited by AngryAmoeba, 31 August 2012 - 12:57 AM.

Thanks for the report! You're right, the code isn't checking for the RPG like it should. Easy fix!

The speed problem, though, sounds harder to figure out. Do the bags work correctly, aside from the RPG? And does hurrying work properly? If not, are there any errors listed in your ScriptHook.log or ScriptHookDotNet.log files (in your main GTA4 folder)?

I don't have a whole lot of time anymore to work on my mods, but I'll try to fix this issue as fast as I can.

EDIT: Just saw your 2nd edit and now I understand. Weapon Weight slows you down by adjusting the speed of your movement animations. This works quite well, but unfortunately it means that any other mod that also adjusts the animation speed will break Weapon Weight. (I believe BasicNeeds.cs by HippieCommunist makes you move faster after you drink coffee?) This conflict seems unavoidable.

NudasPriest
  • NudasPriest

    Midnight Toker

  • Members
  • Joined: 29 Jul 2012

#34

Posted 31 August 2012 - 01:01 AM Edited by NudasPriest, 31 August 2012 - 01:04 AM.

Thanks, I sent a PM to another mod author as I think it is an incompatibility (With BasicNeeds.cs perhaps) but the other things I noticed, it seemed like only a few of the 2-handed weapons actually give the player a dufflebag. RPG, Snipers, didn't give me a bag. Niko had a knife, PSG-1, RPG, and glock with loads of ammo for each and no bag lol. I may have stumbled upon the issue itself, which has to do with BasicNeeds.cs, from HippieCommunist's modpack.

I think BasicNeeds has a caffeine bonus for drinking coffee, and it looked like it was setting player speed here and there at different levels and making the player not get tired. Could be an interesting tie in, some of the usable items in BasicNeeds giving you a speed boost...

Edit: Wow, I was pretty spot on. I will comment out the coffee stuff then, see if it fixes. But I noticed it gives a boost when the Caffeine level is as "1.00f". Don't know what it initializes at but if it starts at a level and that level has an effect, then it's probably getting mixed it. Thanks for your fast response, though, and the effort in your mods.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#35

Posted 31 August 2012 - 01:09 AM Edited by AngryAmoeba, 31 August 2012 - 01:14 AM.

You're right again... The code doesn't check for sniper rifles either. What the hell. At some point, I must have accidentally copied code from my personal version, where assault rifles, sniper rifles, and RPGs all use the assault rifle inventory slot. How long has the mod had this bug? confused.gif

I'll post a fixed version either tonight or tomorrow night after work.

NudasPriest
  • NudasPriest

    Midnight Toker

  • Members
  • Joined: 29 Jul 2012

#36

Posted 31 August 2012 - 01:18 AM Edited by NudasPriest, 31 August 2012 - 01:30 AM.

Nice. And I don't know if I know what I'm doing, but I might have just made a modified version of Basic Needs that won't dick with the speed bonus, but if you drink enough caffeine you won't get tired. Does Weapon Weight do anything with that? I took out the references to Player Movement speed and it looks like solid enough coding to not crash. Gonna test in a bit. Edit2: It works, so far so good!

Edit: Also, if you could do it but just didn't decide to, is it a quick thing or even possible to have the AK and M4 ammo separate; same with Deagle and Glock? If that's the case then i think it'd add even more variation with this mod and Weapon Storage. I have a customized WeaponInfo.xml that I'm working on: most guns have a simulated bullet travel time, realistic rate of fire, range, ammo caps, damage and force, faster rockets, throw molotovs farther in a vehicle so you dont kill yourself on motorcycles.... With it feels like a whole new shooter IMO compared to GTA 4 vanilla. it's just a weapons.xml but I am actually pretty proud of how it's turning out. But what I'm saying is, I have my AK and M4 have different ammo caps because in reality 5.56 ammo is a lot lighter than 7.62, so the AK has like 3 mags less. If this could be actually adjusted in the weight mod, it'd be pretty legit.... Would make the AKM skin i got feel even more beefy.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#37

Posted 02 September 2012 - 02:45 AM Edited by AngryAmoeba, 03 September 2012 - 08:35 AM.

@NudasPriest: No, Weapon Weight doesn't change how fast you get tired. And it's technically possible to give the AK and M4 different speed penalties, but then non-vanilla assault rifles (i.e. EFLC or custom weapons) wouldn't be detected. Right now, the mod uses two different methods to detect weapons: usually it just checks your inventory slots, which works for non-vanilla weapons, but it checks for the knife, bat, grenades, and molotovs separately. Unfortunately that means non-vanilla melee/thrown weapons aren't detected by the mod. I'll try to think of a better solution in the future.

Anyway, I just put the fixed version in the first post. Sorry it took longer than I said it would!


Changes in v1.2.5
- 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.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#38

Posted 03 September 2012 - 08:35 AM Edited by AngryAmoeba, 24 October 2012 - 04:43 AM.

Another minor update in the first post.

Changes in v1.2.6
- 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.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#39

Posted 03 September 2012 - 10:38 PM

Aaand a hotfix.

Changes in v1.2.6 hotfix
- Fixed constant player animation twitching caused by updating the bag too often.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#40

Posted 29 September 2012 - 07:13 AM

Another hotfix! (Damn it.)

Changes in v1.2.6 hotfix 2
- Fixed bug where cash never gave you a bag.
- Very minor optimization when loading.

lolleroz
  • lolleroz

    Homeboy

  • Members
  • Joined: 29 Jul 2010
  • None

#41

Posted 23 October 2012 - 06:40 PM

I wish somebody would make this compatible with TLaD confused.gif

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#42

Posted 23 October 2012 - 07:43 PM

What part isn't compatible with TLAD?

lolleroz
  • lolleroz

    Homeboy

  • Members
  • Joined: 29 Jul 2010
  • None

#43

Posted 23 October 2012 - 07:44 PM

When I was on previous install of my game I'm quite sure none of the TLAD weapons counted towards weight and if I remember properly Johnny was not affected even while I had sh*tload of weapons on me + cash

now I just installed EFLC again so I'll test it a little bit and tell you what's wrong if it's still wrong

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#44

Posted 24 October 2012 - 04:43 AM Edited by AngryAmoeba, 28 October 2012 - 08:52 AM.

I don't have EFLC to test, but with the update I just uploaded, I'm pretty sure everything should slow you down except the parachute.

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

lolleroz
  • lolleroz

    Homeboy

  • Members
  • Joined: 29 Jul 2010
  • None

#45

Posted 25 October 2012 - 03:29 PM

Fixed the script for TLAD by disabling the bags feature, however the 'main' part of script still crashes, everything seems to be working fine. It's a real shame the pickups dissapear after you pass a mission since that completely takes away the whole purpose of this feature for me (as everytime I finish a gangwar my weapons prepared for next gangwar dissapear)

Unicell
  • Unicell

    Player Hater

  • Members
  • Joined: 25 Oct 2012

#46

Posted 25 October 2012 - 06:28 PM

Hey, AngryAmoeba. I was wondering if you can make armor visible when you pick it up, like the gun and money bags. It'll look resoundingly badass when combined with the Robbery Mask and Equip Weapons Mod.

NudasPriest
  • NudasPriest

    Midnight Toker

  • Members
  • Joined: 29 Jul 2012

#47

Posted 25 October 2012 - 06:30 PM

I'm gonna put my two-cents in, I think that the dufflebag/backpacks and the armor vest that you can wear take up the same clothing slot on your body, meaning unless somebody can model them in as a different clothing slot, if that would even work, they aren't compatible. Only one can be worn, or the other. Kinda disappointing, yeah.

Unicell
  • Unicell

    Player Hater

  • Members
  • Joined: 25 Oct 2012

#48

Posted 25 October 2012 - 07:13 PM

QUOTE
I'm gonna put my two-cents in, I think that the dufflebag/backpacks and the armor vest that you can wear take up the same clothing slot on your body, meaning unless somebody can model them in as a different clothing slot, if that would even work, they aren't compatible. Only one can be worn, or the other. Kinda disappointing, yeah.

Ah, poop. Really? Oh well. Thanks, man.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#49

Posted 25 October 2012 - 07:39 PM

@lolleroz
Can you post the crash info from ScriptHookDotNet.log? And yeah, it's really a pain how the pickups get deleted. Not sure how to fix it. There's the Weapon Storage mod, but that's not compatible with EFLC either.

@Unicell
NudasPriest is right, but you could disable the bag feature of this mod and then use Lilmcnessy's Visible Armour mod: http://www.gtaforums...howtopic=424749

lolleroz
  • lolleroz

    Homeboy

  • Members
  • Joined: 29 Jul 2010
  • None

#50

Posted 25 October 2012 - 07:43 PM

Error during Tick in script 'WeaponWeight.Main':
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ModelIndex
at GTA.value.PedComponent.Change(Int32 ModelIndex, Int32 TextureIndex)
at WeaponWeight.PlayerBag.Update()
at WeaponWeight.Main.Main_Tick(Object sender, EventArgs e)
at GTA.Script.TryTick()
at GTA.Script.DoTick()
at GTA.ScriptThread.OnTick()

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#51

Posted 25 October 2012 - 08:52 PM

Hm, well apparently the code for bags is different in EFLC. But I don't know what it's supposed to be... I'll try asking about it on IRC this weekend.

NudasPriest
  • NudasPriest

    Midnight Toker

  • Members
  • Joined: 29 Jul 2012

#52

Posted 25 October 2012 - 08:58 PM

Does Johnny Klebitz, or even Luis Lopez for that matter, ever use a bag like Niko in singleplayer? Perhaps Rockstar just coded bags in a weird way and only certain models can use certain bags or some cannot use bags at all? For instance I don't think it's possible to equip the male or female multiplayer models (the customizable ones for Free Mode and Deathmatch online) with a bag. or maybe they're linked to the model...

lolleroz
  • lolleroz

    Homeboy

  • Members
  • Joined: 29 Jul 2010
  • None

#53

Posted 25 October 2012 - 10:05 PM

I'm quite sure you can put a bag on Johnny using the simple native trainer, the problem is that the clothing ID is different than Niko's bag, also I'm not sure if Johnny player's archive has a backpack (I'm really sure there's a bag but I'm unsure about the backpack)

either Angry needs to change the 'ID' of the bag to suit TLAD one, or just remove instance mentioning any bags from the script (if TLAD has got no bags) another possibility however would be to just add the bag and backpack into Johnny's player archive by basically stealing the bag and backpack from Niko's player archive

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#54

Posted 27 October 2012 - 08:45 AM

Are you sure you're using the latest scripthook? That could be an issue as well. If you try to add the bags to Johnny and Luis, let me know if it works!

In the next update, I'll disable any bags that aren't available. This will prevent the crash, but of course you'll also never see the unavailable bag, which is a bummer.

lolleroz
  • lolleroz

    Homeboy

  • Members
  • Joined: 29 Jul 2010
  • None

#55

Posted 27 October 2012 - 10:14 AM

QUOTE (AngryAmoeba @ Saturday, Oct 27 2012, 08:45)
Are you sure you're using the latest scripthook? That could be an issue as well. If you try to add the bags to Johnny and Luis, let me know if it works!

In the next update, I'll disable any bags that aren't available. This will prevent the crash, but of course you'll also never see the unavailable bag, which is a bummer.

Yeah I'm using the newest version from Hazard's topic.

I'm going to download SNT and Spark IV and play around and tell you the results (about the bags on Luis/Johnny)

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#56

Posted 28 October 2012 - 08:36 AM Edited by AngryAmoeba, 28 October 2012 - 08:53 AM.

Changes in v1.2.8
- 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.


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


And as usual, for those of you who are willing to try buggy features... sly.gif

Here's the ALTERNATE VERSION with (sometimes buggy) dropped weapons that you can pick back up.

- Dropping a weapon creates an orange pickup. It will disappear after 60 seconds.
- Holding the modifier key (default is PageDown) when dropping makes it permanent. It will stay there until picked up.
- Hold the modifier key and press "/" on the numpad to delete the most recently dropped weapon since loading (useful if it glitches out, spawns in a wall, etc.).

IMPORTANT NOTES for alternate version
- Completing a mission will delete all of your pickups, even permanent ones.
- Sometimes weapons can be dropped inside walls or other objects. Try to drop only when facing a fairly level area. Avoid dropping when facing walls.
- You can't drop weapons in some indoor locations, like subways or the safehouse near Middle Park. If you try, they will just glitch and disappear. sad.gif
- When you save the game, all your pickups are saved as well. (So if a pickup glitches out and you can't get to it, be sure to delete it with "/" before saving.)
- I still don't know how to make armor pickups. Armor is removed permanently.

I personally use this buggy version... I'm just careful to avoid the bugs.

I keep weapon stashes around the city:
user posted image

DerDodga
  • DerDodga

    Player Hater

  • Members
  • Joined: 02 Aug 2009

#57

Posted 28 October 2012 - 11:31 AM

QUOTE
I still don't know how to make armor pickups. Armor is removed permanently.


Just some Idea: Create any Pickup (Money, Weapon, Object whatsoever), test if it was collected and add the armor if it was wink.gif

The Loot
  • The Loot

    Square Civilian

  • Members
  • Joined: 14 Apr 2010

#58

Posted 26 February 2013 - 10:57 PM

Not sure if this would be better for the Weight or Storage mod, but would it be possible to get a version with an option to always lose your weapons on death? I know Warrant does it when dieing while being chased, and Bank does it for money all the time, but I think losing your weapons all the time feels better.

AngryAmoeba
  • AngryAmoeba

    Symbiote

  • Members
  • Joined: 12 Jan 2009

#59

Posted 26 February 2013 - 11:26 PM

Just copy and paste this into Notepad, and save as a .cs file. It should do the trick. wink.gif

CODE
using GTA;
using System;

class WeaponConfiscation : Script
{
   private int timesDied;
   
   public WeaponConfiscation()
   {
       this.Interval = 1000;
       this.Tick += WeaponConfiscation_Tick;
       timesDied = GetTimesDied();
   }
   
   private void WeaponConfiscation_Tick(object sender, EventArgs e)
   {
       if (timesDied < GetTimesDied())
       {
           timesDied = GetTimesDied();
           Player.Character.Weapons.RemoveAll();
       }
   }
   
   private int GetTimesDied()
   {
       return Game.GetIntegerStatistic(IntegerStatistic.TIMES_DIED);
   }
}

The Loot
  • The Loot

    Square Civilian

  • Members
  • Joined: 14 Apr 2010

#60

Posted 26 February 2013 - 11:31 PM

Thanks!




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users