Fallout New Vegas
0 of 0

File information

Last updated

Original upload

Created by

jtgibson

Uploaded by

jtgibson

Virus scan

Safe to use

About this mod

A pure-scripted system for enabling ammo use on NPCs' weapons and giving them enough ammunition to use them. Part of my eventual "Arsenal" series.

Requirements
Permissions and credits
=== JT's Arsenal: Ammo Use ===
Requires NVSE v4.6b1+ and JIP NVSE Plugin v11.00+


WHAT IS JT'S ARSENAL: AMMO USE?

Arsenal: Ammo Use is one of my planned series of mods under the "Arsenal" name. Arsenal: Ammo Use specifically is intended to enable the "NPC ammo use" flags on all weapons used by all NPCs as well as to give them enough ammunition to use them.

It's been done before by one of the scene's very illustrious modders, but unfortunately that mod has a bug which causes a token and additional ammo to be continuously added to certain NPCs, as it doesn't trap every condition in its logic. This one doesn't have that problem -- not least of which because it's written from scratch. ;-) It is not simply a rehashing of that mod, of course, as Ammo Use also includes numerous tunable settings (available through the console) and more carefully scales the amount of ammo to be given to NPCs based on what kind of weapon the NPC is using, also taking advantage of modern NVSE features and fixes that have been added in the time since.

REQUIRED PLUGINS

* NVSE is mandatory (4.6b1+ will do, although the latest and greatest is of course recommended).

* JIP NVSE plugin (v11.00+) is required to avoid the notorious vanilla game's "equip bug", to produce exact damage calculations for grenade and missile launchers to determine the amount of ammunition to give to an actor, and to track temporary actors via an auxiliary variable.

COMPATIBILITY

* Should be compatible with any mod under the sun. See Known Issues and Bugs below for a potential bug with poorly scripted mods, however.  Also see Known Issues and Bugs for the various incompatibilities it has with the base game, since the base game was never adequately designed for this. ;-)

* If you use any other mods that automatically enable ammunition use on NPCs, this mod simply serves as an "ammunition tweak" mod. You won't be able to reduce the ammo the NPCs carry (it's been on my TODO for a while), but you can choose how much ammo to add.

FEATURES

* Enables NPC ammunition use on all weapons. NPCs who run out of ammunition in protracted firefights will need to resort to melee combat. Since all of the NPCs are cannon fodder in general anyway, the limited supplies of ammo won't matter much. A global script will scan all WEAP records after a cell is loaded (including those in inventory), and ensure that the 'NPC uses ammo' flag is enabled for all the weapons found. Weapons will be skipped if they appear in the EmbeddedWeapons form list, if they fire "breeder" ammo, or any other large number of failure conditions.

* Ensures most NPCs have at least one full clip of ammunition when generated (except for very high capacity heavy weapons like Flamers, Incinerators, and Miniguns).

* Weapons will have additional ammunition added based on their basic magazine capacity. Low-capacity weapons will be given relatively more ammo than moderate-capacity or high-capacity weapons as they will run out of ammunition sooner; NPCs should therefore have fairly "typical" levels. For instance, a person with a 6-shot revolver may have 18 rounds, whereas a person with a 10mm pistol may have 25 rounds: the 6 shot revolver has 3 whole reloads, whereas the 10mm pistol has only 2 and a half, even though there is technically more ammunition.

* Single-shot weapons are treated in a special way, based on a "staying power" pool. The minimum amount of base damage that an NPC should be able to cause with their single shot weapon, assuming perfect accuracy, determines how much ammo they will carry for that weapon. For instance, using the default minimum staying power of 250.0, and a Single Shotgun can produce 35 base damage (assuming all subprojectiles hit), then it will have at least 7 shells spawned to come close to its minimum desired damage. The actual amount of staying power is randomised (by default between 250 HP to 350 HP of damage).

* All weapons are also given a guaranteed bonus number of rounds, where the category is one of "single shot", "low capacity", "moderate capacity", or "high capacity" -- the amounts can be tuned independently for each. This is especially useful for Single-Shot weapons like Missile Launchers, Fat Man launchers, and other launchers for which NPCs usually spawn with very little ammo.

* Enabled by default, all essential, non-companion NPCs will have unlimited ammunition, soft-coded by way of a script: if at any time their ammunition count for their primary weapon drops below the "desired" ammo amount, they will automatically be re-issued more ammunition out of thin air.
** This should keep the game moving and interesting; e.g., when using Tale of Two Wastelands, this would turn the GNR Plaza battle from boring (a crawling slog of melee combat between the good guys and the bad guys) to thrilling (the good guys mowing their way through, the bad guys usually using up most of their ammo so very little can be looted, and the entire encounter feeling like a fierce battle as it was originally intended (even though thanks to invincible allies it's a Call of Duty "take cover and watch" scripted fight -- unlike the Arlington Library which is a far more satisfying seek and destroy)).
** In my opinion, this is how Bethesda should have designed it from the beginning-- companions and other NPCs should use ammo (as running out keeps things interesting and it adds an economic cost to having a companion) and make controlled bursts to conserve ammo, but essential NPCs either should not run out of ammo, or should be scripted properly to allow ammunition use in a contextually friendly way (i.e., depending on whether they're protected -- should use ammo and possibly run out to make the story more interesting, or essential -- should have unlimited ammo because the story will break apart if they don't).

SETTINGS

I've been running the game with the default settings for quite some time and they work very nicely for a vanilla feel.Use the console to adjust any of these settings. The default settings are the numbers shown.
Spoiler:  
Show
  • set SettingUseAmmoUpdateFrequency to 17.0 -- Number of seconds between re-scans of same cell for newly spawned NPCs.
  • set SettingSingleShotMinStayingPower to 250.0
  • set SettingSingleShotMaxStayingPower to 350.0 -- Minimum and maximum potential damage (in HP) that anyone with a single shot weapon will be given ammo for -- which gives plenty of shells for Single Shotguns, but only a few Grenades or a couple Missiles
  • set SettingSingleShotBonusRoundsMin to 1.0
  • set SettingSingleShotBonusRoundsMax to 3.0 -- Minimum and maximum number of rounds to add "for free" to any actor with a single-shot weapon, to ensure they have at least a few rounds
  • set SettingLowCapacityMinMagazines to 2.0
  • set SettingLowCapacityMaxMagazines to 3.0 -- Minimum and maximum number of full loads of ammunition to assign to the actor using a low capacity weapon with <= SettingLowCapacityThreshold rounds per magazine
  • set SettingLowCapacityThreshold to 12.0 -- Maximum number of rounds in weapon to consider it a low capacity weapon
  • set SettingLowCapacityBonusRoundsMin to 3.0
  • set SettingLowCapacityBonusRoundsMax to 10.0 -- Minimum and maximum number of rounds to add to any actor with a low capacity weapon "for free", regardless of magazine size
  • set SettingModCapacityMinMagazines to 2.0
  • set SettingModCapacityMaxMagazines to 3.0 -- As SettingLowCapacity(Min/Max)Magazines, but for a moderate capacity weapon with <= SettingModCapacityThreshold rounds per magazine (default 30)
  • set SettingModCapacityThreshold to 30.0 -- Maximum number of rounds in weapon to consider it a moderate capacity weapon
  • set SettingModCapacityBonusRoundsMin to 5.0
  • set SettingModCapacityBonusRoundsMax to 12.0 -- As SettingLowCapacityBonusRounds(Min/Max), but for moderate capacity weapons
  • set SettingHighCapacityMinPercent to 35.0
  • set SettingHighCapacityMaxPercent to 85.0 -- For ultra-high capacity weapons, the minimum and maximum percentage of a full magazine to add to the actor (e.g., a partially empty Flamer Fuel tank)
  • set SettingHighCapacityBonusRoundsMin to 12.0
  • set SettingHighCapacityBonusRoundsMax to 30.0 -- As SettingLowCapacityBonusRounds(Min/Max), but for high capacity weapons
  • set SettingConventionalMagazineChance to 40.0 -- Chance that a full magazine of default ammo is added to the actor
  • set SettingUnusualMagazineChance to 25.0 -- Chance that a full magazine of special ammo is added to the actor (dependent probability, after conventional magazine chance is checked: default is 25% of 60%, or 15% total chance) -- if neither the Conventional nor Unusual chances succeed, they are given a random number of conventional and special rounds
  • set SettingVanillaAmmoListSortingFix to 1 -- If zero, sorting fix is not applied (not recommended to disable -- this is an essential fix for compatibility with poorly scripted mods)
  • set SettingEssentialUnlimitedAmmo to 1 -- If zero, essential NPCs will not be periodically given ammo when their supplies are low (not recommended to disable: most essential NPCs are involved in scripted battles and running out of ammo looks very bad)
  • set SettingGiveAmmoToBodies to 1 -- If zero, already-dead actors are not given ammunition

An MCM menu is forthcoming, but I've never been particularly fond of mod configuration menus and INI saving as it's so much easier to create a patch in FNVEdit to modify your globals permanently while simultaneously using the console to tweak the settings until you find something you like. But then, I'm an old-school DOS user.


GAMEPLAY AND DESIGN NOTES

* The pure principle behind this mod is "no free rides" -- NPCs play by the same rules that you do, and can run out of ammunition in combat. While the vanilla unlimited ammunition for NPCs is more balanced (they will be able to keep up with the resources of the player who can find and afford more ammo), it is not very realistic. It is more suitable for quest-oriented gameplay and less suitable for free roam gameplay.

* Also of note, the original Fallouts also had NPCs use ammo.  (Although, straight from the manual, 'All  ranged  weapon  attacks  are  assumed  to  be  aimed.  Ammunition is scarce.  Each shot must count.'  Sadly, this engine can't do that.  Actually, Arma 3 Wasteland is probably the closest you're going to get to that, and that saddens me. ;-)).

* You will, of course, find plenty more ammunition with this mod than you would with the base game, as NPCs will be given enough ammo to be able to use their weapons a reasonable amount of time. However, this depends on your play style -- if you are a sniper who kills people from stealth, you will find more ammunition than if you are a run-and-gun player who allows people to shoot back.

* It is recommended to use this mod alongside another mod that balances weapon damage, such as Project Nevada or FOOK. That way, it is less likely for an NPC to run out of ammo before killing or being killed. As tactical as it is to allow NPCs to run out of ammo, using manoeuvre and skill to evade and defeat the enemy -- especially as a melee user or unarmed warrior -- it can also be very, very boring.

* The real problem with NPCs using ammo is that Bethesda gave them too poor of an AI; don't get me wrong, their AI is very sophisticated for navigation compared to such things as the ARMA series, but is simply too oblivious to their own personal states. Instead of placing well-aimed shots like the player does, they unload an entire magazine in full automatic and then go back in for seconds. There is no strategy to their use of ammunition. If you use range modifications to projectiles, NPCs are all too happy to fire their weapons outside of effective range because the range controls not only the maximum render distance of the projectile but also the optimum AI range. These should DEFINITELY have been separated instead, or at least calculated based on gun spread, and NPCs should know to fire less often at range as hits are less likely at that range -- although they do occasionally get pretty lucky.

* This mod is more robust than the other scripted mod of the same function as it has no logic errors. The other mod will continually add its tokens to NPCs' inventories because it fails to trap all potential conditions in its branching if, triggering the New Vegas "equip bug" and otherwise making a mess of things. (Aside from that bug it was well designed and well scripted, and I made extremely heavy use of his website's NVSE scripting docs while making this mod in the first place. =))

KNOWN BUGS AND LIMITATIONS
Spoiler:  
Show
1) It is possible for an NPC using an ammo-enabled weapon to be spawned and not given any ammunition, if they are spawned into the game after the script has already processed all actors in range. This is automatically corrected when the player crosses a boundary (around 200'/60 m in the exterior or going through a load door in the interior) or periodically every 17 seconds -- however, in this window, if the player gets close enough to bring the actor into "high level" processing, it is possible for them to fight with other actors and get killed because they have only a few rounds of ammunition. This is more noticeable with scripted spawn tweak mods (such as Mart's Monster/Mutant Mod). Unless the NPC was actually spawned almost directly on top of you, however, if the NPC is close enough to actually shoot at you they will almost certainly have their ammunition by then.

2) Although automatically fixed for all vanilla ammo types, other poorly scripted mods may result in NPCs being given too much special ammo if their mod appends their ammo types to the lists indiscriminately. This is because ArsenalAmmoUse expects that the first item in the ammo form list be the "normal" kind, but any mod which adds its ammo types to the front of the list (i.e., doesn't re-order the ammo in the editor, or uses the base game function AddFormToFormList instead of FOSE/NVSE's ListAddForm) will replace the "standard" ammunition for that weapon with a completely unusual special ammo. This affects in particular mods like 'STUN: Stun and Tie Up NPCs', where NPCs would be generally spawned with stun rounds for their laser pistols. Those mods should be fixed by their authors to use NVSE's ListAddForm instead, but the brute force fix does work for vanilla ammo: I use AddFormToFormList [ammolist] [defaultammo] for the vanilla game default ammo types, which bumps the original ammo type to the top of the list, which by happy coincidence is exactly what we want. If, however, the other mod runs its script repeatedly (terrible design), then it will never be compatible.

(Note that if the mod does have this problem, it will also manifest itself in other ways -- such as showing an incorrect ammo count and base ammo type in the Pip-Boy until you equip the weapon.)

Theoretically I could have simply hard-coded the "default" ammo type for any ammo list, but that would make this mod less compatible with overhauls, and especially with completely new ammo types that are not part of the vanilla game. As with any solution, there's a tradeoff.

3) The vanilla game has another bug with tube/cylinder magazines which use ammo and which load rounds one-by-one. If the NPC has less than a full magazine of conventional ammo upon reloading, they will infinitely play the reload animation, always thinking they have one more round of ammo to put in. This bug occurs only when using weapons that actually use ammunition, and so this bug is not noticeable in the base game (as every tube/cylinder load weapon in the base game has infinite ammo for NPCs). The bug is most noticeable with .357 Magnum revolvers and similar equivalents. This can be fixed by opening the console, clicking on the NPC, using the "inv" command to see their list of ammo, and then "equipitem XXXXXXXX" with the appropriate form ID of one of their ammo types (plenty of tutorials around to master your console-fu if that sounds Greek). I tried a scripted solution to this, but had to delete it because all it did is trigger a crash when trying to force them to equip their special ammo... One way or another, this bug only rarely comes up, and only when the NPC has already emptied several magazines at you. I debated releasing this mod for ages because of this "unfixable" vanilla bug, but since it works beautifully 99.9% of the time I decided it was worth it in the end. I'll keep probing to see if there's a way to work around the bug at some point or another, since Obsidian are rather unlikely to fix the bug on their own. ;-)

It may also be a bug exposed by Hitman's Professional Pistol animations, since I never explicitly ruled that one out, but I think it's more likely that it's a vanilla bug. Since the bug occurs rarely it's hard to find a test case that works. =P

4) Also a vanilla bug, NPCs can equip special ammo, but don't always do so. I've encountered a few scenarios where instead of switching to their special ammo, they run and grab another weapon instead.

5) Unfortunately this one is difficult to fix: when aforementioned NPC goes and runs to grab another weapon, the base game simply gives them a single round of ammunition as a hardcoded feature ("hey, they have unlimited ammo, it'll be fine"). This usually means that anyone that grabs a 12-gauge out from under the counter will run out of ammunition within an instant. The problem lies not only with the AI's inability to grab the ammo along with the weapon, but also the massive quandary on whether to give the NPC fresh ammo out of thin air or whether to leave them helpless. Actually detecting from what container they got the item (so the ammo can be transferred over too) requires heavy use of event handlers on both NPCS (OnActivate) and weapons (OnAdd) and might not be worth the performance hit. Damned if you do, damned if you don't, damned if you even try. =)

6) Companions are deliberately excluded from the "essential" NPC ammunition. This does have consequences when using mods which enable the Teammate flag inappropriately -- TTW being a prime offender, such as with Dad during the Main Quest when he escorts you across the map, or with "Guido" before he joins you officially. In this particular case, even though these NPCs should be given unlimited ammo as they are quest important, they are not because they are also incorrectly flagged as companions, even though they do not follow the player, don't accept inventory trades, and cannot be given commands -- I have to assume their intention was compatibility with JIP CC&C, but it broke anything else that depends on teammates being actual teammates, and there is no way to detect whether an NPC is actually a companion or not without relying on this function. In the end this simply means that they'll run out of ammo, rather than breaking anything, but you'll observe problems #4 and #5 fairly often. (I'm considering a fix which simply checks if the NPC's script package is "Escort", since in both of these cases that's what happens, and no companion mod I'm aware of actually has a companion escort the player at any point, but that's a pure hack.)

FUTURE IMPROVEMENTS

The mod is already finished to a level of "it's good enough for me", vanilla bugs withstanding. These are some TODO items I threw on my list, but all of these are merely in the "want" category in the MOSCOW method -- except for the first one, which is a "could"/borderline "should", but I figured I should commit to a release first and then get around to it instead of niggling over that one feature. Let me know if you think the mod would be much improved by them and I may get around to them sooner. =)
Spoiler:  
Show
* Allow wiping an NPC's ammunition and starting from scratch whenever they are processed for the first time. UNIMPLEMENTED
** Pros: Allows this mod to take over entirely to determine the amount of ammunition the NPC should have, which allows you to achieve DUST / Mad Max / Book of Eli scarcity levels.
** Cons: Not intelligent enough to handle NPCs which were deliberately given a lot of ammo.

* Optionally, if an NPC actually has ''no'' ammunition for a given weapon when first generated, they will still be given no ammunition for that weapon. UNIMPLEMENTED
** Pros: Allows mods to design NPCs to carry weapons as loot, rather than as backup weapons.
** Cons: Would fail to rearm NPCs when a cell resets (e.g., Stockholm with TTW would eventually run out of and forever remain out of ammunition), shy of using a token and potentially exposing the Equip Bug, or forcing dependency on JIP NVSE with an auxvar.

* NCR troopers will be given a minimum of 3 full magazines of 5.56mm surplus ammo. UNIMPLEMENTED
** Pros: Increases their survivability, as their entire combat viability depends on their ability to fire guns; running out of ammo means they are dead meat against any Legion soldier, even a basic recruit (to say nothing of veterans or praetorians). Makes the NCR Emergency Radio not suck. As surplus 5.56mm has no value in shops, doesn't break economy.
** Cons: Contrary to canon, as they are reported to have equipment shortages. Also, Legion players will be swimming in 5.56mm ammo.

* Special or "quirky" NPCs are less likely to have conventional ammo, such as Fiends and Raiders. UNIMPLEMENTED
** Pros: More interesting to fight these NPCs.
** Cons: Less consistency of gameplay. Since determining what each special ammo type actually ''does'' is very script intensive and is thus deliberately avoided (and would be completely useless to even try figuring out what scripted ammo does), NPCs could be randomly given useless rounds or extremely high power rounds, making it very hit or miss.

* Upon being killed, any NPC's ammunition stockpiles will be reduced to a maximum total "staying power". UNIMPLEMENTED
** Pros: Preserves the original game's balance, while still allowing NPCs to run out of ammo from time to time for enhanced strategy against missile launchers.
** Cons: Half the reason I made this mod in the first place was because NPCs still had only 6 rounds of ammo regardless of whether I caught them by surprise or not, which felt ridiculous.

* (Requires JIP NVSE) Optionally, all companion weapons are made playable and will consume ammunition. This operates on a scripted override basis, so can be turned on or off as you wish. UNIMPLEMENTED
** Pros: Far more balanced. Going through Vault 22 with Boone and unlimited companion ammo is pure easy mode.
** Cons: It is ''incredibly'' !&$%ing tedious to have to rearm companions. If they could share ammo on their own or be smarter about reporting their ammo, it wouldn't be as bad... but going through the clunky interface, only for them to waste three full magazines in twenty seconds...

* Optionally, the amount of ammo that NPCs have will increase by +3% (configurable) times your character's level, causing scarcity in the beginning (when it matters to the player) while later in the game all NPCs can stand and deliver right back at the PC. For instance, at level 50, most NPCs will be carrying 2.5 times as much ammo as they would in the very beginning. UNIMPLEMENTED
** Pros: Preserves early game balance. By mid game, ammunition no longer matters and it is often pointless to loot anyway, so more of it doesn't hurt.
** Cons: Unrealistic. Why should everyone escalate just because ''you'' become more dangerous? Absolutely requires Hardcore Mode to make sense, however, since otherwise the PC could just carry infinite ammo and make this a so-called 'epic spiral', which is always terrible design (like American professional wrestling).

* Optionally, NPCs who are above your level will receive an additional boost in ammunition based on how many levels higher than you they are (+10% per level). UNIMPLEMENTED
** Pros: Tougher enemies have more ammo and are both more challenging and more rewarding to fight.
** Cons: When they are given more missiles, more grenades, more Max Charge energy cells...

* Optionally, NPCs who are below your level will receive a similar reduction, as a divisor rather than a multiplier -- that is, their ammo will be divided by 100%, +10% for each level's difference. At the same level, dividing by 100% has no effect. With five level's difference, they will divide their ammunition by 150% (one third less). If they are 10 levels below you, their ammo will be reduced by half; 20 levels below you, by two thirds; 30 levels below you, by three-quarters. UNIMPLEMENTED
** Pros: Reduces the amount of "free" ammo you get from killing mooks left, right, and centre.
** Cons: Mooks run out of ammo too quickly and become even more mooky.

PERMISSIONS

All I ask for is credit as the original author if you want to modify, take source code from, re-upload, or re-release the mod, and that it never be done for profit. In short, don't be a dick. No donations accepted: give the money to charity: water or to International Committee of the Red Cross instead. =)