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 ... 583 584 [585] 586 587 ... 706

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

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8760 on: May 17, 2022, 03:29:26 AM »

How do I force a bar event to spawn under certain conditions (or even just get the creation code to be called very frequently)? I've tried AddBarEvent, but that doesn't call any of the event's creation code, and I have no clue what I need to do in order to get it to do that. It's basically a slightly modified surplus ship bar event - I've got it working fine under normal conditions, but I'd like it to not be random.

I've also tried adding the priority tag to the entry in bar_events.csv and making the freq/prob entries large numbers, with no effect.

Edit- I think this might answer this question but I need to sleep so I can't test it at the moment. (it was not)

I'm basically trying to create a bar event from bar_events.csv through my own code, rather than the existing RNG, and I have no clue how.
« Last Edit: May 17, 2022, 12:13:12 PM by theDragn »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8761 on: May 17, 2022, 01:31:01 PM »

Would the BeginMission <mission id> command do the trick for you?
Logged

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8762 on: May 17, 2022, 02:32:19 PM »

If I use BeginMission and use the bar event ID, I get an error; if I make a person_missions.csv entry and use that ID (and point it to my bar event script) it doesn't error out, but none of the data set on event creation seems to get stored in the "right" memory - all the $heOrShe and similar stuff in the dialog isn't replaced, showing the ship/NPC doesn't work, and adding the ship to the player inventory at the end produces an NPE. Using dev mode to dump the memory doesn't show any of the stuff that would normally get set with the bar event, but logging shows that the create() method is getting called successfully.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8763 on: May 17, 2022, 03:48:00 PM »

You'd need to still Call <eventRef> updateData and all that other kinds of stuff.
Logged

Audax

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8764 on: May 19, 2022, 01:10:57 PM »

Is it possible to generate commodities within a hullmod?

Examples would be generating 100 food per day

Was thinking of using advanceInCampaign() but not sure how to go about implementing it yet and if its performant if possible.

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8765 on: May 19, 2022, 09:56:14 PM »

How do I force a bar event to spawn under certain conditions (or even just get the creation code to be called very frequently)? I've tried AddBarEvent, but that doesn't call any of the event's creation code, and I have no clue what I need to do in order to get it to do that. It's basically a slightly modified surplus ship bar event - I've got it working fine under normal conditions, but I'd like it to not be random.

I've also tried adding the priority tag to the entry in bar_events.csv and making the freq/prob entries large numbers, with no effect.

Edit- I think this might answer this question but I need to sleep so I can't test it at the moment. (it was not)

I'm basically trying to create a bar event from bar_events.csv through my own code, rather than the existing RNG, and I have no clue how.
Techpriest helped me figure this one out. The thing to know is: ((ArrayList) Global.getSector().getEconomy().getMarket("market id here").getMemoryWithoutUpdate().get("$BarCMD_shownEvents")).add("bar_event_id_here");

« Last Edit: May 20, 2022, 02:08:23 AM by theDragn »
Logged

Audax

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8766 on: May 20, 2022, 09:09:48 AM »

Is it possible to generate commodities within a hullmod?

Figured out how to do it, I just check if a day has passed then adding the commodity to inventory. Works well enough, not sure about performance but its only the player who would be using the hullmod anyways.

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8767 on: May 20, 2022, 02:15:50 PM »

Is there a way to decrease AI officer spam  :o
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8768 on: May 20, 2022, 06:08:51 PM »

Is there a way to decrease AI officer spam  :o

Hmm - there's "officerAIMaxMercsMult" in settings.json, but since I wouldn't call what that affects anything close to "spam", I'm not quite sure if that's what you mean. The other settings in that general section should let you control pretty much what you want, though, unless it's for specific fleets the game spawns with settings that override that.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8769 on: May 21, 2022, 06:58:16 AM »

Is there a way to tell which submarket the player is currently looking at (within either fleet or cargo screens)?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8770 on: May 21, 2022, 08:02:46 AM »

I think you should be able to keep track of it by using SubmarketInteractionListener.reportPlayerOpenedSubmarket(). I don't believe there's any method to actually query that state.
Logged

Üstad

  • Commander
  • ***
  • Posts: 131
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8771 on: May 21, 2022, 12:51:04 PM »

Is there a way to decrease AI officer spam  :o

Hmm - there's "officerAIMaxMercsMult" in settings.json, but since I wouldn't call what that affects anything close to "spam", I'm not quite sure if that's what you mean. The other settings in that general section should let you control pretty much what you want, though, unless it's for specific fleets the game spawns with settings that override that.
I just want to lower AI officer numbers, the current number is 1. Does making it 0.5 make them %50 less officers or it affects only the over the limit ones? Like the limit is 10 and having half mercenary officer only affects after 10?

What about remnant ships, how do I lower AI core officers? What does "baseFPPerOfficer" do?

Thanks for the answer Alex  :)
Logged

Stelarwand030

  • Lieutenant
  • **
  • Posts: 58
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8772 on: May 21, 2022, 03:18:17 PM »

For what ever reason i cannot see all the skill choices. Is there a mod or something that adds a scroll bar? or a way to view the entire skill list?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8773 on: May 21, 2022, 03:30:52 PM »

For what ever reason i cannot see all the skill choices. Is there a mod or something that adds a scroll bar? or a way to view the entire skill list?

sounds like you're using an old version (for 0.95) of quality captains, turn it off and download the new one

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8774 on: May 22, 2022, 10:36:36 AM »

I just want to lower AI officer numbers, the current number is 1. Does making it 0.5 make them %50 less officers or it affects only the over the limit ones? Like the limit is 10 and having half mercenary officer only affects after 10?

If affects the over-the-limit ones, yeah.

You can increase baseCombatShipsPerOfficer - it does pretty much what it says, the average number of ships per ship with an officer.


What about remnant ships, how do I lower AI core officers? What does "baseFPPerOfficer" do?

For AI cores, it's slightly different - baseFPPerAICore - which determines the quantity of AI cores based on the "fleet points" value of the ship, which is not a player-visible stats. It's kind of like the deployment cost, but lower than that for larger ships. Raising that number will reduce the number of AI cores in Remnant fleets.

baseFPPerOfficer is commented out and won't do anything.

Keep in mind that some fleets are scripted to have a large number of officers or AI cores - for example, the high-level Remnant bounties from contacts - and they will not be affected by these kinds of settings.
Logged
Pages: 1 ... 583 584 [585] 586 587 ... 706