Hi I saw your post in the Luddic Enhancement mod thread. First off, this is totally fine that you are trying to do this yourself.
Keep in mind this post, however:
Thanks for that description! I'm working on changes along those lines for the next update anyway, but since you have taken the time to do this already - am I correct in implying from this that I won't have to change all the variant files' corresponding references to those ids in regards to their weapon loadouts in the mod?? That would be awesome if true! I kind of assumed I would have to edit each variant file by hand for that part.
Not crashing is already a great start, but did this seem to mess with the variants at all from your playthrough or upon starting a new game? Also, if you are adding the ids, not replacing the old ones, it may cause additional weapon slots to be available upon the ship outfitting screen (sometimes in the exact same place so it can be hard to see).
Those are all assumptions, though. I've already handled weapons in the variants, but I was planning on working on the weapon ids last- after fighters and hullmods were corrected to be merge-able.
Essentially there will probably be more changes required than just the weapon mounts, but I'll give an example using the Mule since it is the most commonly reported merging problem.
Below is the Archean Order definition of the Mule's weapon slots:
Spoiler
"weaponSlots": [
{
"angle": 0,
"arc": 5,
"id": "WS 001",
"locations": [
20,
39
],
"mount": "HARDPOINT",
"size": "SMALL",
"type": "MISSILE"
},
{
"angle": 0,
"arc": 5,
"id": "WS 002",
"locations": [
20,
-39
],
"mount": "HARDPOINT",
"size": "SMALL",
"type": "MISSILE"
},
{
"angle": 0,
"arc": 227.258759,
"id": "WS 003",
"locations": [
59,
0
],
"mount": "TURRET",
"size": "MEDIUM",
"type": "SYNERGY"
},
{
"angle": 180,
"arc": 150,
"id": "WS 005",
"locations": [
-57,
0
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": -90,
"arc": 186.360001,
"id": "WS0001",
"locations": [
-3,
-39.5
],
"mount": "TURRET",
"size": "SMALL",
"type": "HYBRID"
},
{
"angle": 90,
"arc": 186.360001,
"id": "WS0002",
"locations": [
-3,
39.5
],
"mount": "TURRET",
"size": "SMALL",
"type": "HYBRID"
},
{
"angle": -65.224861,
"arc": 152.657394,
"id": "WS0003",
"locations": [
45,
-26
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": 65.224861,
"arc": 152.657394,
"id": "WS0004",
"locations": [
45,
26
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": 0,
"arc": 0,
"id": "WS0005",
"locations": [
65.5,
-19
],
"mount": "HIDDEN",
"size": "SMALL",
"type": "SYSTEM"
},
{
"angle": -0,
"arc": 0,
"id": "WS0006",
"locations": [
65.5,
19
],
"mount": "HIDDEN",
"size": "SMALL",
"type": "SYSTEM"
}
],
This is the vanilla implementation:
Spoiler
"weaponSlots": [
{
"angle": 0,
"arc": 5,
"id": "WS 001",
"locations": [
21,
39
],
"mount": "HARDPOINT",
"size": "SMALL",
"type": "MISSILE"
},
{
"angle": 0,
"arc": 5,
"id": "WS 002",
"locations": [
21,
-39
],
"mount": "HARDPOINT",
"size": "SMALL",
"type": "MISSILE"
},
{
"angle": 0,
"arc": 270,
"id": "WS 003",
"locations": [
60,
0
],
"mount": "TURRET",
"size": "MEDIUM",
"type": "COMPOSITE"
},
{
"angle": 90,
"arc": 210,
"id": "WS 004",
"locations": [
-2,
40
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": 180,
"arc": 150,
"id": "WS 005",
"locations": [
-56,
0
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": -90,
"arc": 210,
"id": "WS 006",
"locations": [
-2,
-40
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
}
],
I've highlighted the brackets since that seems to be the likely source of the error you are getting, but the main thing here is the weapon ids (also in bold).
If you see the Archean Order version, you'll notice differing ids since the ship editor adds a zero and I've heavily modified most if not all vanilla ships for the combat balance changes. So instead of copy pasting the whole entry, it may just be easier to reference the ids and make them match the vanilla version. As far as size and type, I don't
think that will matter every time in the current Starsector version, but in the past this could potentially cause a really obscure nullpointer from combat main- so be aware of that. If you get that error, it will not give you a file location to troubleshoot most likely, so my advice would be to try and edit one ship/variants at a time and run Archean Order standalone for each ship you modify to make sure you haven't caused that.
The example I am going to give will also demonstrate further potential complications in that regard. (This may end up being more difficult than you think, but I could be wrong there)
New Archean Order Mule's weapons after changes:
Spoiler
"weaponSlots": [
{
"angle": 0,
"arc": 5,
"id": "WS 001",
"locations": [
20,
39
],
"mount": "HARDPOINT",
"size": "SMALL",
"type": "MISSILE"
},
{
"angle": 0,
"arc": 5,
"id": "WS 002",
"locations": [
20,
-39
],
"mount": "HARDPOINT",
"size": "SMALL",
"type": "MISSILE"
},
{
"angle": 0,
"arc": 227.258759,
"id": "WS 003",
"locations": [
59,
0
],
"mount": "TURRET",
"size": "MEDIUM",
"type": "SYNERGY"
},
{
"angle": 180,
"arc": 150,
"id": "WS 005",
"locations": [
-57,
0
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": -90,
"arc": 186.360001,
"id": "WS0001",
"locations": [
-3,
-39.5
],
"mount": "TURRET",
"size": "SMALL",
"type": "HYBRID"
},
{
"angle": 90,
"arc": 186.360001,
"id": "WS0002",
"locations": [
-3,
39.5
],
"mount": "TURRET",
"size": "SMALL",
"type": "HYBRID"
},
{
"angle": -65.224861,
"arc": 152.657394,
"id": "WS 006",
"locations": [
45,
-26
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": 65.224861,
"arc": 152.657394,
"id": "WS 004",
"locations": [
45,
26
],
"mount": "TURRET",
"size": "SMALL",
"type": "BALLISTIC"
},
{
"angle": 0,
"arc": 0,
"id": "WS0005",
"locations": [
65.5,
-19
],
"mount": "HIDDEN",
"size": "SMALL",
"type": "SYSTEM"
},
{
"angle": -0,
"arc": 0,
"id": "WS0006",
"locations": [
65.5,
19
],
"mount": "HIDDEN",
"size": "SMALL",
"type": "SYSTEM"
}
],
In this case, the only thing I would have to change is to make "WS 004" and "WS 006" available-
but!- considering the "WS0006" is a HIDDEN type weapon slot, we can't just take away the zero in this case, and so I changed "WS0003" to "WS 006" since they are both small ballistic mounts.
Now, take a look at the Mule's variant files from Archean Order. ("\Fractal Softworks\Starsector\mods\Archean Order TC v1.3.4e\data\variants\mule")
Here an example of the standard variant:
Spoiler
{
"displayName": "Mining",
"fluxCapacitors": 5,
"fluxVents": 16,
"goalVariant": true,
"hullId": "mule",
"hullMods": [
"frontemitter",
"unstable_injector"
],
"permaMods": [],
"quality": 0.5,
"variantId": "mule_Standard",
"weaponGroups": [
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS 003": "archean_mininglaser"
}
},
{
"autofire": false,
"mode": "LINKED",
"weapons": {
"WS 001": "archean_stinger",
"WS 002": "archean_stinger"
}
},
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS0001": "archean_microlaser",
"WS0002": "archean_microlaser"
}
},
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS0003": "archean_heavymg",
"WS0004": "archean_heavymg"
}
},
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS 005": "archean_vulcan"
}
}
],
"wings": []
}
See the bold portion. That references ids that no longer exist! That may cause further issues, so each variant of the stock Mule (this doesn't even include skin files which may also include id references when changing weapon size or type - or removing weapons, etc) would also need the changes from the ship file reflected on the variant- like below:
Spoiler
{
"displayName": "Mining",
"fluxCapacitors": 5,
"fluxVents": 16,
"goalVariant": true,
"hullId": "mule",
"hullMods": [
"frontemitter",
"unstable_injector"
],
"permaMods": [],
"quality": 0.5,
"variantId": "mule_Standard",
"weaponGroups": [
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS 003": "archean_mininglaser"
}
},
{
"autofire": false,
"mode": "LINKED",
"weapons": {
"WS 001": "archean_stinger",
"WS 002": "archean_stinger"
}
},
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS0001": "archean_microlaser",
"WS0002": "archean_microlaser"
}
},
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS 006": "archean_heavymg",
"WS 004": "archean_heavymg"
}
},
{
"autofire": true,
"mode": "LINKED",
"weapons": {
"WS 005": "archean_vulcan"
}
}
],
"wings": []
}
So if you are up for that kind of complexity, go for it! Just keep in mind I am working on this too, so if it ends up being too crazy no worries! I will have a fix out for all this stuff in time.