Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Hiroyan495 on July 12, 2020, 01:38:54 AM

Title: Is there a way to disable hullmods for AI?
Post by: Hiroyan495 on July 12, 2020, 01:38:54 AM
Is it possible to remove hullmods from the pool of those, that the A.I. can freely pick in their loadouts?
Title: Re: Is there a way to disable hullmods for AI?
Post by: Mondaymonkey on July 12, 2020, 01:45:38 AM
Why not just remove it from faction "known hullmods" section?
Title: Re: Is there a way to disable hullmods for AI?
Post by: Hiroyan495 on July 12, 2020, 01:47:44 AM
Oh, thank you very much. That was exactly the simple solution I was looking for. Bless you.  8)

Edit: What do the tags mean in those .faction files? Are they inclusive of a set of hullmods or do they have some other purpose?
Title: Re: Is there a way to disable hullmods for AI?
Post by: Mondaymonkey on July 12, 2020, 02:19:51 AM
Oh, thank you very much. That was exactly the simple solution I was looking for. Bless you.  8)

Edit: What do the tags mean in those .faction files? Are they inclusive of a set of hullmods or do they have some other purpose?

OK. Lets take an example. Why not hegs?

Spoiler
   "knownHullMods":{
      "tags":["base_bp", "hegemony"],
      "hullMods":[
         "advancedshieldemitter",
         "turretgyros",
         "armoredweapons",
         "augmentedengines",
         "autorepair",
         "expanded_deck_crew",
         "magazines",
         "missleracks",
         "extendedshieldemitter",
         "frontemitter",
         "frontshield",
         "heavyarmor",
         "insulatedengine",
         "targetingunit",
         "nav_relay",
         "operations_center",
         "fluxbreakers",
         "stabilizedshieldemitter",
         "frontshield",  # makeshift
         "surveying_equipment",
         "efficiency_overhaul",
      ],
[close]

List of "hullMods" determine the id of hullmods they know. Simple yet, right?

"tags" will add to this list all hullmods that have those listed tags. We have "base_bp" and "hegemony" tags. So, lets go to the hull_mods.csv and see which hullmods it is. OK that was bad example, as non of vanilla hullmods does not contain those  tags, but if they are - they would be added. Also, IIRC faction have access to all by-default allowed hullmods (true in unlocked column), which are:
Spoiler
Auxiliary Thrusters
Blast Doors
Dedicated Targeting Core
Flux Coil Adjunct
Flux Distributor
Hardened Subsystems
Reinforced Bulkheads
Safety Overrides
Unstable Injector
Additional Berthing
Auxiliary Fuel Tanks
Expanded Cargo Holds
Militarized Subsystems
[close]
Title: Re: Is there a way to disable hullmods for AI?
Post by: Hiroyan495 on July 12, 2020, 02:22:23 AM
Daaaaamn, thanks a lot, you really took some of your time for me there, but it helped me understand a lot.  ;D
Title: Re: Is there a way to disable hullmods for AI?
Post by: Mondaymonkey on July 12, 2020, 02:31:59 AM
Daaaaamn, thanks a lot, you really took some of your time for me there, but it helped me understand a lot.  ;D

Also, I have never seen someone actually used it, but FactionAPI.java contains some weird strings:

   void addPriorityHullMod(String modId);
   void removePriorityHullMod(String modId);
   boolean isHullModPriority(String modId);
   Set<String> getPriorityHullMods();
In other words, it possibly possible (sic!) to add priority section for hullmods:

Code
	"priorityHullMods":{
"tags":[],
"hullMods":[
],
},

Similar to other priority sections in faction file if you wish faction use that hullmod <almost> mandatory. Purely theoretical.