Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: The Pilgrim's Path (07/19/22)

Pages: 1 ... 592 593 [594] 595 596 ... 600

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

AccuracyThruVolume

  • Lieutenant
  • **
  • Posts: 92
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8895 on: July 04, 2022, 04:56:02 PM »

Is it possible to create recoiling barrels on a weapon that overlap?     Example:  3 spaced barrels on "bottom" row, two slightly shorter spaced barrels on the "top" row.   They all recoil.     

Is there a limit to the amount of barrels for a weapon?

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.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1276
  • Secret Beef Cultist
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8896 on: July 04, 2022, 06:34:33 PM »

Is it possible to create recoiling barrels on a weapon that overlap?     Example:  3 spaced barrels on "bottom" row, two slightly shorter spaced barrels on the "top" row.   They all recoil.
Don't believe so, but I think it's a good idea; being able to spec a "turretGunSprite2" and "hardpointGunSprite2" would be cool for making, say, quad cannons. It does run into the problem of adjudicating which sprite should recoil based on which offsets; unfortunately only our gracious host can really answer the question of whether this is worth his time to consider.

Is there a limit to the amount of barrels for a weapon?
I've made (test) weapons with as many as forty barrel offsets (note, this is a major pain to keep track of and I don't recommend it), but as far as I know there's no set limit.
Logged
People need societies, but they don't necessarily need nations.

SpaceDrake

  • Captain
  • ****
  • Posts: 262
  • Mio Harcourt: fixin' the Machine.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8897 on: July 04, 2022, 10:07:57 PM »

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.

I've made (test) weapons with as many as forty barrel offsets (note, this is a major pain to keep track of and I don't recommend it), but as far as I know there's no set limit.

... I'm a little terrified to ask how big that turret was, and I'm someone who's a fan of the Infernus's mega-turret.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20578
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8898 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

laz2727

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8899 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

JAL28

  • Commander
  • ***
  • Posts: 192
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8900 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: 20578
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8901 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: 192
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8902 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

  • Commander
  • ***
  • Posts: 213
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8903 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: 2528
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8904 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

  • Commander
  • ***
  • Posts: 213
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8905 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.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 2528
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8906 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: 20578
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8907 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

laz2727

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8908 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

JAL28

  • Commander
  • ***
  • Posts: 192
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8909 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
Pages: 1 ... 592 593 [594] 595 596 ... 600