Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: "no_autofit" on .variant files  (Read 851 times)

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
"no_autofit" on .variant files
« on: December 14, 2021, 11:29:14 AM »

I have to post in the Modding sub-forum now...

For context...
Code
"no_autofit" tag now also works when applied to variants

This doesn't seem to be the case...  :-[

S-mods still aren't preserved in the variants and the game still autofits them if you exceed their "cap."

I realize because I'm generating the fleet via

FleetFactoryV3 and that script doesn't seem to make any mention on no_autofit.
Hmm - do you perhaps have MemFlags.MEMORY_KEY_FORCE_AUTOFIT_ON_NO_AUTOFIT_SHIPS set in the fleet's memory? Or a custom inflater set for the fleet? Because it's checked in the same place as "no_autofit" on the hull spec is checked (see: line 326 in DefaultFleetInflater) and unless I'm just missing something obvious, it's hard for me to see how this might *not* work.
I set them generating a fleet normally via the Lion Guard's HQ and then have a special indication to make all their flagships have a no_autofit variant to which they still autofit them weirdly.

Code
fleet.getFlagship().setVariant(Global.getSettings().getVariant("eis_legion_xiv_Elite"), false, true);

I think I know why it's because when the fleet begins "despawning or docking" to rest at its planet it gets autofitted.

Oh well, I can't stop that.
Hmm, I'm not sure how that'd have anything to do with it, the inflater doesn't know or care about whether the fleet is "docking" - it's just another assignment.

Code
		boolean forceAutofit = fleet.getMemoryWithoutUpdate().getBoolean(MemFlags.MEMORY_KEY_FORCE_AUTOFIT_ON_NO_AUTOFIT_SHIPS);
int memberIndex = 0;
for (FleetMemberAPI member : fleet.getFleetData().getMembersListCopy()) {

if (!forceAutofit && member.getHullSpec().hasTag(Items.TAG_NO_AUTOFIT)) {
continue;
}
if (!forceAutofit && member.getVariant() != null && member.getVariant().hasTag(Items.TAG_NO_AUTOFIT)) {
continue;
}
...
}

I'm wrapping my head around this since "unboardable" on .variant files are working as intended.

"no_autofit" on the hull spec always seems to work "as intended." They do not ever try to refit or autofit once created with the tag on hull spec which leads me to wonder... why the variant has an issue accepting "no_autofit" or maybe it's how the code may be nulling on the variant thus preventing it from being read...

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: "no_autofit" on .variant files
« Reply #1 on: December 14, 2021, 12:04:14 PM »

Ah - do you have no_autofit specified in the .variant file, not added with code? Tags from a .variant file aren't read, they're only intended for dynamic (via-code) changes.
Logged

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: "no_autofit" on .variant files
« Reply #2 on: December 14, 2021, 01:09:02 PM »

Ah - do you have no_autofit specified in the .variant file, not added with code? Tags from a .variant file aren't read, they're only intended for dynamic (via-code) changes.
That makes so much sense now... oh no.

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: "no_autofit" on .variant files
« Reply #3 on: December 14, 2021, 01:23:33 PM »

Is there a way for autofit to ignore

permaMods in .variant files? It seems to just see the permaMods and then toss them away.