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 ... 592 593 [594] 595 596 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8895 on: July 05, 2022, 02:00:48 PM »

I want to programmatically hide the friendly info boxes during combat because they overlap and clutter the battlefield under the extreme zoom-out my mod involves, and I want to replace them with flux and hull diamonds, for which I already have working code, but cannot find an API call to hide the info boxes. I found a hack by simulating an F11 keypress via Robot, to which the OS responds by asking if Starsector should be allowed to control the computer, but I don't want to make users think that my mod hijacks their machine.  Does or will any workaround exist?

Hmm, I don't believe so, no - and F11 hides all of the UI, not just the friendly ship overlays, so that doesn't seem ideal either. Let me make a note to take a look at adding this at some point!

What is the mutable stat used for the upcoming ablative armor hullmod?   I'd like to make something similar on a smaller scale.   Haven't spotted it yet.  Perhaps a usage of getArmorBonus or getArmorDamageTakenMult?

This is assuming there isn't some other function used in a future update.

It's just:
stats.getEffectiveArmorBonus().modifyMult(id, 0.1f);

And then having a ton of base armor on the ship.

Is anyone aware of a mod that disables the ability to create stable points using an alpha core + story point at a star, or any reason why it wouldn't be possible? I don't seem to be able to do that in my current campaign.

Are you certain you don't already have two occupied points in the system in question?

Somewhat counter-intuitively, gates take up what would be a point slot, IIRC.

Fairly sure that the bit about the gates is not right, unless there's some kind of bug!

And, no, not aware of any such mod myself. But if a mod overrode the default star interaction, that could very well happen.
Logged

Princess_of_Evil

  • Captain
  • ****
  • Posts: 459
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8896 on: July 06, 2022, 03:28:46 AM »

How difficult would it be to entirely remove a modded weapon from a save? I accidentally ran my main save with a debug mod and now i have a blueprint and an item of a test gun on it.
Logged
Proof that you don't need to know any languages to translate, you just need to care.

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8897 on: July 06, 2022, 05:43:02 AM »

Does anyone know how to code a faction's hull(or in this case) fighter doctrine to run different fighter IDs based on the mods being enabled?

For example: mod A adds fighters 1 and 2. If mod A is running the Sindrian Diktat(for example) would be running fighter 1. But if mod B is enabled alongside mod A the Sindrian Diktat would be running exclusively fighter 2 instead.
Logged

Alex

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

How difficult would it be to entirely remove a modded weapon from a save? I accidentally ran my main save with a debug mod and now i have a blueprint and an item of a test gun on it.

If it's not used by anything, then you might be able to just edit it out of the savefile. Or drop it off in some cargo pods and let them be lost forever - after the pods with the item despawn, unless you've learned the blueprint, I believe the save should load without that test mod enabled.

Does anyone know how to code a faction's hull(or in this case) fighter doctrine to run different fighter IDs based on the mods being enabled?

For example: mod A adds fighters 1 and 2. If mod A is running the Sindrian Diktat(for example) would be running fighter 1. But if mod B is enabled alongside mod A the Sindrian Diktat would be running exclusively fighter 2 instead.

You'd probably need to detect this in ModPlugin.onNewGame() and then modify the faction's known fighters there.

Logged

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8899 on: July 06, 2022, 07:42:17 PM »

How difficult would it be to entirely remove a modded weapon from a save? I accidentally ran my main save with a debug mod and now i have a blueprint and an item of a test gun on it.

If it's not used by anything, then you might be able to just edit it out of the savefile. Or drop it off in some cargo pods and let them be lost forever - after the pods with the item despawn, unless you've learned the blueprint, I believe the save should load without that test mod enabled.

Does anyone know how to code a faction's hull(or in this case) fighter doctrine to run different fighter IDs based on the mods being enabled?

For example: mod A adds fighters 1 and 2. If mod A is running the Sindrian Diktat(for example) would be running fighter 1. But if mod B is enabled alongside mod A the Sindrian Diktat would be running exclusively fighter 2 instead.

You'd probably need to detect this in ModPlugin.onNewGame() and then modify the faction's known fighters there.

I believe that should work, thanks!

Though, I have another question; how do you make a planetary condition that appears on a specific planet after it's been decivilized and changes if it is recolonized? I understand that there is Decivilized/Deciv Subpop and a ColonyDecivListener but checking the Deciv/Deciv Subpop java files doesn't seem to yield anything special and I don't really know how to use the listener.

And a little bonus to the above: How do you make it not spawn if the colony is colonized by a specific faction?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8900 on: July 07, 2022, 03:33:21 AM »

Is there a "proper" way to get a system to render a glow (specifically, like a phase coil / weapon glow)?

As far as I can tell my best option is to use magiclib's singleframe render function and basically do it myself, but that seems like an unwieldy solution- has anyone come up with a better one?
« Last Edit: July 07, 2022, 05:59:01 AM by Ruddygreat »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8901 on: July 07, 2022, 08:55:59 AM »

Hmm, I wonder if you could control a deco weapon's jitter glow? That would help with some of my ship systems, too.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8902 on: July 07, 2022, 12:02:08 PM »

I was thinking of doing that first (and swore that there was a setGlowLevel() method in weaponAPI), but as far as I can tell there's no way to interact with anything that determines a weapon's glow level.

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8903 on: July 07, 2022, 03:25:28 PM »

All I see is setRemainingCooldownTo() and getGlowSpriteAPI(). I don't know if fiddling with cooldown changes a weapon's glow. The latter sounds promising, but I am not sure how much you can actually do with it.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8904 on: July 07, 2022, 04:28:21 PM »

Though, I have another question; how do you make a planetary condition that appears on a specific planet after it's been decivilized and changes if it is recolonized? I understand that there is Decivilized/Deciv Subpop and a ColonyDecivListener but checking the Deciv/Deciv Subpop java files doesn't seem to yield anything special and I don't really know how to use the listener.

Hmm - for how listeners work, you generally want to do something like:
Global.getSector().getListenerManager().addListener()

And then your object will get the listener interface methods called when appropriate. You also want to .removeListener() when your object no longer needs to exist; having listeners stick around if they're not removed can be an easy way to have a memory leak.

And a little bonus to the above: How do you make it not spawn if the colony is colonized by a specific faction?

That'd just be up to whatever code you write to have that logic in it!


Is there a "proper" way to get a system to render a glow (specifically, like a phase coil / weapon glow)?

As far as I can tell my best option is to use magiclib's singleframe render function and basically do it myself, but that seems like an unwieldy solution- has anyone come up with a better one?

Phase coils are iirc hardcoded to only work with phase-cloak type ship systems?

For weapon glows, though, there's:
ShipAPI.setWeaponGlow()
WeaponAPI.setGlowAmount() (not 100% sure this one is in the release, but the other one is.)
Logged

Princess_of_Evil

  • Captain
  • ****
  • Posts: 459
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8905 on: July 07, 2022, 10:54:51 PM »

Is it possible to add something to already existing UIs?
Specifically, i wanted to add some info to the ship's infobox without just adding more to the description.
Logged
Proof that you don't need to know any languages to translate, you just need to care.

JAL28

  • Commander
  • ***
  • Posts: 217
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8906 on: July 08, 2022, 06:36:21 AM »

Is there a way to control the application of economy.json contents with a settings.json defined Boolean?

For example Boolean “DENotSpawnNonDiktatStuff” defined in settings.json, is it possible to use this Boolean to make it so economy.json stuff doesn’t apply when it is true for example?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8907 on: July 08, 2022, 08:40:11 AM »

Is it possible to add something to already existing UIs?
Specifically, i wanted to add some info to the ship's infobox without just adding more to the description.

Not to that one, no - at least not easily. I know some people have made UI additions by basically rendering custom overlays, but that's more complicated and situational.


Is there a way to control the application of economy.json contents with a settings.json defined Boolean?

For example Boolean “DENotSpawnNonDiktatStuff” defined in settings.json, is it possible to use this Boolean to make it so economy.json stuff doesn’t apply when it is true for example?

Hmm, possibly? You'd have to basically apply it yourself, though, based on whatever config you want to do; it'd be a bunch of code.
Logged

Princess_of_Evil

  • Captain
  • ****
  • Posts: 459
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8908 on: July 08, 2022, 08:48:54 AM »

Not to that one, no - at least not easily. I know some people have made UI additions by basically rendering custom overlays, but that's more complicated and situational.
Is there anything i could read about it? I'm not afraid of doing code, there just literally isn't anything i've seen that's similar.
Logged
Proof that you don't need to know any languages to translate, you just need to care.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8909 on: July 08, 2022, 08:50:46 AM »

I want to say one of Sundog's mods does this for the fleet deployment dialog? Not 100% sure.

Thinking about it some more, though, I don't think this would be a workable approach for ship tooltips because they can show up in such a variety of UI screens and in different locations.
Logged
Pages: 1 ... 592 593 [594] 595 596 ... 706