I've been working on a not-so-tiny mod that basically rebuilds a lot of Vanilla data. It's finally in the last stages of development and polish.
What I've discovered along the way is that:
1. Any time we use the
replace operation, no other mod later in the mod load-order can alter that data file, period. This doesn't just lock out Vanilla data; it effectively freezes the file.
This is a real problem when we're talking about the CSVs; if mod A replaces ship_data.csv, then Mod B wants to load up some .ships, nope; if we reverse the load order, then mod A deletes all of mod B's work.
So, instead, I'm basically using replace operations on individual entries in /hulls/ ... lots and lots of data entry, but it's the only safe way to provide for mod-interoperability (and even then, it's a little limited; if Mod A replaces
data\\hulls\\astral.ship for example, no other mod can touch it, period).
It seems a little extreme, when really, all I really want is for Vanilla's assets to
not load. Preferably, by directory and file-type wildcards for ease of production.
Luckily, few mods use replace; most mods that want to do something big have been TCs.
2. In your case, you're running into a problem that's basically
my fault (sorry about that).
I asked Alex if we could make it possible for JSONs to
merge (a .ship file, for example) rather than overwriting one another.
JSON overwrites were a major pain in the rear, for projects that, for whatever reasons, needed to be broken up into segments; it meant that if Mod A needed to make a change to, say, the Tac Laser, then Mod B came along and also did so, only Mod B's changes were preserved.
However, this comes with some major problems, too. If two JSONObject / JSONArray entries / fields get merged, the result is that both are integrated into the whole. This can cause all sorts of interesting problems; the one I've observed the most is that if a Vanilla .ship has been altered by a mod, but hasn't been replaced via mod_info, then all sorts of wonky things can happen.
For example, say you've decided to rework the turrets on, say, the Conquest; you take the ship into SSEd and remove the Vanilla turrets, then add the new ones, perfectly mirrored and all that.
It all looks beautiful and you export your changes, and it all looks OK in-game... until you'll notice something weird; the ship has two turret spots, often really close together (if you used Vanilla positions as a basis).
Why is this happening? Well, whatever utility Alex uses to make .ship files with (which he's never released to the public, so we can only speculate) uses a slightly-different system for naming the turret ids than SSEd does.
This means that Turret A and Turret B may be in what looks like identical positions, but, in terms of merging, they aren't the same at all; their ids don't match (well, providing that Alex's merging code is checking that- IDK whether he addressed that issue but we did talk about it).
So there is more turret in that JSONArray than there used to be, and additional CPU overhead, processing that empty turret, one presumes, and, well, now end-users can put another gun on, if they catch on to that problem. Great
When I realized that that (and other Bad Things) were happening, I started to use replace in the mod_info to address these things. You'll have to do the same thing here, too; you're seeing effects of merges, as well as load order. People still presume load order is all that matters, like in some other games, but it's not... and that's my fault.
Honestly, I think we should:
1. Have an option in mod_info that says, "don't load up any Vanilla assets, period" that isn't TC, where we're wanting to exclude every other mod, too.
2. Have something we can add to a JSON we've altered, that, if present, causes the file in question to overwrite any previous version of the same file, but not files further down the load order.
Then Mod A can overwrite something in Vanilla (or another mod higher on the load order), but Mod B, loading afterwards, can modify Mod A's data in some subtle way (like what you're trying to do here).
3. A
remove option in mod_info, that, if present, will remove the file or directory contents (in memory) so that we can put fresh new things in.
As it is... meh. I have a mod_info that already looks like this:
Spoiler
"replace":[
#SHIP REPLACEMENTS
#DRONES
"data\\hulls\\drone_assault.ship",
"data\\hulls\\drone_borer.ship",
"data\\hulls\\flash.ship",
"data\\hulls\\drone_pd_midline.ship",
"data\\hulls\\lux.ship",
"data\\hulls\\mining_drone.ship",
"data\\hulls\\drone_pd.ship",
"data\\hulls\\drone_sensor.ship",
"data\\hulls\\spark.ship",
"data\\hulls\\drone_terminator.ship",
"data\\hulls\\wasp.ship",
#FIGHTERS
"data\\hulls\\broadsword.ship",
"data\\hulls\\claw.ship",
"data\\hulls\\cobra.ship",
"data\\hulls\\dagger.ship",
"data\\hulls\\gladius.ship",
"data\\hulls\\hoplon.ship",
"data\\hulls\\khopesh.ship",
"data\\hulls\\longbow.ship",
"data\\hulls\\perdition.ship",
"data\\hulls\\piranha.ship",
"data\\hulls\\talon.ship",
"data\\hulls\\thunder.ship",
"data\\hulls\\trident.ship",
"data\\hulls\\warthog.ship",
"data\\hulls\\xyphos.ship",
#FRIGATES
"data\\hulls\\afflictor.ship",
"data\\hulls\\brawler.ship",
"data\\hulls\\centurion.ship",
"data\\hulls\\cerberus.ship",
"data\\hulls\\defender.ship",
"data\\hulls\\dram.ship",
"data\\hulls\\gargoyle.ship",
"data\\hulls\\glimmer.ship",
"data\\hulls\\gremlin.ship",
"data\\hulls\\hermes.ship",
"data\\hulls\\hound.ship",
"data\\hulls\\hyperion.ship",
"data\\hulls\\kite.ship",
"data\\hulls\\lasher.ship",
"data\\hulls\\lumen.ship",
"data\\hulls\\mercury.ship",
"data\\hulls\\merlon.ship",
"data\\hulls\\monitor.ship",
"data\\hulls\\mudskipper.ship",
"data\\hulls\\omen.ship",
"data\\hulls\\ox.ship",
"data\\hulls\\picket.ship",
"data\\hulls\\ravelin.ship",
"data\\hulls\\scarab.ship",
"data\\hulls\\sentry.ship",
"data\\hulls\\shade.ship",
"data\\hulls\\shepherd.ship",
"data\\hulls\\tempest.ship",
"data\\hulls\\vigilance.ship",
"data\\hulls\\warden.ship",
"data\\hulls\\wayfarer.ship",
"data\\hulls\\wolf.ship",
#DESTROYERS
"data\\hulls\\bastillon.ship",
"data\\hulls\\berserker.ship",
"data\\hulls\\buffalo.ship",
"data\\hulls\\buffalo2.ship",
"data\\hulls\\condor.ship",
"data\\hulls\\drover.ship",
"data\\hulls\\enforcer.ship",
"data\\hulls\\fulgent.ship",
"data\\hulls\\gemini.ship",
"data\\hulls\\hammerhead.ship",
"data\\hulls\\harbinger.ship",
"data\\hulls\\medusa.ship",
"data\\hulls\\mule.ship",
"data\\hulls\\nebula.ship",
"data\\hulls\\phaeton.ship",
"data\\hulls\\crig.ship",
"data\\hulls\\scintilla.ship",
"data\\hulls\\shrike.ship",
"data\\hulls\\sunder.ship",
"data\\hulls\\tarsus.ship",
"data\\hulls\\valkyrie.ship",
#CRUISERS
"data\\hulls\\apogee.ship",
"data\\hulls\\aurora.ship",
"data\\hulls\\brilliant.ship",
"data\\hulls\\colossus.ship",
"data\\hulls\\colossus2.ship",
"data\\hulls\\colossus3.ship",
"data\\hulls\\dominator.ship",
"data\\hulls\\doom.ship",
"data\\hulls\\eagle.ship",
"data\\hulls\\falcon.ship",
"data\\hulls\\gryphon.ship",
"data\\hulls\\heron.ship",
"data\\hulls\\mora.ship",
"data\\hulls\\quetzalcoatl.ship",
"data\\hulls\\rampart.ship",
"data\\hulls\\starliner.ship",
"data\\hulls\\venture.ship",
#CAPITAL
"data\\hulls\\acanthus.ship",
"data\\hulls\\astral.ship",
"data\\hulls\\atlas.ship",
"data\\hulls\\atlas2.ship",
"data\\hulls\\conquest.ship",
"data\\hulls\\guardian.ship",
"data\\hulls\\legion.ship",
"data\\hulls\\odyssey.ship",
"data\\hulls\\onslaught.ship",
"data\\hulls\\paragon.ship",
"data\\hulls\\prometheus.ship",
"data\\hulls\\prometheus2.ship",
"data\\hulls\\radiant.ship",
#SKINS
"data\\hulls\\skins\\brawler_tritachyon.skin",
#VARIANTS
"data\\variants\\fighters\\mining_drone_Standard.variant",
#FACTION / WORLD DATA
"data\\world\\factions\\default_fleet_type_names.json",
"data\\world\\factions\\default_ranks.json",
"data\\world\\factions\\default_ship_roles.json",
"data\\world\\factions\\derelict.faction",
"data\\world\\factions\\hegemony.faction",
"data\\world\\factions\\independent.faction",
"data\\world\\factions\\knights_of_ludd.faction",
"data\\world\\factions\\lions_guard.faction",
"data\\world\\factions\\luddic_church.faction",
"data\\world\\factions\\luddic_path.faction",
"data\\world\\factions\\neutral.faction",
"data\\world\\factions\\persean_league.faction",
"data\\world\\factions\\pirates.faction",
"data\\world\\factions\\player.faction",
"data\\world\\factions\\poor.faction",
"data\\world\\factions\\remnants.faction",
"data\\world\\factions\\scavengers.faction",
"data\\world\\factions\\sindrian_diktat.faction",
"data\\world\\factions\\sleeper.faction",
"data\\world\\factions\\tritachyon.faction",
],
...and it's going to get a lot longer before I'm release-ready, I'm guessing.