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: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 751 752 [753]

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

EnigmaniteZ

  • Commander
  • ***
  • Posts: 160
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11280 on: January 28, 2025, 08:03:49 PM »

I am making a special bounty fight (with magiclib), and I have a hullmod that is basically a 'special' phase anchor, and wanted it to change the health of the ship in combat so that it keeps once the ship is out of combat. not sure how to handle this. would it take some kind of event handler?
Logged
Also known as: Khe, Kherae. Pros: tend to be an optimizer and a fixer. Cons: ADD (Is that a squirrel over there?) and severe memory issues (as in: I'm the last 10+ years)

Dear fellow coders: please use more null checks...

Kaysaar

  • Admiral
  • *****
  • Posts: 551
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11281 on: January 29, 2025, 03:09:06 PM »

Hi, I was trying to implement busted ver. of Cryosleeper and i got issue with shadows doing some weird stuff.
Spoiler
[close]
What I should do to get rid of them
This are params of object
Spoiler
"ark":{
      "defaultName":"Domain-era Ark",
      "nameInText":"Domain-era Ark",
      "shortName":"ark",
      "aOrAn":"a",
      "isOrAre":"is",
      "defaultRadius":152,
      "customDescriptionId":"ark",
      "interactionImage":"graphics/illustrations/cryosleeper_interior.jpg",
      "icon":"graphics/icons/cryosleeper.png",
      "iconWidth":32,
      "iconHeight":32,
      "sprite":"graphics/entities/ark.png",
      "spriteWidth":150,
      "spriteHeight":324,
      "renderShadow":true,
      "useLightColor":false,
      "showInCampaign":true,
      "showIconOnMap":true,
      "showNameOnMap":false,
      "scaleNameWithZoom":false,
      "scaleIconWithZoom":true,
      "tags":["has_interaction_dialog", "salvageable","neutrino_high", "parked_cryosleeper","aotd_cryosleeper"],
      "layers":[STATIONS],
      "renderCircleIndicator":true,
      "renderCircleIndicatorSelectionFlash":true,
      "pluginClass":"com.fs.starfarer.api.impl.campaign.ArkEntityPlugin",
   },

[close]
Logged

pixel_rice_bowl

  • Ensign
  • *
  • Posts: 11
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11282 on: January 29, 2025, 04:24:20 PM »

If this question is already answered somewhere else, I apologize, I just couldn't find anything related with a forum search.

Over the past couple months I've made about 65-70 custom planet textures that I'd like to include in a very basic mod that only changes the visual textures used for some planet types. Is there a way to change planet textures so that an otherwise vanilla sector generation selects planet textures randomly from a set or class type rather than one texture being assigned? For example, the texture set includes several new gas giant and lava type planet textures. Would it be difficult (or even possible) to make it so that when a sector is generated, any given lava planet will use one of the five new textures, chosen at random? (I hope this question makes sense. Thanks for any advice here.)
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 2349
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11283 on: January 30, 2025, 05:58:44 AM »

Spoiler
[close]

will giving lidararray this AI hint make it so that the ships will be worried about standing directly in front of an Invictus in 2k range?

It seems it's working...
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11284 on: January 30, 2025, 04:24:03 PM »

is there some "proper" way to play custom music during combat?

Right now i'm doing it in a BaseEveryFrameCombatPlugin advance() method, and it always works if I play music immediately/at combat start, but using Global.getSoundPlayer().playCustomMusic() again to play a different track seems to almost always result in an AL Error, 40965( Error initializing music source) or 40963( audio buffer allocation)

I'm guessing this is some memory issue, but i'm not sure if I possibly could circumvent it by doing something extra between playing the two tracks. I've tried pausing the music and passing in a null id to playCustomMusic()  to stop the music and then play the second track, but this just seems to change which AL Error I get  :-[

I *think* it comes from playing too many custom music tracks and may be resolved in the next release. Not 100% sure, though. As far as any workarounds, nothing comes to mind, unfortunately!


I am making a special bounty fight (with magiclib), and I have a hullmod that is basically a 'special' phase anchor, and wanted it to change the health of the ship in combat so that it keeps once the ship is out of combat. not sure how to handle this. would it take some kind of event handler?

I'm not sure what you mean, but just setting the health of the ship should be sufficient, I believe.


Hi, I was trying to implement busted ver. of Cryosleeper and i got issue with shadows doing some weird stuff.

It looks like the sprite is too big for the selection circle, and the size of the shadow is based on the size of the selection circle. So: make the one smaller or the other larger, and that should do it!

If this question is already answered somewhere else, I apologize, I just couldn't find anything related with a forum search.

Over the past couple months I've made about 65-70 custom planet textures that I'd like to include in a very basic mod that only changes the visual textures used for some planet types. Is there a way to change planet textures so that an otherwise vanilla sector generation selects planet textures randomly from a set or class type rather than one texture being assigned? For example, the texture set includes several new gas giant and lava type planet textures. Would it be difficult (or even possible) to make it so that when a sector is generated, any given lava planet will use one of the five new textures, chosen at random? (I hope this question makes sense. Thanks for any advice here.)

Hmm. I think you'd need to add new entires in planets.json for all of the new planets, and then add new entries for the planets in planet_gen_data.json. There's no way to just have the "same planet but pick from a pool of textures".


Spoiler
[close]

will giving lidararray this AI hint make it so that the ships will be worried about standing directly in front of an Invictus in 2k range?

It seems it's working...

I believe so. It's also likely to prevent them from venting so I'd say this is something that breaks the AI of other ships by making them think there's a constant threat that isn't actually there.
Logged

Redeye43

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11285 on: January 30, 2025, 05:22:59 PM »

I'm trying to figure out a way to change if a ship loses CR during combat through a hullmod. There's a function to get if this happens (ShipAPI.losesCRDuringCombat), but I can't find anything to set it. Multiplying PPT to a ridiculous number is a silly and improper way to do it. What am I missing?
Logged

EnigmaniteZ

  • Commander
  • ***
  • Posts: 160
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11286 on: January 30, 2025, 06:11:32 PM »

what I mean is...
a ship that has phase anchor trigger in the combat 'layer', instead of dying it sets its health to 1 and retreats
upon returning to the campaign layer, such as for pursuit or the like, the ship has basically 1 health

what I want is to be able to set that health to something higher than 1 when the phase anchor triggers, and have the ship come out of that battle with that health.
using ship.setHealth is not working for this, it still comes out with 0% hull. tried ship.getFleetMember().getStatus().repairHullFraction(), as well, but that also didnt work.

so I guess a short way of putting it is that I want a hullmod-modified current hull level in battle to persist into the campaign after that battle.



as for Redeye: funny enough that is slightly relevant to my current hullmod i'm working on, phase anchor; you can add a CR event.
what phase anchor uses is this: ship.getFleetMember().getRepairTracker().applyCREvent(-crLoss, "Emergency phase dive");
Logged
Also known as: Khe, Kherae. Pros: tend to be an optimizer and a fixer. Cons: ADD (Is that a squirrel over there?) and severe memory issues (as in: I'm the last 10+ years)

Dear fellow coders: please use more null checks...

Audax

  • Captain
  • ****
  • Posts: 280
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11287 on: January 31, 2025, 03:48:44 AM »

is stationProb an stationRole within salvage_entity_gen_data.csv only work for derelict mothership or can I spawn a different kind of station let say a high tech star fortress by tritachyon??

It doesn't work when I was putting different factions, and I don't know what stationRole is used even after looking through the API.

Alukard661

  • Ensign
  • *
  • Posts: 7
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11288 on: February 01, 2025, 10:07:41 PM »

Is there any way to remove collisions from destroyed ship's hulk / make them disappear faster? In large battles they seem to severely reduce FPS and blocking almost all shooting vectors which turns fight into space caterpillar simulator...
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 2349
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11289 on: February 02, 2025, 04:39:05 AM »

how does anti-Lidar Array AI work?

Does it start detecting the enemy's increased range as soon as the system's charge up begins? Or does it do it only after the charge up is complete?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11290 on: February 02, 2025, 07:26:20 PM »

I'm trying to figure out a way to change if a ship loses CR during combat through a hullmod. There's a function to get if this happens (ShipAPI.losesCRDuringCombat), but I can't find anything to set it. Multiplying PPT to a ridiculous number is a silly and improper way to do it. What am I missing?

ship.getMutableStats().getCRLossPerSecondPercent().modifyMult(id, 0)

Might work? Not 100% sure.


what I mean is...
a ship that has phase anchor trigger in the combat 'layer', instead of dying it sets its health to 1 and retreats
upon returning to the campaign layer, such as for pursuit or the like, the ship has basically 1 health

what I want is to be able to set that health to something higher than 1 when the phase anchor triggers, and have the ship come out of that battle with that health.
using ship.setHealth is not working for this, it still comes out with 0% hull. tried ship.getFleetMember().getStatus().repairHullFraction(), as well, but that also didnt work.

so I guess a short way of putting it is that I want a hullmod-modified current hull level in battle to persist into the campaign after that battle.

Ah, hmm. I think FieldRepairs does something similar, and you *might* be able to do something like:

stats.getDynamic().getMod(Stats.INSTA_REPAIR_FRACTION).modifyFlat(id, 0.5f);

That may repair the ship after combat by that amount, and the change shouldn't persist past the combat, while the health should.


is stationProb an stationRole within salvage_entity_gen_data.csv only work for derelict mothership or can I spawn a different kind of station let say a high tech star fortress by tritachyon??

It doesn't work when I was putting different factions, and I don't know what stationRole is used even after looking through the API.

It should work with different factions, but a ship role containing the station variant needs to be defined in the .faction file. See derelict.faction for an example of that.


Is there any way to remove collisions from destroyed ship's hulk / make them disappear faster? In large battles they seem to severely reduce FPS and blocking almost all shooting vectors which turns fight into space caterpillar simulator...

You should be able to CombatEngineAPI.removeObject() them. And to setCollisionClass(CollsisionClass.NONE).


how does anti-Lidar Array AI work?

Does it start detecting the enemy's increased range as soon as the system's charge up begins? Or does it do it only after the charge up is complete?

I don't remember 100% but I think it reacts to the targeting lasers (which do substantial dps) and then that smoothly transitions into reacting to the main guns themselves.
Logged

Killer of Fate

  • Admiral
  • *****
  • Posts: 2349
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11291 on: February 03, 2025, 12:20:01 PM »

Okay... I want to give Tibicena an AI Core admin like Culann has

Spoiler
[close]

it doesnt crash the game. So it recognises it, I put in the ModPlugin.java
I gave it all the necessary imports...

What now?
I mean... Do I just type in "new" or something and add to the on new game stuff?

edit: the fact that the beam damage on Lidar Array is what causes shields to be turned on at least partially finally explains to me to the fullest extent why Dragon targeting beam does so much damage. I thought it was world-building or some sort of an antiflare mechanic
« Last Edit: February 03, 2025, 01:17:34 PM by Killer of Fate »
Logged

EnigmaniteZ

  • Commander
  • ***
  • Posts: 160
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11292 on: February 03, 2025, 10:27:43 PM »

the insta_repair thing only worked sporadically, if at all. I managed to get it to work all of once...so i'm not sure how it's supposed to actually work, I guess. I have it setting the stat inside the listener currently
Logged
Also known as: Khe, Kherae. Pros: tend to be an optimizer and a fixer. Cons: ADD (Is that a squirrel over there?) and severe memory issues (as in: I'm the last 10+ years)

Dear fellow coders: please use more null checks...

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile

Okay... I want to give Tibicena an AI Core admin like Culann has

Spoiler
[close]

it doesnt crash the game. So it recognises it, I put in the ModPlugin.java
I gave it all the necessary imports...

What now?
I mean... Do I just type in "new" or something and add to the on new game stuff?

What you want to do is make sure that code gets called once and exactly once when a new game is created. There are any number of ways to do that; depending on what method in your ModPlugin you've put this code into, it may already be doing that.

the insta_repair thing only worked sporadically, if at all. I managed to get it to work all of once...so i'm not sure how it's supposed to actually work, I guess. I have it setting the stat inside the listener currently

Hm, that's strange; things *generally* work or don't, "sporadic" means there's some other factor.

Have you tried a script that just directly manipulates the fleet member status? I know you mentioned doing that, but that *should* work, as long as it happens at least a frame after the battle finishes. (E.G. if you try to do it too early, whatever you change may get overridden by the data taken from the battle outcome.)

In the meantime, I've added to ShipAPI:
void setLowestHullLevelReached(float lowestHullLevelReached);

This is what ends up being the hull level after combat, but right now there's only a getter for it.
Logged
Pages: 1 ... 751 752 [753]