For the constants, you can create a StreamingAssets folder in your mod folder, then put a data folder in there, and then a constants and simGameConstants in there. In those folders, you can put your updated constants/simgameconstants files. You don't have to do the whole file, and you don't need to add anything to the mod.json file (at least with ModTek). Can just do the parts you change, with some caveats. Stuff at the root level you can just do, but stuff inside arrays (the [] blocks), I believe you have to do the entire array. The ModTek readme and/or the files on the wiki on ModTek's github page lays it all out. And of course, the file name needs to be the same as the file you're want to overwrite bits of.
To illustrate what I mean, this is the start of simGameConstants.json, and let's say this is the bit in which you wanted to make changes:
{
"Player1sMercUnitHeraldryDef" : {
"Description": {
"Id": "heraldrydef_company",
"Name": "Mason's Marauders",
"Details": "This is the heraldry def from SimGameConstants",
"Icon": "",
"Cost": 0,
"Rarity": 1,
"Purchasable": false
},
"displayName": "Mason's Marauders Company Heraldry",
"textureLogoID": "envTxrHrld_set01_01",
"primaryMechColorID": "Blue_05",
"secondaryMechColorID": "Yellow_02",
"tertiaryMechColorID": "Greyscale_05",
"HERALDRY_VERSION": 1
},
If you wanted to change that default "displayName", all you'd need in your simGameConstants.json file is:
{
"displayName": "Haley's Harbingers of Hatred Company Heraldry"
}
And if I recall correctly, if I just wanted to change the "Name" in the Player1sMercUnitHeraldryDef", it'd be like this:
(
"Player1sMercUnitHeraldryDef" : {
"Description": {
"Name": "Mason's Marauders"
}
}
}
But if I wanted to change the range values on an stock Small Laser so that its short range ends at 60m rather than 90m, it'd be this, the entire array, even though I'm only interested in changing the the first two indexes in the array:
{
"RangeSplit" : [
60,
60,
90
]
}
The reason you only want to include as little as possible is that it reduces the risk of conflicting with another mod or a patch. It also makes it easier to see what you've changed.
Note that you can do this for any of the base game json files. Want to change ranges on weapons? You can do that this way. Want to add the Warhammer's capacitors to the Panther? Can be done this way as well, even though the Panther file doesn't even that section by default.
Alternately, and again this works with ModTek, not sure about HBS's system, you can do an advanced jsonmerge. So from one of the mods I'm working on, I have this in my mod.json file:
{ "Path": "vehicleChassis_merged", "Type": "AdvancedJSONMerge" },
And inside my vehicleChassis_merged folder, I have a file that contains this:
{
"TargetIDs": ["vehiclechassisdef_STRIKER"],
"Instructions": [
{
"JSONPath": "$.Locations..InternalStructure",
"Action": "Replace",
"Value": 20
}
]
}
This tells it to find the chassisdef for the Striker, then go inside it to any InternalStructure found within the locations' array's members, and replace the value there (it's 4) with 20. A bug fix for the Striker having incorrect values for its structure. If I wanted to, I could add other target ids and change their structure to 20 as well in the same go. Or I could add another instruction and do something else to the Striker. So here, I don't have to include the entire Locations section, but instead, I rely on the AdvancedJsonMerge's path code to change just what I want. If you do a search for "stefan.goessner jsonpath" that should turn up an article that lays out how the pathing works.
But it can be a bit of work to figure out how the pathing works (and it can be told to only do the instruction if a certain condition is true). And speaking of that "how pathing works" bit, I'm not actually sure how to point it at the info from a constant file. Haven't checked into it at all, as I used the first method for those. I expect it would work for contracts, though, as they have an ID... "ID" : "AmbushConvoy_BackyardBarbecue",
Edit: Also worth noting, that both these methods work only for files found in the streamingAssets/data folder.