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: [Modding] Change how the game checks for automated ships.  (Read 264 times)

Lukas04

  • Admiral
  • *****
  • Posts: 556
    • View Profile
[Modding] Change how the game checks for automated ships.
« on: May 24, 2024, 07:51:32 AM »

Mods love to add their own types of automated ships, but a part that tends to be annoying is the reliance on the automated ships hullmod.
Sometimes mods would prefer to add their own handling of automated points, or have extra flavor, different icon or utility added to the hullmod, but as it is you have to add the hullmod on all automated ships, as otherwise the officer picker wont recognize it as an automated ship.

So my suggestion is to either:

1. Add a "automated" tag to hullmods and use this for detecting if something is an automated ship.
2. Check if any of the ships hullmods inherit from the "Automated" hullmods plugin.

Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24747
    • View Profile
Re: [Modding] Change how the game checks for automated ships.
« Reply #1 on: May 24, 2024, 10:23:56 AM »

Thank you for the suggestion!

What I did is add an "automated" tag to ship hulls and variants - I think in most cases it'll be easier to just add that in ship_data.csv, and not have to worry about iterating over all the hullmods every time the check is made. (Not that that's likely to be a huge concern, but still, having that check be faster seems good.) And now all the checks go through the various Misc.isAutomated() methods.

Having the Automated hullmod still works, too.
Logged

Lukas04

  • Admiral
  • *****
  • Posts: 556
    • View Profile
Re: [Modding] Change how the game checks for automated ships.
« Reply #2 on: May 24, 2024, 11:12:31 AM »

Thank you for the suggestion!

What I did is add an "automated" tag to ship hulls and variants - I think in most cases it'll be easier to just add that in ship_data.csv, and not have to worry about iterating over all the hullmods every time the check is made. (Not that that's likely to be a huge concern, but still, having that check be faster seems good.) And now all the checks go through the various Misc.isAutomated() methods.

Having the Automated hullmod still works, too.

Thank you, good solution!
As you made the tag work on variants it should do the job (Being able to de-automate/automate specific fleet members has some uses in the modiverse)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24747
    • View Profile
Re: [Modding] Change how the game checks for automated ships.
« Reply #3 on: May 24, 2024, 11:24:49 AM »

Yep, that figures! *thumbs up*
Logged