MechWarrior 5: Mercenaries
0 of 0

File information

Last updated

Original upload

Created by

Puff

Uploaded by

pufthemajicdragon

Virus scan

Safe to use

Tags for this mod

About this mod

The Loot Crate Mod Gotham Deserves.
Completely overhauls loot crate generation - now you can loot equipment, lostech, mechs, and fully customize loot crates in every way you can imagine! *

* Imagination not available in all areas. Subject to limitations. Some restrictions apply. Ask your doctor if Imagination is right for you

Requirements
Permissions and credits
Changelogs
******************************************************************
* Stacked Loot Crates by Puff The Magic Dragon *
******************************************************************

===========
Description
===========
Completely overhauls the loot crate system. This does a lot so read on.
NOTE: Version 3 is a major change. Please check all of your mod options before loading your save games.
Version 3.1 fixes some major mod-breaking bugs. Please update!
Version 4.0 makes us ready for the Rise of Rasalhague!


============
Features
============
Find weapons, equipment, and battlemechs to loot crates
Adds rare loot crates with high value and even lostech loot
Adds ultra-rare Star League caches! But watch out for the defenders!
Customize the probability and quality of any loot drop to your preferences
Stock vanilla "empty" crates, cantina job crates, and Objective Raid crates with loot
Customize detection and scan distance!
Customize scan time!
Automatically scan crates!
Add map markers for discovered crates!
AI lancemates can detect and scan crates!
Fully customize loot crate indicators (light towers) with custom brightness and colors!
And much much more!


============
More Details
============
This mod completely alters random loot generation to allow you to obtain not only weapons but also equipment and even mechs from random loot drops. The loot is completely regenerated at mission start or when you change options and settings.


Mech Loot Chance
The percent chance that a random loot crate will contain a mech chassis. Mechs are randomly pulled from market probabilities based on your current difficulty level. Sorry, no heroes (yet). v2 now restricts mechs to rare loot crates only. The loot chance is weighted with Equipment and Weapons.
Default: 10%
Minimum: 0 (no chance)
Maximum: 100%

Equipment Loot Chance
The percent probability that a random loot crate will contain equipment. Weighted with Weapons in regular loot crates, and weighted with Weapons and Mechs in rare loot crates.
Default: 45%
Minimum: 0
Maximum: 100%

Weapon Loot Chance
The percent probability that a random loot crate will contain weapons. Weighted with Equipment in regular loot crates, and weighted with Equipment and Mechs in rare loot crates.
Default: 45%
Minimum: 0
Maximum: 100%

Rare Loot Chance
The percent probability that a random loot crate will contain a mech or lostech or other high value gear. Mission related crates are always rare. Crates dropped by enemies when you kill them cannot contain mechs (of course, but I actually had to tell it explicitly not to).
Default: 5%
Minimum: 0
Maximum: 100%


Star League Cache Loot Chance
The percent probability that a rare loot crate will be an ultra-rare Star League cache
Default: 5%
Minimum: 0
Maximum: 100%

Rare Loot C-bill Threshold
Standard weapons or equipment with a vase value higher than this number (in thousands of C-bills) will only show up in rare loot crates.
Default: 500
Minimum: 150
Maximum: 10000

C-bill Payout
None: No c-bills in loot crates
Default: Whatever the vanilla c-bill value for the crate was (this is compatible with other mods, including BetterCrates)
Leveled 1x - 3x: Generates a new amount of c-bills based on mission difficulty, 2x and 3x are double and triple the leveled amount, respectively
Default: Leveled

Average Mech Tier
Weights the mech RNG towards mechs of this tier; rare mechs will be this tier +1
Leveled: Mech tier for mechs in loot crates is based on mission difficulty
Tier 0-9: Select a tier to weight mechs towards that specific tier
Default: Leveled

Average Weapon Tier
Weights weapon RNG towards weapons of this tier; rare weapons will be this +1
Leveled: Weapon tier is based on mission difficulty
Tier 1-5: Select a specific tier to weight weapons towards that tier
Default: Leveled

Rare Loot C-bill Threshold (in thousands of c-bils)
Standard (not lostech) weapons and equipment with a base value higher than this number (in thousands) will be considered rare and will only drop in rare crates
Default: 500

Junk Loot C-bill Threshold (in thousands of c-bills)
Weapons or equipment with a base value lower than this number (in thousands) will not spawn in loot crates (Warning: Some really valuable lostech has a low c-bill base value, so be careful when adjusting this)
Default: 1

New Tech Standardization Timeline
Number of years after a new tech is discovered before it shows up in standard (non-rare) loot crates. For example, when Double Heatsinks reach mass production in 3041, you won't see them in standard loot crates until 3046. This is just to emulate the amount of time it takes for a new technology to spread and become ubiquitous.
Default: 5
Minimum: 0
Maximum: 100

Enable new Loot in Resupply (Empty) crates
Some random loot crates will contain nothing. The vanilla game has these provide a small ammo reload and armor repair. Enabling this setting will cause these crates to generate random loot according to the above loot chances. Still subject to fallback behavior if there's an error, so you may occasionally still see empty crates. There's also some bugs in the dialogue system so you may not get audio or text cues for crates, but they still contain loot that you'll see at the mission rewards screen after the mission.
Default: Enabled

Enable new Loot in Treasure Hunter Job crates
When enabled, Treasure Hunter loot crates will generate random loot. Still subject to fallback behavior if there's an error.
Default: Enabled

Enable new Loot in Objective Raid Mission crates
When enabled, Objective Raid loot crates will generate random loot. Still subject to fallback behavior if there's an error.
Default: Enabled

Enable new Loot in Intel crates
If enabled, loot crates containing bounty hunter intel will generate random loot. Still subject to fallback behavior if there's an error. This feature is untested, since I'm not even sure how these crates spawn yet, and the feature appears only partially implemented in PGI's code. Caveat Player.
Default: Enabled

Weapon Drops Include Ammo Bins
When enabled, loot crates that contain weapons will also include at least one matching ammo bin.
Default: Disabled

Customize Loot Crate Detection and Scan Distance
Allows you to customize the distance at which you will detect or be able to scan a loot crate. If you choose sensor-based, the mod will find the highest sensor range of a mech in your lance, calculate a multiplier based on that mech's sensor range divided by 800 (the default base sensor range) then multiply that multiplier by the number you set on the slider.
Disabled: The game uses the default detection and scan distances of 150m and 26m
Manual: Use the detection and scan distance you specify below
Sensor-based: Use the detection and scan distance below to set the base distance, which is multiplied by your sensor range bonuses
Default: Sensor-based

Loot Crate Detection Distance
The base distance in meters at which Ryana will notify you that a loot crate is nearby. Multiplied by your sensor range bonus if you use the sensor-based distance setting.
Vanilla: 137m
Default: 150m
Minimum: 10m
Maximum: 500m

Loot Crate Scan Distance
The distance in meters at which you can scan a detected loot crate for Ryana to pick it up. Multiplied by your sensor range bonus if you use the sensor-based distance setting.
Version 3: This is now decoupled from Detection Distance, so once a crate is detected you can scan it from this distance even if Detection Distance is shorter.
Vanilla: 25m
Default: 50m
Minimum: 5m
Maximum: 500m

Scan Time Mode
Select how you would like the scan time to be determined. If you use sensor-based, the base scan time is the scan time you set below, but equipping an EW Active Probe reduces the scan time. Equipping a Beagle or mod-added Active Probe will reduce the scan time further.
Disabled: Scan time is the vanilla default of 3 seconds
Manual: Use the slider below to set the scan time
Sensor-based: Use the slider below to set the base scan time, which is reduced if you have an Active Probe type equipment installed in a mech in your lance
Default: Sensor-based

Base Scan Time (seconds)
Adjusts how long it takes to scan a loot crate. When using Sensor-based Scan Time Mode, this is reduced based on the type and quality of Active Probe equipment you have installed on a mech in your lance.
Vanilla: 3s
Default: 5s
Minimum: 0s
Maximum: 10s

Customize Automatic Scanning
Allows you to automatically scan loot crates to pick them up without needing to manually press and hold a button.
Disabled: No automatic scanning ever
Enabled: Always automatic scan
Sensor-based: Automatic scanning is enabled if you have a Beagle or other advanced Active Probe equipped in your lance

Customize Loot Crate Map Markers for detected crates
Creates a map and compass indicator for loot crates you have detected but not yet scanned.
Disabled: No map markers ever
Enabled: Always show map markers
Sensor-based: Equipping an Active Probe equipment in your lance will enable map markers.

Customize Loot Crate Scan Overlay Effect for scanned crates
The "Scan overlay effect" makes loot crates visible through buildings and terrain. By default, the game enables this effect when you're within scanning range, then disables it when the crate has been scanned.
Disabled: Scan Overlay is only visible when in scanning range (similar to vanilla behavior)
Enabled: Scan Overlay is always visible once a crate has been scanned
Sensor-based: Equipping an Active Probe equipment in your lance will enable the scan overlay effect

AI Lancemate Detection and Scanning
If enabled, AI Lancemates can detect and collect loot crates when they are in range. This does NOT add any new lancemate orders, and the AI will not be aware that a loot crate is in range so they may move out of range before collecting the loot crate, depending on their current orders. Note that AI lancemate scanning will play the scanning audio but will not display a scanning progress bar.
Default: Disabled

Customize Loot Crate Indicators
Enables the options below it to do things. Allows you to customize indicator "light tower" color, size, and brightness. If this is disabled, all the indicator settings below will do nothing.
Default: Disabled
Removed in v3.2

Bright Indicators
If enabled, makes loot crate indicators brighter and more visible. DLC4 includes brighter vanilla indicators, which this mod will override, letting you choose between bright, and old-style dim indicators.
Enabled: Bright indicators for all crates
Disabled: Old-style dim indicators for all crates
Default: Enabled

Loot Crate Indicator Scale Multiplier
Multiplies the size of the loot crate indicator light towers. A setting of 2 will double the size of the light towers.
Default: 1
Minimum: 1
Maximum: 5

Random Loot Indicator/Marker Color
The color of random loot crate indicator light towers and map markers.
Default: Cyan

Cantina Job Indicator/Marker Color
The color of Treasure Hunter cantina job loot crate indicator light towers and map markers.
Default: Gold

Objective Raid Mission Indicator/Marker Color
The color of Objective Raid loot crate indicator light towers and map markers.
Default: Green

Intel Indicator/Marker Color
The color of Bounty Hunter Intel loot crate indicator light towers and map markers.
Default: Red

Rare Loot Indicator Color
The color of rare loot crate indicator light towers and map markers.
Default: White

Star League Cache Loot Indicator Color
The color of ultra-rare Star League Cache indicator light towers and map markers.
Default: White

Standard Crate Mission-Start Map-only Markers
If enabled, displays markers on the mission map (but not in the HUD) at mission start. Options include Disabled and 7 marker icons to choose from.
Default: Stacked Crates Unidentified Marker

Rare Crate Mission-Start Map-only Markers
If enabled, displays markers on the mission map (but not in the HUD) at mission start. Options include Disabled and 7 marker icons to choose from.
Default: Stacked Crates Unidentified Marker

Star League Cache Mission-Start Map-only Markers
If enabled, displays markers on the mission map (but not in the HUD) at mission start. Options include Disabled and 8 marker icons to choose from.
Default: Stacked Crates Unidentified Marker

Mission-Start Map-only Marker Color
Specify the colors used for Mission Start Map-only markers. All crates can be the same color as the Random/Standard indicator color, or each crate will set its color based on its Objective/Rarity indicator color. Does not affect the "Default XXX Marker" icon options.
Default: Objective/Rarity color
Random/Standard color: Starting map markers will all be the same color as Random standard loot crates, with no indication of crate type or rarity
Objective/Rarity color: Starting map markers will be color set based on the crate type or rarity of the crate

Cheat: Turn Random Loot Crate Indicators On at Mission Start
Turns loot crate indicator light towers on at mission start for random loot crates, making them visible before you detect the loot crates. Turning both of these on / up to max is effectively a cheat, allowing you to see almost all loot crates across the entire map from mission start. Does not apply to Raid or Job crates.
Default: Disabled

Cheat: Find Renaissance / Clan Loot early
Allows for rare (lostech) loot crates to drop renaissance and clan gear before their official intro dates. Turning this on is effectively a cheat as you can get advanced clan tech (with mods) or advanced mech chassis long before they should show up in-lore.
Default: Disabled

Cheat: Infinite Detection Distance
Does what it says (ish). Sets detection distance to 10,000m.
Default: Disabled

Cheat: Infinite Scan Distance
Same, but for scan distance.
Default: Disabled

Extras: Weapon Drops Include Ammo Bins
If enabled, loot crates that drop weapons will include matching ammo bins
Default: Disabled

Extras: Enable Star League Caches
If enabled, there is a rare chance that a rare loot crate will contain a lot of Star League era
goodies. These caches also spawn defenders, so be prepared to fight for
the salvage! Star League caches will show up as sensor anomalies with a
new optional objective at mission start when they spawn.
Default: Enabled

Extras: Repair & Reload Player Lance on Pickup
Allows you to configure the game's default behavior of repairing and reloading a small amount when you collect a loot crate. The repair/reload amount still uses vanilla values.
Disabled: No repair/reload
Collecting Player Only: The player who scans the crate gets the rearm
Entire Player Lance: All lancemates get a small repair/reload when a crate is scanned
Default: Collecting Player Only

Extras: Mute Ryana loot crate callouts
If enabled, Ryana's repetitive voice dialogue will never play when you collect a loot crate.
Default: Disabled

DEBUG Setting
Outputs debug data to a log file. Use this only if I ask you to for helping me identify a bug.
Disabled: No logging (Default)
Basic: Basic debug information
Advanced: Detailed debug logging
Default: Disabled


===========
Secret Sauce
===========
This mod works by editing the TreasureActor class blueprint, the actor that represents a loot crate, so that on BeginPlay a new function is called that generates completely new loot, ignoring the loot already generated by ScenarioGen. Based on weights assigned by the settings in the Mod Options menu, the new loot generation function will choose whether to generate a mech, equipment, or weapon. It then builds a list of valid loot, accounting for DLC, intro date, lostech, and difficulty level, and then randomly selects a random loot item randomly completely at random.

The list of valid loot is built using ALL valid Data Asset types of the given class - so mods that add mechs, variants, equipment, or weapons will have their assets show up in these loot crates. Even clan gear. No special action is required by you. The other mod creator only needs to ensure the asset's Intro Date, tech level, and tier are all set correctly, which they should be anyway, but I can't guarantee the quality of other modders' work.

This all happens during the BeginPlay event when you start a new mission. With version 3 or later there is a brief frame drop at mission start while the generator runs. This only happens once per mission or after changing game settings, and is only really noticeable when there are a lot of loot crates on the map. Loot crates that spawn when an enemy is destroyed should not cause any performance dips, since most of the RNG was done at mission start.

============
Requirements
============
BobbertModdert's Mod Options - https://www.nexusmods.com/mechwarrior5mercenaries/mods/537
Note: You may get an error that Mod Options has not been updated for DLC5 and has been disabled. In my testing, the current version still works, you just have to re-enable it in the mods menu.


============
Installation
============
Extract the files directly into your Mods folder.
Activate the mod in MW5
Go into Options > Mod Options and customize your settings. (I recommend saving the settings even if you make no changes. This ensures that Mod Options picks up the currect values before you load a mission.)

============
Update
============
Version 6.0 brings us into the DLC6 era.
Install it the same as you normally would, but make sure to enter the Options menu and check / confirm and save your Mod Options before loading your save game.
I recommend opening %localappdata%\MW5Mercs\Saved\Config\WindowsNoEditor\Game.ini in a text editor and removing just the section labeled "StackedCratesConfig" to remove any old options that might cause problems with newer versions.


=======
Removal
=======
Deactivate the mod in MW5
Remove the StackedCrates folder from your Mods folder
Optional: Browse to %LocalAppData%\MW5Mercs\Saved\Config\WindowsNoEditor, open up Game.ini, and delete the section titled "StackedCratesConfig"


=============
Compatibility
=============
This mod only alters a single game component, the TreasureActor class associated with loot crates. It should be fully compatible with any other mod out there. It should also be compatible with mods that add new mechs, weapons, or equipment to the game as long as they were added correctly (including the correct object type, level, intro date, etc).

This mod is compatible with MercTech* and YAML.
* Some restrictions apply.


=========
Integration
=========
I have uploaded the source files if you want to integrate this mod's features into your own mod. If you use this in your mod, please credit and link back to here.
There is one overridden uasset, TreasureActor, which contains all of the modified blueprints. There are a few new blueprints in the class for pulling settings from ModOptions and regenerating loot contents at runtime. These blueprints are tied in to the class's event graph to make sure the relevant functions fire when needed.

This is a modder's resource only. If you are not a modder, don't download it. This resource is offered as-is with no support, warranty, or merchantability. Some restrictions apply. Not available in all areas. Side effects include sleep disruption, fatigue, dry eye, and carpal tunnel. Ask your doctor if modding is right for you.


============
Known Issues
============
- Looted mechs show up properly in the post-drop splash screen but the chassis / variant name does not show up in the objectives payout summary on the salvage screen (just a generic "battlefield loot"). Changing this would require making changes to blueprints that would break compatibility with other mods.
- Sometimes the salvage summary comms message doesn't show up, even when a crate contains valid loot. This is a debounce timer in the original comms dialogue system that I cannot fix.
- MercTech v2 adds "quirks" to mechs as an "EquipmentItem". Since Stacked Crates pulls a list of EquipmentItems for loot generation, these quirks can show up in lootcrates as rather useless equipment items or with names like "???". Since there is no easy way to fix this without either breaking compatibility with other mods or making a dedicated MT patch, this will probably not get fixed.


===============
Version History
===============
Version 1.0
- I FINALLY MADE SOMETHING THAT WORKS!
Version 1.1
- Improves lostech filtering for rare loot drops. Adds an option for time travel.
Version 1.2
- Improves quantity probabilities. Loot crates now regenerate if options are changed mid-mission. Some minor performance tweaks.
Version 2.0
- Adds "Mode" selection for automatic or manual configuration
- Adds ammo bin option
- Adds sensor bonuses
- Adds scan time option
- Adds automatic scan option
- Adds infinite range cheats (per request)
- Adds debug log output
- Cbill multiplier is fully dynamic
- Fixed bug that blocked mech drops
- Numerous other bugfixes and minor tweaks
Version 3.0
- Removes the "Mode" selection and adds more granular per-setting options
- All "mission related" crates (cantina job crates, targeted kill crates, objective raid crates) are now always "rare" crates
- Adds Star League caches
- Adds AI lancemate scanning
- Adds customizable mech/weapon tier options and other settings
- Returns customizable c-bill payout
- Fixed bugs for map markers in multiplayer
- Massive overhaul of the loot generation system to improve performance and support new options
- Numerous other bugfixes and tweaks
Version 3.1
- Fixed bug that prevents new loot from generating if DEBUG is disabled (derp)
- Changed chance for a rare crate that contains a mech to drop a higher tier mech from flat 10% to weighted based on rare crate chance
- Reduced the number of Star League Cache defenders from 1-(MaxRep) to 1-8, based on mission difficulty and cache contents
- Fixed bug that caused Treasure Hunter job mission-start map markers to not match custom colors
- Adjusted default spawn chances for mechs, rare crates, and SL caches
Version 3.2
- Fixed a bug where SL cache defenders only spawn if Debug is set to Advanced (oops)
- Fixed a bug that causes audio to glitch out if you switch mechs while auto-scanning (disabled mech switching during auto-scan, revamped auto scan code)
- Star League Cache objective map markers removed - replaced with map-only marker options
- Added optional map-only markers at mission start with customization
- Removed "Customize Loot Crate Indicator visibility, color, scale" option in Options menu - customization is now on by default (if you actually played with this disabled, let me know)
- Removed Ammo bins from standard loot drops (rare/lostech bins can still drop in rare/SL loot crates)
Version 4.0
- (PGI) New default colors for indicator emitters (light towers) - mod defaults updated accordingly
- (PGI) New "Intel" loot type
- New: Rearm/Reload options
- New: Mute Ryana option (WARNING: This will mute Ryana's callouts for story missions!)
- Fixed: (hopefully?) Bug that caused AI lancemates to shoot at loot crates
- Reordered some options in the Mod Options menu
Version 5.0
- More new options!
- More (hopefully) bugfixes!
Version 6.0
- New features!
- New options!
- Now includes Immersive Smoke! Many thanks to SankaraSamsara for sharing code and resources!
- New bugs for everyone!
- This version works great in singleplayer but I'm still having trouble getting multiplayer sorted out. Also still not compatible with DLC5 story missions.
- The file size is a little larger on this one because it's mid-refactor to try and fix co-op and DLC5 bugs.


==========
To-Do List*
==========
- Add "Supply caches" - the goal is to spawn a half dozen new crates in a single military base location, but it may just end up being a single crate with lots of extra goodies
- Add some fancy scripting so you can obtain mech upgrades (cantina career progress rewards) from loot crates - this is still WIP and annoyingly hard
- Decouple Cantina missions from mech upgrades entirely (this would most likely end up in a separate, but related mod, if I ever get around to it)
- Add an option for automatic pickup of loot crates when within range (for MechCommander mod compatibility) COMPLETE

*Due to other priorities, mostly real life taking up my time, I may never get to any of these. I will try to support bugfixes as much as possible, but new features will take a back seat to earning a paycheck.


===============
Credits goes to:
===============
Me for figuring out how to do this.
yrrot and czolee and all of the other modders in the discord who have helped me problem solve!
BobbertModdert for making Mod Options accessible to other modders.
PGI for making MW5!