Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Updated the Forum Rules and Guidelines (02/29/20); Blog post: GIF Roundup (04/11/20)

Pages: 1 ... 359 360 [361] 362 363 ... 443

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16597
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5400 on: October 15, 2019, 06:56:44 PM »

There is only one instance of each hullmod right? so you can't use variables outside the methods since all ships that have a hullmod would share the same value right?

Correct. If in the campaign, you can store stuff in Global.getSector().getPersistentData().

Also is there a problem in assigning stat modifications in applyEffectsAfterShipCreation instead of applyEffectsBeforeShipCreation? Since i have to redo the check when the player equips something

I'm not exactly sure what you mean. You could do either, I suppose; some stats don't take effect when changed in applyEffectsAfterShipCreation - namely, max armor and hull values; iirc everything else (or almost?) will work.
Logged

Ed

  • Captain
  • ****
  • Posts: 376
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5401 on: October 15, 2019, 07:23:28 PM »

There is only one instance of each hullmod right? so you can't use variables outside the methods since all ships that have a hullmod would share the same value right?

Correct. If in the campaign, you can store stuff in Global.getSector().getPersistentData().

Also is there a problem in assigning stat modifications in applyEffectsAfterShipCreation instead of applyEffectsBeforeShipCreation? Since i have to redo the check when the player equips something

I'm not exactly sure what you mean. You could do either, I suppose; some stats don't take effect when changed in applyEffectsAfterShipCreation - namely, max armor and hull values; iirc everything else (or almost?) will work.

Thanks!

Reworked my hullmod, no more duplication exploits!
Logged
Check out my ships

Morrokain

  • Admiral
  • *****
  • Posts: 1342
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5402 on: October 16, 2019, 12:47:52 PM »

I tried out:

Code

"engineSlotChanges":{
   "0":{
"style":"CUSTOM",
"styleId":"COBRA_BOMBER",
},
   "1":{
"style":"CUSTOM",
"styleId":"COBRA_BOMBER",
},
},


And it crashes with a nullpointer. Is this possible using a skin file? I may have my syntax wrong but it matches the way weapons are changed.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16597
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5403 on: October 16, 2019, 12:54:41 PM »

Ahh, engineSlotChanges apparently doesn't use "styleId" - so, just "style":"COBRA_BOMBER" should work.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1342
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5404 on: October 16, 2019, 01:23:07 PM »

Ahh, engineSlotChanges apparently doesn't use "styleId" - so, just "style":"COBRA_BOMBER" should work.

Just tried it and yes it does! Thanks. :)
Logged

prav

  • Lieutenant
  • **
  • Posts: 64
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5405 on: October 16, 2019, 02:40:23 PM »

What are the requirements for a module to not count towards station survival, like the high-tech station's shield module?
Logged

Techpriest

  • Commander
  • ***
  • Posts: 100
  • Personal Text
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5406 on: October 16, 2019, 07:18:48 PM »

Is it possible for the next version of Starsector to incorporate a print code? To record something of vital importance and easier debugging? Having it get debugged in starsector.log is hard to read when you include in other mods and the game itself.

Dwarden

  • Commander
  • ***
  • Posts: 148
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5407 on: October 17, 2019, 02:03:55 AM »

i do know that selling blueprint to blackmarket will result into Pirates after 90+ days to start utilize related designs

the question is, how enable it for other faction(s)?

like selling to the 'military' market type shall yield similar effect, if 'enabled' for that faction

(also if someone already uses that for theirs custom modded faction, please say)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16597
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5408 on: October 17, 2019, 09:23:51 AM »

What are the requirements for a module to not count towards station survival, like the high-tech station's shield module?

See: Misc.isActiveModule().

(Zero OP, no weapon groups, no fighter wings.)

Is it possible for the next version of Starsector to incorporate a print code? To record something of vital importance and easier debugging? Having it get debugged in starsector.log is hard to read when you include in other mods and the game itself.

I'm not sure what you're asking. Where would it print? If you want to print to console (which may work if you run the game from the command line/using the .bat file, you could use System.out.println() and that might work, but the logs print to console as well in that case.

You could also add a unique string to your logging output and do some combination of tail -f and grep etc to only show those lines, probably...


i do know that selling blueprint to blackmarket will result into Pirates after 90+ days to start utilize related designs

the question is, how enable it for other faction(s)?

like selling to the 'military' market type shall yield similar effect, if 'enabled' for that faction

(also if someone already uses that for theirs custom modded faction, please say)

See: com.fs.starfarer.api.impl.campaign.CoreScript.reportPlayerMarketTransaction(). At the end of that method is a commented out section that does this, which you can use as a starting point for adding similar/equivalent code. Whatever class does this needs to extend BaseCampaignEventListener and call super(true) in its constructor to register the listener.

Logged

Ed

  • Captain
  • ****
  • Posts: 376
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5409 on: October 17, 2019, 04:10:02 PM »

How do i add my ships to the Prism high end vendor without having a faction?
Logged
Check out my ships

King Alfonzo

  • Admiral
  • *****
  • Posts: 564
  • -- D O C T O R --
    • View Profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5410 on: October 17, 2019, 08:53:38 PM »

Two quick questions:

I'm sure this is a very straightforward thing to do, but how does one add a condition to a market with an industry, and then remove the condition if the industry is removed?

Further, I have a hullmod that I don't want to be bought or sold as a reward. I've poked through everything, and while industry and ship blueprints can be given no_sell and no_drop, that doesn't appear to exist for hullmods. Is there a way around this?

Histidine

  • Admiral
  • *****
  • Posts: 2647
    • View Profile
    • Bitbucket profile
    • Email
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5411 on: October 18, 2019, 05:42:20 AM »

I'm very new to modding and I have no java experience, but I'm willing to learn and would like to work on a special faction that raids and has dormant fleets in debris fields. Is this feasible? I've tried looking for tutorials on making special factions that don't have homes or bases but it doesn't seem like there's much out there. Anyone have suggestions on where to find some instruction on it? Thanks.
You'll probably want to look at different gameplay features in the modiverse that each do a different bit of what you want.
e.g. for hidden that spawn when the player enters the star system, you could use a LimitedFleetManager (of which vanilla's PirateFleetManager and LuddicPathFleetManager are examples). Nexerelin's Remnant raids spawn without a source market, although raid code in general is pretty complex.

How do i add my ships to the Prism high end vendor without having a faction?
For the Nexerelin version, it'll will automatically work if your ships are added to an already-registered faction (e.g. one of the vanilla factions).
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16597
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5412 on: October 18, 2019, 09:14:17 AM »

I'm sure this is a very straightforward thing to do, but how does one add a condition to a market with an industry, and then remove the condition if the industry is removed?

Two basic approaches: one is to add the condition in the Industry.apply() method and remove it in unapply(). The condition would have to be resistant to being added and removed many times, though, i.e. it shouldn't store data in data members etc, as Industry.unapply() gets called pretty often and not just when the industry is removed.

Another would be to add it in Industry.apply(), if it's not already present, and then remove it in the condition's advance() method, if you detect that the market no longer has an industry.

Either way, you'll want to:
String conditionId = market.addCondition(...) to add it, and

market.removeSpecificCondition(conditionId) to remove it. Or, if you're removing it in the condition's advance method:
market.removeSpecificCondition(condition.getIdForPluginModifications());

(See: RecentUnrest for an example of this.)



Further, I have a hullmod that I don't want to be bought or sold as a reward. I've poked through everything, and while industry and ship blueprints can be given no_sell and no_drop, that doesn't appear to exist for hullmods. Is there a way around this?

Set hidden to true in hull_mods.csv. (If hiddenEverywhere is set to true, it won't show up in the refit screen, btw; regular "hidden" just makes it not dropped/sold/installable).
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1342
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5413 on: October 18, 2019, 02:32:24 PM »

Can I override the max FP settings in missions without overriding the MissionAPI class? I can't seem to get it above 150 and I want it to be 250 to test performance improvements (roughly) without having to invest a ton of time in a campaign
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16597
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #5414 on: October 18, 2019, 02:37:23 PM »

Wouldn't changing battleSize accomplish this?
Logged
Pages: 1 ... 359 360 [361] 362 363 ... 443