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 ... 446 447 [448] 449 450 ... 706

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

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6705 on: July 27, 2020, 11:20:25 AM »

I'd like to check if an Industry is available to build on a market, without adding it.
MarketAPI doesn't have a method for that, any good way to do this?

thanks!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6706 on: July 27, 2020, 12:17:14 PM »

What you'd need to do is:
Industry ind = market.instantiateIndustry(id)

And then:
ind.isAvailableToBuild()
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6707 on: July 27, 2020, 12:21:12 PM »

What you'd need to do is:
Industry ind = market.instantiateIndustry(id)

And then:
ind.isAvailableToBuild()

Hm, won't that cause the industry itself to be considered for the check?
edit - Nevermind, it won't - since it doesn't add itself to the industry list like this.

Thank you!
« Last Edit: July 27, 2020, 12:24:13 PM by SirHartley »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6708 on: July 27, 2020, 12:23:18 PM »

No, that doesn't add it to the market.
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 #6709 on: July 27, 2020, 04:05:20 PM »

Not really a modding question but someone asked about it on my mod thread:

Is raiding a market to get a blueprint seeded? So that save scumming doesn't give you the same results?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6710 on: July 27, 2020, 05:19:01 PM »

IIRC yes but the seed changes after... some time period. Now that I think about it, actually, it might've also been bugged and not actually seeded; if that's the case this is fixed for the next release.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6711 on: July 29, 2020, 03:25:34 AM »

I'm trying to add an industry that can only be built as an upgrade, but does not have a downgrade.

the issue I am running into is that isAvailibleToBuild() runs before CreateTooltip(), which causes this:

Code
isAvailableToBuild  -  -  -  currTTMode = null
this defaults to "false", because ToolTipMode is not "UPGRADE" - it's the check that determines if the industry is buildable.
Code
isAvailableToBuild  -  -  -  currTTMode = UPGRADE
This is a frame later, the check is now true since TTMode has been set and is no longer null - but it's too late, the check for IsAvailableToBuild has already run. The tooltip now displays the wrong information, and the button is greyed out.

is there a way to check the current toolTipMode before isAvailibleToBuild() runs the first time on being instantiated for upgrade tooltip creation?


Got it to work in a slightly roundabout way. I'd like to use this moment to ask for some API methods to specify buildability (upgrade only, downgrade only, normal only...)
« Last Edit: July 29, 2020, 07:04:57 AM by SirHartley »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6712 on: July 30, 2020, 09:04:38 AM »

Hmm - basing whether it's available to build on currTooltipMode seems, well, very wrong. There's no guarantee that currTooltipMode would be set (as you ran into) or that, indeed, the method would be called in a context where showing the tooltip even makes sense. Whether it's available - in your case - should I think more "correctly" be based on whether the industry it's an upgrade from is currently present on the market. Tooltip mode is ultimately something derived from market state for the purpose of showing the tooltip, and only that. Definitely don't rely on it elsewhere.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6713 on: July 30, 2020, 11:29:32 AM »

Thanks for the explanation regarding Tooltip mode!

My goal was to have an industry that:
-is never visible in industry selection
-has no downgrade
-can be upgraded to

I solved my problem by specifying an upgrade in the .csv, but setting it null via IndustrySpec by overriding both init() and getSpec() in the industry class.
This prevents it from showing up in the selector (because it is an upgrade), but also removes the ability to downgrade it.

Not clean at all, but it's why I requested ways to specify availability.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6714 on: July 30, 2020, 12:18:23 PM »

Shouldn't this already be doable? Stuff like Orbital Works doesn't show up in the industry list - the only difference seems to be that it's downgradeable-from, but that seems like it would just be a matter of clearing the "downgrade" column. What am I missing?
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6715 on: July 30, 2020, 12:48:46 PM »

Clearing the downgrade column results in the industry being buildable via the normal industry selection, which is not desireable in this case.

This might give more insight:
Spoiler
[close]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6716 on: July 30, 2020, 12:54:58 PM »

Ah, gotcha, that's the part I was missing.

But - wouldn't overriding BaseIndustry.showWhenUnavailable() to return false resolve this? Provided that isAvailableToBuild() checked your specific prerequisites etc.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6717 on: July 30, 2020, 01:05:47 PM »

I already use that to hide the Industries from selection.

Provided that isAvailableToBuild() checked your specific prerequisites etc.
That's the problem though - my prerequisite is that the current Industry instance was created from an IndustrySpecAPI.getUpgradePluginInstance() call, which I can't check for in the class (to my knowledge).
Hence the strange workaround

It needs to be buildable as upgrade if super.isAvailableToBuild() is true, but it must be unavailable (and hidden) if the normal industry selection menu gets called.
edit - without having an actual downgrade, or upgrade, specified anywhere in the .csv, since I do it all via code
« Last Edit: July 30, 2020, 01:09:45 PM by SirHartley »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6718 on: July 30, 2020, 01:09:39 PM »

Ahh, ok, ok - I finally get it :) Thank you for explaining.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #6719 on: July 31, 2020, 03:20:54 AM »

question
is there any way to completely disable all death effects for a given ship?
i made a copy of "reduced explosion" hullmod with radius and damage multipliers set to 0
and set  "baseCombatExplosionColor":[0,0,0,0], in hull style
and there is still this yellow smoke thing on death:
Spoiler
[close]
what is the source of it? is there any way to  change it's color or remove it entirely?
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.
Pages: 1 ... 446 447 [448] 449 450 ... 706