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 ... 654 655 [656] 657 658 ... 706

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

Audax

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9825 on: April 24, 2023, 12:03:43 PM »

is it possible to add a jitter to a piece of hulk??

I can add a jitter to an intact hulk(ship not broken into pieces) but I can't do that for pieces of hulk debris

vicegrip

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9826 on: April 24, 2023, 09:35:03 PM »

In a ship system's unapply() method, when using MutableShipStatsAPI unmodify() does it unmodify only what was changed in apply() or does it revert the stats to their base values? In other words if a hullmod adds 10% to getEnergyWeaponDamageMult and a ship system adds 50%, would calling unmodify() drop the energy weapon damage to 110% or 100% of the base value?

vicegrip

  • Commander
  • ***
  • Posts: 183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9827 on: April 24, 2023, 09:44:36 PM »

Hey, I'm sure this has been asked before (though I had a quick look and couldn't find it), but how do I make a ship available to use in NPC fleets?

I just got started on trying to make a ship pack mod cause I decided to try kitbashing and found it quite fun, but the first ship I made refuses to appear in my faction's fleets even though I had it prioritized. It doesn't work even if it's the only non-default blueprint I got and it doesn't work if I use console commands to learn all blueprints to ensure that all weapons its variants use can be produced by my faction. I used the ship editor and made sure all variants have goalVariant set to true but the ship still refused to appear in the 'typical heavy patrol' window, no matter how often I pressed 'regenerate'.

I tried setting the rarity in the csv to 1, leaving it blank or setting it to a different number as well.

You will need to add loadout variants for the ship. You can see the original in data\world\factions\default_ship_roles.json and should create your own that follows the format of the original, but listing only your ship variants under the appropriate rolls. Upping the hullfrequency\hulls value of your ship in your data\world\factions\(myfaction).faction file should also make the hull appear more frequently in NPC fleets.

Lukas04

  • Captain
  • ****
  • Posts: 337
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9828 on: April 25, 2023, 04:38:12 AM »

In a ship system's unapply() method, when using MutableShipStatsAPI unmodify() does it unmodify only what was changed in apply() or does it revert the stats to their base values? In other words if a hullmod adds 10% to getEnergyWeaponDamageMult and a ship system adds 50%, would calling unmodify() drop the energy weapon damage to 110% or 100% of the base value?

unmodify() will unmodify all changes made to the stat from everywhere. What you wanna do is use unmodify(id), which will only remove changes of that stat under that id.

So in your apply do something like modifyMult("namehere_shipsystem", 2f) and in your unapply do unmodify("namehere_shipsystem")
Logged
My Mods

alaricdragon

  • Commander
  • ***
  • Posts: 145
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9829 on: April 25, 2023, 01:59:22 PM »

hello once more everyone. I'm here to ask way to many questions again. (is this to many questions to ask at once? I ran out of things to code.)
so my questions:
1) is it possible to add a item to the players cargo that they can nether see or interact with?
2) is it possible to run code when the player opens / closes there cargo bay?
3) is it possible to edit the effective number of crew for crewing starships in your fleet? (like a mutable stat or something?)
4) is it possible to replace the system that causes the player to loss crew at the end of combat (or baring that, a way to run code whenever that runs?)

when opening the cargo bay, at the bottom left on top of the 'burn level' bar there is a bunch of cargo information:
5) is it possible to change 'the number crew in fleet, and the number needed to meet the minimum requirements on all ships in the fleet' text, number of crew, and number of required crew?
6) is it possible to change the little number that shows the amount of marines in the players fleet?
7) is it possible to change the 'Personnel capacity' text and number of personnel in fleet? (it also has a blue bar showing how full it is, in cause its not clear what 'Personnel Capacity' is)
Basically, I want to change all the blue things.

thank you reading my question list. and thanks for past awensers to the questions that i ask at random
Logged

Big Bee

  • Commander
  • ***
  • Posts: 153
  • bugs are cool
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9830 on: April 25, 2023, 03:58:48 PM »

you'll need at least an entry in default_ship_roles.json as well (look at vanilla for an example), without them the game doesn't know when to spawn the ship so it simply won't.

Thanks, that worked!

Some mods I looked at for reference had different groups in there (patrol sizes?), gonna have to look into those more!
Initially I just put the hull on the list instead of a variant and was wondering why the game kept crashing :p
Logged

Audax

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9831 on: April 27, 2023, 07:10:59 AM »

Is there a way to uniquely identify a piece of hulk from a fragmented ship??

Trying to do some stuff with floating hulks instead of it being floating walls that block projectiles

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9832 on: April 27, 2023, 12:00:12 PM »

hello once more everyone. I'm here to ask way to many questions again. (is this to many questions to ask at once? I ran out of things to code.)
so my questions:
1) is it possible to add a item to the players cargo that they can nether see or interact with?
2) is it possible to run code when the player opens / closes there cargo bay?
3) is it possible to edit the effective number of crew for crewing starships in your fleet? (like a mutable stat or something?)
4) is it possible to replace the system that causes the player to loss crew at the end of combat (or baring that, a way to run code whenever that runs?)

when opening the cargo bay, at the bottom left on top of the 'burn level' bar there is a bunch of cargo information:
5) is it possible to change 'the number crew in fleet, and the number needed to meet the minimum requirements on all ships in the fleet' text, number of crew, and number of required crew?
6) is it possible to change the little number that shows the amount of marines in the players fleet?
7) is it possible to change the 'Personnel capacity' text and number of personnel in fleet? (it also has a blue bar showing how full it is, in cause its not clear what 'Personnel Capacity' is)
Basically, I want to change all the blue things.

thank you reading my question list. and thanks for past awensers to the questions that i ask at random

I think the answer to most of these, except for #4, is no. And #4 requires replacing the vanilla FleetInteractionDialogPlugin implementation, which will both be fairly complicated and incompatible with other mods that need to do this for any other reason. Not knowing exactly what you want to accomplish, I think with regard to specifics, your best bet would probably be to work through the existing Crew commodity, and not completely around it.


Is there a way to uniquely identify a piece of hulk from a fragmented ship??

Trying to do some stuff with floating hulks instead of it being floating walls that block projectiles

I don't understand the question. If you have a reference to that ShipAPI object - of the floating piece of hulk - then that uniquely identifies it, no? I think I'm missing what you're asking.
Logged

alaricdragon

  • Commander
  • ***
  • Posts: 145
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9833 on: April 27, 2023, 10:46:28 PM »

I think the answer to most of these, except for #4, is no. And #4 requires replacing the vanilla FleetInteractionDialogPlugin implementation, which will both be fairly complicated and incompatible with other mods that need to do this for any other reason. Not knowing exactly what you want to accomplish, I think with regard to specifics, your best bet would probably be to work through the existing Crew commodity, and not completely around it.
That is unfortunate. Without being able to at least do 3, 4 is kinda useless.
As for what I was doing, 1 and 2 were me trying to find a way around having my changes to the survey plugin be cluttered. Unimportant for the most part. 3,4,5 was me trying to find a way to upgrade crew replacer so it could allow people to mod in new types of ship crew to the game. 7 was the same for passengers. 6 was just something that was bugging me.
I don't think working with crew would be helpful here. I could in theory simulate other commodities acting as ship crew by having them increase / decrease the number of crew in your fleet, but I can already foresee all sorts of issues with that. Many I don't think I would beable to fix.
Thanks for the awenser regardless though. Hope my words cleared up my objectives.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9834 on: April 28, 2023, 08:32:54 AM »

Yeah - it does sound like what you had in mind is really going against the grain of how the game wants to do things, unfortunately.
Logged

slamminabw

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9835 on: April 28, 2023, 10:41:13 AM »

Is there an updated guide on creating your own faction mod or a custom faction mod that would make a relatively simple template for me to use?

I'm assisting on the Battlestar Galactica mod, but would like to make my own custom faction mod. Unfortunately a lot of the BSG code is older, even if it still works, and I'm worried about starting their for my own mod. Most of the guides seem outdated. I downloaded the Outer Rim Alliance mod to explore as a template, and the amount of integration and complexity made it difficult for me to piece apart.

Not looking to use custom ships or weapons at this point. Simply a vanilla style faction, with vanilla assets, spawned on a new planet. I've got the faction file sorted, more so struggling to understand/find clarity on spawning the planet. Any nudge in the right direction would be appreciated! Thank you!
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9836 on: April 29, 2023, 01:24:48 AM »

I have a freshly spawned (same simframe) fleet in hyperspace, I'm trying to get it to enter a star system with Global.getSector().doHyperspaceTransition, but it appears in the system immediately without any animation and able to move immediately after the change in location. What causes this?

EDIT: Also I may as well ask:

- Is there a way to set an orbital station/battlestation/star fortress's combat readiness to 1%, suppressing its normal applyCRToStation() behavior?
I've tried setting CR every frame, applying a -1 flat modifier to max CR, and even setting the station fleet's AI mode to false so it needs crew it doesn't have (actually it doesn't, stations have zero skeleton crew). Nothing seems to work :|
For now I just apply the malfunction etc. modifiers directly to the ship stats, though that has the problem of player visibility. (EDIT2: This doesn't seem to work either?! :-X Perhaps because I'm only applying it to the station center?)

- I don't suppose there's a way to make the admiral AI know it can deploy ships from the side of the map in regular battles when I give it (a clone of) the Force Concentration skill?

Is there an updated guide on creating your own faction mod or a custom faction mod that would make a relatively simple template for me to use?
[...]
Not looking to use custom ships or weapons at this point. Simply a vanilla style faction, with vanilla assets, spawned on a new planet. I've got the faction file sorted, more so struggling to understand/find clarity on spawning the planet. Any nudge in the right direction would be appreciated! Thank you!
For generating a star system, the wiki has one guide. There are also examples in the Starsector folder, see starsector-core\data\scripts\world (if you're on Windows, the Mac/Linux path is slightly different).

Note that the approach described on the wiki adds the markets in code (e.g. sets their size, resource conditions and the like). The base game uses economy .json files for those, examples of which are in data/campaign/econ.
« Last Edit: April 29, 2023, 05:26:05 AM by Histidine »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9837 on: April 29, 2023, 10:11:20 AM »

I have a freshly spawned (same simframe) fleet in hyperspace, I'm trying to get it to enter a star system with Global.getSector().doHyperspaceTransition, but it appears in the system immediately without any animation and able to move immediately after the change in location. What causes this?

Hmm. The hyperspace transition works off the visible ships in the "campaign fleet view" - once they all warp out, the transition happens. There's a good chance that for a newly created fleet, the view is empty, so the transition happens right away. I didn't test this, though; just a hypothesis.

Depending on what you're doing, I'd probably attach a script to it that waits a second or two and then does the transition.


EDIT: Also I may as well ask:

- Is there a way to set an orbital station/battlestation/star fortress's combat readiness to 1%, suppressing its normal applyCRToStation() behavior?
I've tried setting CR every frame, applying a -1 flat modifier to max CR, and even setting the station fleet's AI mode to false so it needs crew it doesn't have (actually it doesn't, stations have zero skeleton crew). Nothing seems to work :|
For now I just apply the malfunction etc. modifiers directly to the ship stats, though that has the problem of player visibility. (EDIT2: This doesn't seem to work either?! :-X Perhaps because I'm only applying it to the station center?)

Short of overriding the industry with a copy that uses a subclass that does whatever you want, nothing somes to mind. I mean, it seels like you could set the CR in combat, right? But I think you're asking about doing this in the campaign layer. Am I missing something? (Yeah, you'd need to apply whatever changes to all the modules; they're basically independent ships as far as the game is concerned. For example, the Targeting Supercomputer hullmod needs to be on each module, etc.)


- I don't suppose there's a way to make the admiral AI know it can deploy ships from the side of the map in regular battles when I give it (a clone of) the Force Concentration skill?

I don't think so. In the next release you'll be able to create an AdmiralAIPlugin and pass it in to do whatever. In the current one, you could I think do this by forcing that side to not have an admiral AI (in the BattleCreationPlugin implementation) and then having an every frame plugin do the job.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9838 on: April 30, 2023, 05:16:36 AM »

- A delay between the fleet spawning and doing the transition didn't seem to fix it. Although if I'm in hyperspace looking at the fleet when it spawns, the transition animation works correctly on both ends of the jump.
The workaround I ended up using was to add the fleet directly to the star system at [99999, 99999] and use the hyperspace transition to do an 'in-system jump' to the intended destination.

-I ended up using a combat plugin to set the CR, yeah. Although I then ran into an interesting issue: setting CR (only in-combat? haven't tested) seems to barely do anything for a station's modules, as in when I set their CR to zero they could still use their shields and experienced no malfunctions, although fighter replacement rate was zero as expected.
EDIT: Getting and applying the CombatReadinessPlugin to the ships after setting their CR seems to do the job.


Anyway while I'm here, a bug report and a 'working as designed but I want to complain':
- When a fleet is generated with FleetParamsV3.flagshipVariantId specified, and that variant is a SHIP_WITH_MODULES (station_small_Standard will do), mousing over it in the campaign map CTDs. I guess you can't set a fleet member's variant to a ship with modules if it wasn't already one?
286701 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ArrayIndexOutOfBoundsException: 1
java.lang.ArrayIndexOutOfBoundsException: 1
   at com.fs.starfarer.campaign.fleet.FleetMemberStatus.getStatus(Unknown Source)
   at com.fs.starfarer.ui.super.OoOO.o00000(Unknown Source)
   at com.fs.starfarer.ui.super.OoOO.o00000(Unknown Source)
   at com.fs.starfarer.ui.super.OoOO.new(Unknown Source)
   at com.fs.starfarer.campaign.ui.O0OO.o00000(Unknown Source)

- I'm not sure that FleetFactoryV3.addCommanderAndOfficersV2 should override the fleet commander's rank and post ID (lines 1001-1002) if it's passed a premade commander in the params.
« Last Edit: April 30, 2023, 05:34:06 AM by Histidine »
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9839 on: April 30, 2023, 06:38:31 AM »

What determines if a ship shows up for purchase on the regular, military, or black market screens?

Also, I have ship designs in my default_ship_roles.json file. Do I also have to have those specific hull IDs in a blueprint that a fction can make or can ships in the default_ship_Roles.json still show up even of no faction has them listed as known?
Logged
Pages: 1 ... 654 655 [656] 657 658 ... 706