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)

Pages: 1 ... 515 516 [517] 518 519 ... 706

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1699993 times)

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7740 on: July 19, 2021, 02:45:03 PM »

Hmm. You might consider adding the "restricted" tag. But it's kind of hard to say; you might want to have a look through BaseSubmarketPlugin.addShips() to see how it works and see what you might not be accounting for as far as its behavior.

Yeah I was thinking that as well, but looking at the plugin - it is generating a dummy fleet based upon faction doctrine - which presumably follows that if the faction doesn't know the ship, it wouldn't be included in the faction doctrine. However, it is doing this by variant id in some places rather than hull id. So possibly I'm missing a variant override so its being included in the doctrine that way?

Even still, however, once the dummy fleet is created the plugin iterates through each fleet member and checks for:

if (member.getHullSpec().hasTag(Tags.NO_SELL)) continue;

 - so it shouldn't be used if it has that tag. Which all of them should.

At this point I'm a little at a loss as to what could be going on. I'll have to check each submarket plugin too in case there are defaults there, or something.

Unless... hmm since the ship was in an independent market I wonder if it was using the mercenary faction's doctrine - which defaults to independent. Even though I remove the merc tag from everything, I don't actually know if I remove "knownShips" explicitly. That might be another lead.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7741 on: July 19, 2021, 02:59:42 PM »

An independent market should be using the independent faction's ship selection, unless that's changed by a mod.

Question: when are you doing this? onSaveLoad, right? IIRC actions will re-add ships from their .faction file in readResolve(), so if you're trying to remove stuff from knownShips etc you need to do it every time onSaveLoad().
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7742 on: July 19, 2021, 03:13:40 PM »

An independent market should be using the independent faction's ship selection, unless that's changed by a mod.

Question: when are you doing this? onSaveLoad, right? IIRC actions will re-add ships from their .faction file in readResolve(), so if you're trying to remove stuff from knownShips etc you need to do it every time onSaveLoad().

Ah ok now that makes sense. I'm doing it:

    @Override
    public void onNewGame()

and:

    @Override
    public void onGameLoad(boolean newGame)

 - but I'm checking for newGame to be false AND for a custom setting which is enabled by default but could technically be disabled. Looks like I need to remove that setting entirely.

Or is there another overridden method explicitly onSaveLoad()? Not seeing one in BaseModPlugin or ModPlugin.

Anyway, that still doesn't explain to me why "no_sell" wouldn't catch and remove the fleet member from selection before adding anything to the market. But I haven't looked at all of the submarket plugins yet.

One more thing, when is:

      CreateFleetPlugin plugin = Global.getSector().getGenericPlugins().pickPlugin(CreateFleetPlugin.class, params);
      if (plugin != null) {
         return plugin.createFleet(params);
      }

 - actually used? Is it for mod purposes or are there vanilla implementations? The code is obscured so I can't be sure that this wouldn't also cause problems if there is indeed a way to bypass the "no_sell" logic.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7743 on: July 19, 2021, 03:19:26 PM »

CreatFleetPlugin is used in FleetFactoryV3.createFleet()

Or is there another overridden method explicitly onSaveLoad()? Not seeing one in BaseModPlugin or ModPlugin.

onGameLoad, my bad.

Anyway, that still doesn't explain to me why "no_sell" wouldn't catch and remove the fleet member from selection before adding anything to the market. But I haven't looked at all of the submarket plugins yet.

Hmm, doesn't it? You'd need to make sure this alteration of ship hulls happened in every application session. Otherwise - if you re-run the game and load a save where this code of yours doesn't trigger - it'd have unmodified hulls. Hulls (and all other "specs") are per-application-session, not per savefile.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7744 on: July 19, 2021, 03:26:12 PM »

CreatFleetPlugin is used in FleetFactoryV3.createFleet()

Sorry I don't think I was being very clear, I meant what are the circumstances where a plugin would actually be returned non-null? Because if it is, all of the below fleet creation logic is unused in FleetFavtoryV3.createFleet() and it uses the obscure plugin's creation logic instead and returns that CampaignFleetAPI immediately.

Quote
Hmm, doesn't it? You'd need to make sure this alteration of ship hulls happened in every application session. Otherwise - if you re-run the game and load a save where this code of yours doesn't trigger - it'd have unmodified hulls. Hulls (and all other "specs") are per-application-session, not per savefile.

I add the tags under:

    @Override
    public void onApplicationLoad()

 - So I am assuming that handles every application session since it is every time the game starts up? Or is there a time where an application session is restarted after the original application load?

Should I also do it during every onGameLoad just to be safe?
« Last Edit: July 19, 2021, 03:28:36 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7745 on: July 19, 2021, 03:29:54 PM »

Sorry I don't think I was being very clear, I meant what are the circumstances where a plugin would actually be returned non-null? Because if it is, all of the below fleet creation logic is unused in FleetFavtoryV3.createFleet() and it uses the obscure plugin's creation logic instead and returns that CampaignFleetAPI immediately.

There aren't any - you can see there is no implementation of CreateFleetPlugin.

You can see what plugins are added by looking at there SectorAPI.getGenericPlugins() is called.
In particular, see: CoreLifecyclePlugin.addScriptsIfNeeded(), which is where the game registers all the plugins etc.

I add the tags under:

    @Override
    public void onApplicationLoad()

 - So I am assuming that handles every application session since it is every time the game starts up? Or is there a time where an application session is restarted after the original application load?

Ah, that should be fine then.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7746 on: July 19, 2021, 03:39:21 PM »

There aren't any - you can see there is no implementation of CreateFleetPlugin.

You can see what plugins are added by looking at there SectorAPI.getGenericPlugins() is called.
In particular, see: CoreLifecyclePlugin.addScriptsIfNeeded(), which is where the game registers all the plugins etc.

...

Ah, that should be fine then.

Oh gotcha thanks for the info. That rules that out.

Well, then I have no clue as to how this could be happening. It all seems fine on the game's end and the mod's. Since I've never actually seen this occur iirc, I'm probably going to have to reproduce this explicitly and trace it from there based upon an exact context.

Otherwise it seems like a Ghost in the Machine kind of thing. The game has a mind of its own and is just messing with me for fun lol.
  :P

*EDIT*

Wow.. just... wow I am a gigantic moron it seems...  :-[

I decided to triple check the config files, and...

I didn't check for the damaged (D) version of hulls. I added all the faction skin ids like dominator_xiv - but there is no entry for hammerhead_d... so *ahem* that's probably it. Alex, thank you for the help and I am very sorry I wasted your valuable time on my idiocy. I deserve this:

« Last Edit: July 19, 2021, 04:01:32 PM by Morrokain »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7747 on: July 19, 2021, 04:16:57 PM »

Oh, hmm - I don't think (D) versions of hulls are explicitly flagged as being available to factions - they're just kind of used when a hull has d-mods, so that's probably not it.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7748 on: July 19, 2021, 06:15:24 PM »

Oh, hmm - I don't think (D) versions of hulls are explicitly flagged as being available to factions - they're just kind of used when a hull has d-mods, so that's probably not it.

Ah ok. Well I'll have to test more then. Thanks for letting me know.
Logged

6chad.noirlee9

  • Captain
  • ****
  • Posts: 368
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7749 on: July 19, 2021, 08:51:36 PM »

dont feel bad im even more of a gigantic idiot because i had something useful to add but i read yalls convo and ive been drinking so i forgot because i was excited by the discourse

as an addendum im beyond impressed by the professionalism and enthusiastism between like minded individuals in this thread.

SHOUT OUT TO THE ORIGINAL PERSON THAT MADE THIS THREAD!!

what a forward thinking individual
Logged
edit: edit: maybe were just falling with style LOL.  make a bubble, make the space in front of it smaller and just fall forward

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7750 on: July 19, 2021, 09:09:20 PM »

Is there a way to open a specific intel item from within an interaction dialog?

CampaignUIAPI.showCoreUITab seems to do nothing inside a dialog, and VisualPanelAPI.showCore doesn't take an intel arg.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7751 on: July 19, 2021, 11:47:05 PM »

Hmm - to alter the projectile spawns, you could do:
weapon.ensureClonedSpec()
And then manipulate:
weapon.getSpec().getHardpointFireOffsets()
weapon.getSpec().getTurretFireOffsets()
Etc.
Thanks! Just tested this out and it works! Just one issue however - this solution doesn't seem to work with beam weapons - the beam line itself disappears when moving the projectile spawns this way.... I simply changed my plans and decided to move a projectile weapon instead.
Logged

Originem

  • Purple Principle
  • Captain
  • ****
  • Posts: 430
  • Dancing like a boss.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7752 on: July 20, 2021, 03:39:49 AM »

How to get the button input event(trigger after press the button) in CustomDialogDelegate?
And, is there anyway to refresh the whole panel manuelly? It seems there is no "remove" function here.
Logged
My mods


shoi

  • Admiral
  • *****
  • Posts: 650
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7753 on: July 20, 2021, 06:35:32 AM »

Ah, hmm - doesn't look like there is, actually. Let me add:
void removeAssignment(AssignmentInfo info);
To CombatTaskManagerAPI.

That will help me out a ton! Thanks so much!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7754 on: July 20, 2021, 10:23:10 AM »

SHOUT OUT TO THE ORIGINAL PERSON THAT MADE THIS THREAD!!

what a forward thinking individual

Haha, indeed!

Is there a way to open a specific intel item from within an interaction dialog?

CampaignUIAPI.showCoreUITab seems to do nothing inside a dialog, and VisualPanelAPI.showCore doesn't take an intel arg.

I don't *think* so? Let me add this to VisualPanelAPI:
void showCore(CoreUITabId tabId, SectorEntityToken other, Object custom, CoreInteractionListener listener);

Thanks! Just tested this out and it works! Just one issue however - this solution doesn't seem to work with beam weapons - the beam line itself disappears when moving the projectile spawns this way.... I simply changed my plans and decided to move a projectile weapon instead.

I'm pretty sure others have done this with beam weapons, hmm.

How to get the button input event(trigger after press the button) in CustomDialogDelegate?

I don't think you can - either customDialogConfirm() or customDialogCancel() gets called but the event isn't passed along.

And, is there anyway to refresh the whole panel manuelly? It seems there is no "remove" function here.

Oh, hmm. I don't think there is, actually, that's... a bit of an oversight. Let me add this to UIPanelAPI:
void removeComponent(UIComponentAPI component);

That will help me out a ton! Thanks so much!

*thumbs up*
Logged
Pages: 1 ... 515 516 [517] 518 519 ... 706