Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Attempt to make Luddic Enhancement and AO compatible  (Read 1196 times)

TaylorItaly

  • Lieutenant
  • **
  • Posts: 52
    • View Profile
Attempt to make Luddic Enhancement and AO compatible
« on: February 19, 2020, 12:01:26 PM »

Hello ,

i try hardly to make the two mods compatible.
I hope this is ok ?!?

So i use the suggestion from bblargh3 from :

hi

nice mod, really enjoying it.

just a small issue.  i've been getting CTDs recently, its probably mod conflicts for sure but i'm mentioning it here in hopes of finding a solution or work around.

i'm getting a CTD regarding a fatal slot id (ws 015) not found on hull (dominator_luddic).

i've checked the file and there is a weapon slot there, not sure why it wont notice it.  any ideas? 

i've been having this issue with another mod, the Archean Order, with their mule and buffalo ships.

maybe these two mods don't play nice?

anyways, thanks for any insight you can provide.

Archean Order replaces a lot of vanilla files with its own, and many of those files have significant changes to the slot ids. The mule is particularly likely to cause crashes, because it looks like the author not only edited every single hardpoint but also renamed them from the format "WS 001" to "WS001", so any other mod that makes a mule variant is going to crash with it.

If you get stuck on any crashes that look sort of like "Slot id [WS 010] not found on hull [aurora_ix]," it probably means that some mod created a variant, "aurora_ix" of the vanilla ship "aurora", but archean order deleted the weapon slot [WS 010] in the original file.

So for Archean Order, you can fix this by going into "Starsector\starsector-core\data\hulls", finding the relevant .ship file, opening with a text editor, finding "WS 010" in that file, copying the entire section between (and including) curly brackets, and then pasting it into the same place in the file of the same name in "Starsector\mods\Archean Order TC v1.3.4e\data\hulls". That section is structured as a comma separated list of bracket-enclosed hardpoint definitions, so you need to make sure that each item has a comma after it except the last one.

I've been resolving most of the incompatibilities with Archean Order this way as they come up. It's a really hacky way of fixing it, but it keeps it from crashing, and I haven't had to restart my play through.

I edit the Starsector\mods\Archean Order TC v1.3.4e\data\hulls and insert WS0003 and WS006:

But when i start Starsector i get an Error , saying "Expected , or ] at 313 Character 2 ".

Spoiler

294    {
295      "angle": 90,
296     "arc": 186.360001,
297      "id": "WS0002",
298      "locations": [
299        -3,
300        39.5
301      ],
302      "mount": "TURRET",
303      "size": "SMALL",
304      "type": "HYBRID"
305    },
306    {
307      "angle": -65.224861,
308      "arc": 152.657394,
309      "id": "WS0003",
310      "locations": [
311        45,
312        -26
313      ],
314     "mount": "TURRET",
315      "size": "SMALL",
316      "type": "BALLISTIC"
317    },
[close]

But why , it looks exact as the other entries ?

Any help is welcome !!

Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Attempt to make Luddic Enhancement and AO compatible
« Reply #1 on: February 19, 2020, 01:50:19 PM »

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"
    }
  ],
[close]

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"
        }
    ],
[close]

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"
    }
  ],
[close]

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": []
}
[close]

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": []
}
[close]

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.
Logged

TaylorItaly

  • Lieutenant
  • **
  • Posts: 52
    • View Profile
Re: Attempt to make Luddic Enhancement and AO compatible
« Reply #2 on: February 19, 2020, 02:06:15 PM »

Many thanks for your answer and good statement !!!!

I think i wait for your exellent work and skip the Luddic Enhancement for my very first playthrough of this wonderfull game.... 8)

Thanks for all the work you had put into your mod.
Together with Nex and many others this is truly a masterpiece of 4X Game for me ;
The last time i had so much fun with a 4X Game was X3 , looong ago....
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Attempt to make Luddic Enhancement and AO compatible
« Reply #3 on: February 19, 2020, 05:14:58 PM »

Many thanks for your answer and good statement !!!!

I think i wait for your exellent work and skip the Luddic Enhancement for my very first playthrough of this wonderfull game.... 8)

Thanks for all the work you had put into your mod.
Together with Nex and many others this is truly a masterpiece of 4X Game for me ;
The last time i had so much fun with a 4X Game was X3 , looong ago....

I loved X3! Soo many memories! (off topic but I couldn't help it XD )
Logged