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 ... 384 385 [386] 387 388 ... 706

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

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5775 on: December 02, 2019, 07:58:47 PM »

How can I add custom combat messages on the textbox that appears at the top left of the screen during combat? I'd like to show event updates during a mission.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5776 on: December 02, 2019, 08:43:01 PM »

You can do that with the CombatUIAPI, which can be accessed through the combat engine. e.g. Global.getCombatEngine().getCombatUI().addMessage()

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5777 on: December 02, 2019, 08:57:11 PM »

You can do that with the CombatUIAPI, which can be accessed through the combat engine. e.g. Global.getCombatEngine().getCombatUI().addMessage()
Thanks for the quick reply! It worked!
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7174
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5778 on: December 04, 2019, 12:17:25 PM »

Can module weapon slots, image, etc be changed dynamically?

I've tried skin files and they also fail, so I think the answer is "no", unless I want to make actual .variant files for each combination of modules (which is impractical as there are hundreds).
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5779 on: December 04, 2019, 12:57:38 PM »

Yeah, as I remember, module slots are limited to the specific hull type that's in the original variant.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7174
  • Harpoon Affectionado
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5780 on: December 04, 2019, 04:59:21 PM »

Ahh, darn! Thanks for confirming! :)
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 #5781 on: December 05, 2019, 09:45:23 PM »

Can't remember, is the standard recovery chance 50% or lower than that?


Actually, just want to make sure this does what I think it does because it would be difficult to test:

Code

    public static final float RECOVER_CHANCE = 0.75f;


public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {

if (stats.getEntity() != null && stats.getEntity().getOwner() != 0) {
stats.getDynamic().getMod(Stats.INDIVIDUAL_SHIP_RECOVERY_MOD).modifyMult(id, RECOVER_CHANCE);
}
}


Should reduce the chance to recover by 25% right?
« Last Edit: December 06, 2019, 12:34:00 PM by Morrokain »
Logged

mipen

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5782 on: December 06, 2019, 03:55:18 AM »

Is it possible to increase the number of blueprints that are dropped from ruins and salvaged structures?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5783 on: December 06, 2019, 03:41:00 PM »

Should reduce the chance to recover by 25% right?

Correct!

Is it possible to increase the number of blueprints that are dropped from ruins and salvaged structures?

In theory, yes, but I think that'd involve providing your own copy of MarketCMD (and changing the relevant rules that call it), so it's a decent bit of work.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5784 on: December 07, 2019, 03:17:44 PM »

Is there a way to limit the use of specific LPCs via a hullmod? I've tried to go through the equipped fighters and then setting their stats by either one of

Code
           		ship.getVariant().getWing(i).setNumFighters(3);
            ship.getVariant().getWing(i).setOpCost(14);

But it seems this code changes the fighter spec for the entire game and not just the ship. I also can't go the converted hangar route because

Code
		stats.getDynamic().getMod(Stats.BOMBER_COST_MOD).modifyPercent(id, BOMBER_COST_PERCENT);
stats.getDynamic().getMod(Stats.FIGHTER_COST_MOD).modifyPercent(id, ALL_FIGHTER_COST_PERCENT);
stats.getDynamic().getMod(Stats.INTERCEPTOR_COST_MOD).modifyPercent(id, ALL_FIGHTER_COST_PERCENT);
stats.getDynamic().getMod(Stats.SUPPORT_COST_MOD).modifyPercent(id, ALL_FIGHTER_COST_PERCENT);

...these will affect a bunch of other ships.

Actually, would it be possible to add a custom category to these -> Stats.BOMBER_COST_MOD? And I could set the LPCs to that category and modify their costs this way.

Or if there's an easier method that I'm unaware of, I'd love to hear it!
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5786 on: December 07, 2019, 07:18:19 PM »

Is there a way to limit the use of specific LPCs via a hullmod?
I don't think there are any ideal ways to do so, but Ed was asking a similar question a while ago, so you might be interested in reading: http://fractalsoftworks.com/forum/index.php?topic=5061.msg261097#msg261097

Actually, would it be possible to add a custom category to these -> Stats.BOMBER_COST_MOD? And I could set the LPCs to that category and modify their costs this way.
Maybe. It would be really cool if it worked, but I expect the way those stats are applied is hard-coded in a way that doesn't take non-vanilla LPC categories into account. Still, it's worth a try.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5787 on: December 07, 2019, 09:50:21 PM »

In the next release, there's FighterOPCostModifier (and one for weapons) that can be added via MutableShipStatsAPI.addListener() and allow for arbitrary OP cost modification based on the specific fighter passed in.
Logged

creature

  • Captain
  • ****
  • Posts: 400
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5788 on: December 07, 2019, 10:02:53 PM »

In the next release, there's FighterOPCostModifier (and one for weapons) that can be added via MutableShipStatsAPI.addListener() and allow for arbitrary OP cost modification based on the specific fighter passed in.
Ooh! This is great to hear! I guess I'll just hold out till then.

Edit:
And I actually have a different question now - is there a way to make a single fighter return to its mothership? I'm thinking of a hullmod that makes a fighter retreat if it suffers a certain amount of hull damage.
« Last Edit: December 08, 2019, 12:48:34 AM by creature »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5789 on: December 08, 2019, 06:46:28 AM »

If a route-spawned fleet takes losses in combat, is this reflected anywhere in the route data at all? Neither OptionalFleetData.fp nor OptionalFleetData.damage are being updated in my RouteFleetSpawner implementation.

What about when two hostile routes meet in a location while player isn't nearby, is any combat simulated between them (or with local non-abstracted fleets)?

(What I'm trying to do: a persistent route-based fleet that flies around joining raids against hostile systems, or defending against raids on friendly systems, or simply patrols friendly systems. If it takes enough losses, it goes to a faction-held market to replace lost ships with new ones. The route is never actually terminated unless its FP drops to zero, or certain (currently undetermined) conditions are met).

« Last Edit: December 08, 2019, 06:57:15 AM by Histidine »
Logged
Pages: 1 ... 384 385 [386] 387 388 ... 706