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 ... 598 599 [600] 601 602 ... 706

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

Wispborne

  • Captain
  • ****
  • Posts: 400
  • Discord: wispborne
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8985 on: August 01, 2022, 08:50:42 AM »

Yeah, that's not going to work - those values are just used to initialize the zoom tracker. Let me add some stuff to CampaignUIAPI:

float getMinZoomFactor();
float getMaxZoomFactor();
void setMinZoomFactor(float min);
void setMaxZoomFactor(float max);

My goal is to be able to allow the player to zoom out to see most of a system for some set period, then change the limit back to their normal one.

Just as a heads up, that seems likely to cause an FPS dive in some star systems, especially if there is a lot of nebula. (Also, stuff isn't designed to look good at that level, but, I mean, that's kind of whatever.)

Epic, thank you!

I might have already handled the performance/visual problem through other means (mod story spoiler stuff), but I'll make sure to check when possible.


Actually - another thing I wanted to change was the `easySensorBonus`, which is "hardcoded" at runtime.
I did successfully change it at runtime, but, uh, in such a way that will probably break next patch (by calling `settings.setFloat("easySensorBonus", bonus)` and then calling a method in `StarfarerSettings` to make it stick, which is bad).

Any chance of getting that one moddable as well? Not a biggie to me if not, having that zoom adjustment will be far more impactful what what I'm doing.
« Last Edit: August 01, 2022, 09:28:46 AM by Wispborne »
Logged
Mod: Persean Chronicles | Mod Manager: SMOL | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

Gabs

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8986 on: August 05, 2022, 01:11:57 PM »

Hello, any tips on how to draw a modded commodity in the same way as the crew and marines? I mean the 'more quantity' = 'draw bowling pin formation' in the cargo holds.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8987 on: August 06, 2022, 12:06:35 PM »

Re: further zoom stuff etc - I'll keep it in mind!

Also, added SettingsAPI.setEasySensorBonus(float easySensorBonus);

Hello, any tips on how to draw a modded commodity in the same way as the crew and marines? I mean the 'more quantity' = 'draw bowling pin formation' in the cargo holds.

Ah - that's actually totally hardcoded to only work for crew and marines, sorry :)

Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8988 on: August 06, 2022, 12:45:04 PM »

Re: further zoom stuff etc - I'll keep it in mind!

Yay!

Antichrist Hater

  • Ensign
  • *
  • Posts: 33
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8989 on: August 08, 2022, 08:48:43 PM »

Also is there a way to increase ECM cap to %20 just like Nav rating?

Yes but you'd, IIRC, have to edit the script and recompile it/provide your own version etc.


How do I do this? 10% is insignificant. The cap should be higher by default
Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8990 on: August 09, 2022, 05:26:58 AM »

NickXR and I encountered a problem when trying to make my mod pass messages to his Detailed Combat Results mod during combat: the only available bus was Global.getCombatEngine().getCustomData(), entries in which accumulate and might persist in saves.  Therefore, NickXR had to add to the manager of these entries a method to delete them, and my own mod must include a duplicate of that manager to call this method every frame should Realistic Combat be installed without Detailed Combat Results.  It occurs to me that a similar API method called HashMap<String, Object> Global.getCombatEngine().getFrameCustomData() providing a data bus flushed after every frame would let all modders that want to pass messages between mods every frame avoid this issue.

Lemuria

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8991 on: August 09, 2022, 11:38:08 AM »

How can I alter the description of a planet/station?

Anything - file editing or ConsoleCommands will work.
Logged
Lemuria#0685 on the Unofficial Starsector Discord

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8992 on: August 09, 2022, 11:49:53 AM »

NickXR and I encountered a problem when trying to make my mod pass messages to his Detailed Combat Results mod during combat: the only available bus was Global.getCombatEngine().getCustomData(), entries in which accumulate and might persist in saves.  Therefore, NickXR had to add to the manager of these entries a method to delete them, and my own mod must include a duplicate of that manager to call this method every frame should Realistic Combat be installed without Detailed Combat Results.  It occurs to me that a similar API method called HashMap<String, Object> Global.getCombatEngine().getFrameCustomData() providing a data bus flushed after every frame would let all modders that want to pass messages between mods every frame avoid this issue.

shouldn't he just add methods that you and other modders can call rather than a whole entry manager?

edit: i think i understand, it's so you don't need to add it as a compile dependency. my only comment on that is you should just not add entries if the mod isn't enabled, unless your mod also has a use for those entries.
« Last Edit: August 09, 2022, 11:57:38 AM by presidentmattdamon »
Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8993 on: August 09, 2022, 01:33:59 PM »

shouldn't he just add methods that you and other modders can call rather than a whole entry manager?

edit: i think i understand, it's so you don't need to add it as a compile dependency. my only comment on that is you should just not add entries if the mod isn't enabled, unless your mod also has a use for those entries.

I suggested this, but Nick rightly pointed out that it would create a hard dependency on DCR.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8994 on: August 09, 2022, 06:24:37 PM »

NickXR and I encountered a problem when trying to make my mod pass messages to his Detailed Combat Results mod during combat: the only available bus was Global.getCombatEngine().getCustomData(), entries in which accumulate and might persist in saves.  Therefore, NickXR had to add to the manager of these entries a method to delete them, and my own mod must include a duplicate of that manager to call this method every frame should Realistic Combat be installed without Detailed Combat Results.  It occurs to me that a similar API method called HashMap<String, Object> Global.getCombatEngine().getFrameCustomData() providing a data bus flushed after every frame would let all modders that want to pass messages between mods every frame avoid this issue.

Stuff in combat engine should not persist in saves unless a mod does something really ill-advised such as saving a reference to Global.getCombatEngine() in a member variable of a script that *does* go into a savefile, or some such. The combat engine, and more specifically the custom data, will get reset every time there's a new battle, or a new simulator run, etc.
Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8995 on: August 09, 2022, 07:01:54 PM »

Stuff in combat engine should not persist in saves unless a mod does something really ill-advised such as saving a reference to Global.getCombatEngine() in a member variable of a script that *does* go into a savefile, or some such. The combat engine, and more specifically the custom data, will get reset every time there's a new battle, or a new simulator run, etc.

That's a relief to know, though I take you to mean Global.getCombatEngine().getCustomData() persists between frames.  A version that resets every frame would be very helpful for message passing.  :)

presidentmattdamon

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8996 on: August 09, 2022, 07:10:01 PM »

Stuff in combat engine should not persist in saves unless a mod does something really ill-advised such as saving a reference to Global.getCombatEngine() in a member variable of a script that *does* go into a savefile, or some such. The combat engine, and more specifically the custom data, will get reset every time there's a new battle, or a new simulator run, etc.

That's a relief to know, though I take you to mean Global.getCombatEngine().getCustomData() persists between frames.  A version that resets every frame would be very helpful for message passing.  :)

why do you need his listener though? why can't you use Global.getSettings().getModManager() (i forget what the actual method is) to check if the Detailed Combat Results mod is enabled before putting messages into the custom data?
Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8997 on: August 10, 2022, 06:52:42 AM »

why do you need his listener though? why can't you use Global.getSettings().getModManager() (i forget what the actual method is) to check if the Detailed Combat Results mod is enabled before putting messages into the custom data?

Because adding a check for Detailed Combat Results to Realistic Combat would introduce a hard dependency.

Lemuria

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8998 on: August 10, 2022, 07:29:54 AM »

How can I alter the description of a planet/station?

Anything - file editing or ConsoleCommands will work.

P.S. I have decided to answer my own question.

I wrote a tutorial on altering planet and station descriptions here:
https://github.com/a-random-lemurian/lem-starsector-stuff/blob/main/description_change.md
Logged
Lemuria#0685 on the Unofficial Starsector Discord

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8999 on: August 10, 2022, 07:34:34 AM »

P.S. I have decided to answer my own question.

I wrote a tutorial on altering planet and station descriptions here:
https://github.com/a-random-lemurian/lem-starsector-stuff/blob/main/description_change.md

Congrats!
Pages: 1 ... 598 599 [600] 601 602 ... 706