Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.98a is out! (03/27/25)

Pages: 1 ... 772 773 [774] 775 776 ... 779

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

WhisperDSP

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11595 on: May 14, 2025, 05:38:47 PM »

"Maximum Industries Reached" message when attempting to add a new industry to a planet which has a Hypershunt Tap and a lot of industries/structures. Specifically 12 industries/structures, I want to add 1 more. The planet has the Industry slots available to do it (pictures below).

This is occurring with the TechMining mod that I have written. I have been really stress-testing it (and the game) to the limit and I am unsure if this message is because:

1/ I have written the mod incorrectly

2/ I have pushed the game-interface further than it was designed to go

In the mod I have changed the Tech-Mining from an Industry to a Structure.

This is the base-game Tech-Mining definition (from the "starsector-core\data\campaign\industries.csv" file):
Code
techmining,Tech-Mining,30,45,,2,,,"techmining, industry, industrial",,graphics/icons/industry/techmining.png,com.fs.starfarer.api.impl.campaign.econ.impl.TechMining,"Techmining is the motley art of recovering valuable artifacts from Domain ruins. Requires special tools to deal with unique hazards and expert judgement to know where to look for a good haul of baubles. The oldest techminers are a strange lot, clutching luck-charms and refusing to work without their rituals.",400,MEDIUM
I have altered it to the following (originally I set it to "techmining, structure, industrial" - just now I have changed it to "techmining, structure" - the message/issue persists):
Code
techmining,Tech-Mining,30,45,,2,,,"techmining, structure",,graphics/icons/industry/techmining.png,data.scripts.wta_industry.wta_TechMining,"Techmining is the motley art of prospecting/scavenging valuable artifacts from Domain ruins. It requires special tools to deal with unique hazards and expert judgement to know where to look for the good stuff - though there's always basic equipment recoverable from most anywhere. The oldest techminers are a strange lot, loners clutching at luck-charms and refusing to work without their rituals.",400,MEDIUM
This picture is of a Gas Giant which has 5/5 industries + the Tech-Mining structure queued up, the button to add is enabled/available:


This picture is of a Cryovolcanic world which has 4/5 industries + the Tech-Mining structure queued up, the button to add is disabled/not available and the message "Maximum Industries Reached" appears as a tooltip / mouseover for the button:


When I remove the Tech-Mining structure and add for example the Fuel Production industry:


The button to add is again disabled/not available and the message "Maximum Industries Reached" appears as a tooltip / mouseover for the button:


I do not know where to start looking regarding this. Is it something I've done through bad coding? Or is it something I've done because I've pushed the game too far?

Or is there a hard-coded limit of 12 industries/structures in that interface? (I don't think this is the situation, since other mods must add a lot of custom industries to planets. Plus occasional games will spawn systems which are both in range of a Cryosleeper and a Coronal Hypershunt and have ruins to Tech-Mine.)

Thoughts? Help? ???

float

  • Captain
  • ****
  • Posts: 469
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11596 on: May 14, 2025, 05:48:59 PM »

"Maximum Industries Reached" message when attempting to add a new industry to a planet which has a Hypershunt Tap and a lot of industries/structures. Specifically 12 industries/structures, I want to add 1 more. The planet has the Industry slots available to do it (pictures below).
<snip>

12 structures is hard-coded into the UI. It's not trivial to bypass, but mods have done so using reflection (Grand Colonies, for example).
Logged

WhisperDSP

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11597 on: May 14, 2025, 06:13:22 PM »

"Maximum Industries Reached" message when attempting to add a new industry to a planet which has a Hypershunt Tap and a lot of industries/structures. Specifically 12 industries/structures, I want to add 1 more. The planet has the Industry slots available to do it (pictures below).
<snip>

12 structures is hard-coded into the UI. It's not trivial to bypass, but mods have done so using reflection (Grand Colonies, for example).

Ah, so I did push the interface too far.

Going through the vanilla-game permutations for industries/structures, the player would disassemble a Cryorevival Facility once the planet hits the maximum of Size 6. So for vanilla, everything possible to build could be fit into 12 tiles.

Do you know if there is a "generic" mod which allows more than the 12 limit? So that mod-authors don't need to code their own variation for their mod, and potentially have it clash with other mods that also do the same thing?

Edit: Checking Grand Colonies now.

Edit 2: Perfect, is exactly what I need! :D
« Last Edit: May 14, 2025, 07:24:33 PM by WhisperDSP »
Logged

cjy4312

  • Lieutenant
  • **
  • Posts: 52
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11598 on: May 14, 2025, 10:44:13 PM »

Hi! Would you mind describing the specific use case, to make sure that whatever I add actually satisfies it?
I’ve created a custom shield system using ship modules and DamageTakenModifier to simulate shield behavior. caculate and send flux to parent
Ofcourse I can block the effect by zeroing damage via DamageTakenModifier to stop fragments appered,but It mean the attacker will lost many of damage records for mod likes Detailed Combat Results.
« Last Edit: May 15, 2025, 01:11:04 AM by cjy4312 »
Logged

banano of doom

  • Captain
  • ****
  • Posts: 378
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11599 on: May 15, 2025, 06:30:40 AM »

it was asked before, but that was long ago, and game was updated many times since then, so i'll ask again
is there now a reliable way to obtain the merged json for a given weapon/ship/projectile from the corresponding spec?
it is not particularly difficult to just load it again, but there is still issue that game allows for json file have filename different from the spec id, there are even such cases with some vanilla jsons, but i can't quite recall specific culprits out of hand...
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 26087
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11600 on: May 15, 2025, 01:15:58 PM »

I’ve created a custom shield system using ship modules and DamageTakenModifier to simulate shield behavior. caculate and send flux to parent
Ofcourse I can block the effect by zeroing damage via DamageTakenModifier to stop fragments appered,but It mean the attacker will lost many of damage records for mod likes Detailed Combat Results.

(That is *really* cool!)

I'm not sure what you mean, exactly - if you zero out the damage, then you'd want DCR to not pick up the records, right? And those do no anti-shield damage. So I don't understand.

it was asked before, but that was long ago, and game was updated many times since then, so i'll ask again
is there now a reliable way to obtain the merged json for a given weapon/ship/projectile from the corresponding spec?
it is not particularly difficult to just load it again, but there is still issue that game allows for json file have filename different from the spec id, there are even such cases with some vanilla jsons, but i can't quite recall specific culprits out of hand...

Hmm - no, the game does not keep the merged json files in memory once it's finished loading the specs, if that's what you're asking.
Logged

Sincronic

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11601 on: May 15, 2025, 03:02:25 PM »

Is there a way to make a weapon not show on black market ever? I wanna make some weapons that require certain reputation levels and high price to be bought, but black market is ruining that plan by bypassing reputation requirement..

If not, could you make a way? a tag perhaps? (no_black_market)
Logged

Jaydee8652

  • Ensign
  • *
  • Posts: 39
    • View Profile
    • JaydeePiracy
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11602 on: May 15, 2025, 04:38:28 PM »

What makes it so that the flank deployment mechanic only works on frigates?

I'm trying to make a skill that allows you to do it under normal conditions like that old unimplemented (?) one but adding CAN_DEPLOY_LEFT_RIGHT_MOD to the player commander allows you to deploy *anything* by the flanks, frigates through to capitals.
« Last Edit: May 16, 2025, 03:44:01 AM by Jaydee8652 »
Logged

WhisperDSP

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11603 on: May 16, 2025, 01:13:58 AM »

I am looking to add an s-mod effect to a hullmod. It will involve adding a tag to the ship. Along the lines of:

ship.getHullSpec().addTag(...)

From what I can see, it could be done in either of the following functions within the hullmod spec:

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

public void applyEffectsAfterShipCreation(ShipAPI ship, String id)

Which would be the most appropriate function to use?

Edit: Found it, in an older post by Histidine. :) Many thanks!
« Last Edit: May 16, 2025, 11:24:41 AM by WhisperDSP »
Logged

Lornalt

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11604 on: May 16, 2025, 03:06:47 AM »

Hi!

So I got a question I've been using this mod colonystar that I got off this forums from years ago. I've never seen it since but I've used it continually up-till 0.97. Would anyone know if a mod that old based on the code from that time is gonna work on 0.98?

I would test it but I'm not near my game computer right now and I just found out of the 0.98 update.


Nevermind I found out it still works.. Another question? How do I stop Nexerelin from colonising the star? I attached the file that generates the system if anyone can take a look.

Thanks!
« Last Edit: May 16, 2025, 03:27:30 AM by Lornalt »
Logged

WhisperDSP

  • Captain
  • ****
  • Posts: 365
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11605 on: May 16, 2025, 05:29:10 PM »

Is there a simple way (in code) to determine if a ship is one of the Sentinel fleet?

Background: I am making the Automated hullmod player-usable, with an s-mod bonus having the same effects as the Mk1 and Sentinel ships, however I only want the special tooltip showing on the Mk1 and Sentinel fleet ships. I have it working for Mk1, Sentinel has me scratching my head.

Edit:

I believe that I have what I want with the following:

Code
if (ship.getHullSpec().getHullId().equals("onslaught_mk1") || ship.getHullSpec().hasTag(Tags.HULL_UNRESTORABLE) || ship.getVariant().hasTag(Tags.HULL_UNRESTORABLE)) {...}
At least, I'm hoping that very few mods will add unrestorable ships. ;)
« Last Edit: May 17, 2025, 05:42:40 PM by WhisperDSP »
Logged

cjy4312

  • Lieutenant
  • **
  • Posts: 52
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11606 on: May 16, 2025, 07:59:25 PM »

I'm not sure what you mean, exactly - if you zero out the damage, then you'd want DCR to not pick up the records, right? And those do no anti-shield damage. So I don't understand.

oh...
I understand
I mistakenly thought that it would cause a deviation in DCR's records
It cleared up my confusion on this. Thank you
« Last Edit: May 16, 2025, 08:22:12 PM by cjy4312 »
Logged

Reshy

  • Admiral
  • *****
  • Posts: 1282
  • White
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11607 on: May 16, 2025, 08:23:57 PM »



There a way to make a pirate base undamaged or only have certian modules missing?
Logged

Jaydee8652

  • Ensign
  • *
  • Posts: 39
    • View Profile
    • JaydeePiracy
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11608 on: May 17, 2025, 02:44:17 PM »

Is there anything similar to the obfuscated Phase Skimmer scripts that I can look at?

I'm trying to turn it into a subsystem from Magiclib and that requires having the code for both the system and the AI script.
Logged

cicero681

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11609 on: May 17, 2025, 04:10:02 PM »

Does anyone know where the khopesh ship data files are? they don't appear with the rest of the fighters/hulls

edit:nvm
« Last Edit: May 17, 2025, 04:31:07 PM by cicero681 »
Logged
Pages: 1 ... 772 773 [774] 775 776 ... 779