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: Planet Search Overhaul (07/13/24)

Author Topic: Replacing the Automated Ships skill causes AI cores to no longer drop  (Read 472 times)

Lukas04

  • Admiral
  • *****
  • Posts: 537
    • View Profile

I think this may have been reported before, but there is an ongoing issue where when mods try to change how the Automated Ships skill works, AI cores will no longer drop from opposing fleets.
However, this only starts happening if the player acquires this skill.

I know this is also an issue for the "Quality Captains" mod, but while i have been working on my own skill rework, i stumbled across the same issue.
Luckily i dont need it for the most part, as my AutoShips skill is entirely Seperate, but i still need to overwrite it to avoid a few issues, as the unapply() method would otherwise keep removing the recoverability tag.

For a few reasons however, like other mods checking for the acquirement of the skill, id like to give the player the skill in the background in my mod, but due to the mentioned issue thats not possible.

I tried a few things but i couldnt really pin down as to why it happens, i also havent found anything of note when looking through the code.
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Replacing the Automated Ships skill causes AI cores to no longer drop
« Reply #1 on: August 09, 2024, 08:26:28 AM »

Moving this from bug reports! I'm not sure why this would happen, and I'm a bit skeptical that just replacing the automated ships skill would cause it (though anything is possible), but either way this would most likely be a bug in the mod in question.

The AI core drops are - IIRC - handled in FleetEncounterContext.lootWeapons(), by the way. Offhand, it's not clear how this would be influenced by the presence of the AS skill, but maybe something like "if a skill makes all automated ships recoverable, and somehow the cores from recoverable ships aren't looted" (in which case, that probably *would* be a vanilla bug), or something along those lines. I really haven't dug into it, though.
Logged

Lukas04

  • Admiral
  • *****
  • Posts: 537
    • View Profile
Re: Replacing the Automated Ships skill causes AI cores to no longer drop
« Reply #2 on: August 09, 2024, 09:27:16 AM »

Moving this from bug reports! I'm not sure why this would happen, and I'm a bit skeptical that just replacing the automated ships skill would cause it (though anything is possible), but either way this would most likely be a bug in the mod in question.

The AI core drops are - IIRC - handled in FleetEncounterContext.lootWeapons(), by the way. Offhand, it's not clear how this would be influenced by the presence of the AS skill, but maybe something like "if a skill makes all automated ships recoverable, and somehow the cores from recoverable ships aren't looted" (in which case, that probably *would* be a vanilla bug), or something along those lines. I really haven't dug into it, though.

Alright i did a bunch more testing by creating my own mod for it, and it appears that the issue is a vanilla one, not a modded one.
After bringing it up to someone else, they linked me to this thread: https://fractalsoftworks.com/forum/index.php?topic=29791.0

Anyways, as you appear to have it fixed already, it should be fine.
On that note though, i asume using Hull-Restoration worsens the bug, as while i am not entirely sure, its modifier appears to be used for all recoveries (even enemy ones?)

For some reason people are more aware of the issue in modded playthroughs, might just be that the mods that change the skills make people use that specific one more.
« Last Edit: August 09, 2024, 09:33:10 AM by Lukas04 »
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Replacing the Automated Ships skill causes AI cores to no longer drop
« Reply #3 on: August 09, 2024, 09:53:30 AM »

Ahh, makes sense, thank you!

On that note though, i asume using Hull-Restoration worsens the bug, as while i am not entirely sure, its modifier appears to be used for all recoveries (even enemy ones?)

Right, yeah. Though how many enemy ships are recoverable is iirc not that straightforward? But I don't remember all the details.
Logged