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 ... 485 486 [487] 488 489 ... 706

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

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7290 on: April 17, 2021, 07:51:33 PM »

I have gotten into the proc-gen code and I can tell you it is arcane. You can mod the /campaign/procgen files pretty easily, but they work in broad strokes.
Logged

Xeno056

  • Ensign
  • *
  • Posts: 25
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7291 on: April 17, 2021, 08:45:51 PM »

I have gotten into the proc-gen code and I can tell you it is arcane. You can mod the /campaign/procgen files pretty easily, but they work in broad strokes.
Yeah I figured as much. Looks like my problem was editing the wrong value:habOffsetMin and not frequency, which is what I assume I want to change. D'oh. Any way to change number of planets in system from there that I'm missing? Or is that the .jsons? Either way thank you very much.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7292 on: April 17, 2021, 08:55:42 PM »

Hmm - I'm guessing you have a custom plugin in Nex? Since this isn't a problem in vanilla.

The "uiUpdateOnly" parameter for the plugin should be true when it's called like that, I suspect. The plugin should not actually add to the population growth when this is true, but should only update the various stats that impact it so that the tooltips etc can show up-to-date values.
I haven't modified CoreImmigrationPluginImpl or PopulationComposition beyond the debug messages though, that's the thing. One of the other mods I'm using might have done it, but I don't know who'd even want to do so.

Testing notes:
The above results were from a game played with Nexerelin (and other mods) from the start, colony created in cycle 214. Has bug.
New Nex game (no other major mods), colony created in cycle 206: No bug. (EDIT: Actually no, it does reach 100% growth progress, Nex just wasn't increasing colony size in response)
Loaded Nex (and no other major mods) into existing vanilla save, colony created in cycle 213: Bug.

Which supports my vague hypothesis that some class in the call stack (ReachEconomyStepper?) sees that a market has been added multiple cycles in the game and calls the immigration task repeatedly in order to "catch up". But eyeballing ReachEconomyStepper and ImmigrationTask didn't suggest a place where this would be happening.

EDIT: No, that's not it. It's also happening in the cycle 206 colony and I have no idea why aaaa

Well, I already have a workaround in mind (if colony growth progress reaches 100% within X days of founding, reset it) which I'll try.
« Last Edit: April 18, 2021, 12:37:48 AM by Histidine »
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7293 on: April 18, 2021, 10:29:29 AM »

I'm trying to manually set a growth limit to a single colony - as in, not letting it grow past a specified size.

Am I missing an obvious function, or is there no way to do this?
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7294 on: April 18, 2021, 11:24:01 AM »

Use an EveryFrameScript and do:

Code: java
market.getPopulation().setWeight(getWeightForMarketSizeStatic(desiredSize));
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7295 on: April 18, 2021, 11:28:51 AM »

Thanks a lot!
Logged

Zudgemud

  • Commander
  • ***
  • Posts: 225
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7296 on: April 18, 2021, 12:45:10 PM »

Is there any easy way of making a ship system spawn a drone at a target location instead of from the ship's hull?

I basically want to spawn a drone/autonomous ship like one places a doom mine.
Logged

Haka

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7297 on: April 18, 2021, 03:47:26 PM »

Quick guess: Do your weapons have their autofit tags set? Like LMG has "pd6, kinetic3, SR"
Derp.

Thanks, and thanks for all the work, especially with the quick update turn around on Nex.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1723
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7298 on: April 19, 2021, 07:31:05 AM »

Code: java
public class PLIntel extends BaseIntelPlugin {
public void createLargeDescription(CustomPanelAPI panel, float width, float height) {
TooltipMakerAPI info = panel.createUIElement(width, height, false);
panel.addUIElement(info).inTL(0, 0);

// sorry
info.addPlaythroughDataPanel(width, height);
}
}
Oh... well, it's Ok, Alex, I understand. But, just to make sure, is there any way for us to use the great looking elements on display in the playthrough log intel?

Is there any easy way of making a ship system spawn a drone at a target location instead of from the ship's hull?

I basically want to spawn a drone/autonomous ship like one places a doom mine.
Sounds like you might want to check out Global.getCombatEngine().getFleetManager().spawnShipOrWing()

Nick XR

  • Admiral
  • *****
  • Posts: 712
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7299 on: April 19, 2021, 09:31:16 AM »

In the
Code
DamageListener.reportDamageApplied()
method is there a way to get the WeaponAPI or DamagingProjectileAPI?  So far all the testing I've done shows it as just a ShipAPI.  I don't think it's possible to track a unit of damage back to the originating weapon (or ship system) with the listener, but I wanted to verify that's correct before I start doing anything silly to try and tie it together.  Thanks!
I think you're right, yes.

I'm able to parse apart what's happening with the DamageListener when the damage comes from a DamagingProjectileAPI but when the damage comes from a BeamAPI I'm having trouble.  From what I can tell with beams, multiple damages caused by the same type of weapon are usually only reported once (like if you have an Eagle with 3 gravitron beams hitting the same target, there will be only one DamageListener event.)  But even when there are many dissimilar beams hitting the same target, if all the beams do the same damage type, most of the time there will be only one reported event to the DamageListener. 

Maybe there's a bug in the listener code with regards to beams?  Also regarding the DamageListener interface, if the reportDamageApplied method could also include the WeaponAPI that caused the damage, not only would it make the stuff I'm doing in my mods easier it might enable other mod authors to do some weird on-hit stuff with some weapons.  (If there's not already a way to do that sort of thing)

Thanks!

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7300 on: April 19, 2021, 02:04:29 PM »

Hello Alex. How would you decrease the quality of ships (fleets and submarket) globally? I'd love to make pristine ships very rare but have no idea where to start looking at.

Found it - qualityPerDmods setting - set it to something low.

Also, how can I change the buying price of d-modded ships? We have "hullWithDModsSellPriceMult" but not "hullWithDModsBuyPriceMult" (seems to be hardcoded to 0.8 per d-mod).
« Last Edit: April 19, 2021, 03:05:10 PM by Jaghaimo »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7301 on: April 19, 2021, 03:18:01 PM »

EDIT: No, that's not it. It's also happening in the cycle 206 colony and I have no idea why aaaa

Well, I already have a workaround in mind (if colony growth progress reaches 100% within X days of founding, reset it) which I'll try.

Hmm, weird! Nothing comes to mind as far as any sort of "catch up" code in vanilla. Well - let me know if there's anything you want me to have a look at?



Is there any easy way of making a ship system spawn a drone at a target location instead of from the ship's hull?

I basically want to spawn a drone/autonomous ship like one places a doom mine.

I'm not sure if there's  an elegant-er way of doing it, but at a minimum you could probably have a script that detects when the drone spawns and moves it wherever you like.


Code: java
public class PLIntel extends BaseIntelPlugin {
public void createLargeDescription(CustomPanelAPI panel, float width, float height) {
TooltipMakerAPI info = panel.createUIElement(width, height, false);
panel.addUIElement(info).inTL(0, 0);

// sorry
info.addPlaythroughDataPanel(width, height);
}
}
Oh... well, it's Ok, Alex, I understand. But, just to make sure, is there any way for us to use the great looking elements on display in the playthrough log intel?

Ah - not to repeat the comment, but - sorry :(



In the
Code
DamageListener.reportDamageApplied()
method is there a way to get the WeaponAPI or DamagingProjectileAPI?  So far all the testing I've done shows it as just a ShipAPI.  I don't think it's possible to track a unit of damage back to the originating weapon (or ship system) with the listener, but I wanted to verify that's correct before I start doing anything silly to try and tie it together.  Thanks!
I think you're right, yes.

I'm able to parse apart what's happening with the DamageListener when the damage comes from a DamagingProjectileAPI but when the damage comes from a BeamAPI I'm having trouble.  From what I can tell with beams, multiple damages caused by the same type of weapon are usually only reported once (like if you have an Eagle with 3 gravitron beams hitting the same target, there will be only one DamageListener event.)  But even when there are many dissimilar beams hitting the same target, if all the beams do the same damage type, most of the time there will be only one reported event to the DamageListener. 

Maybe there's a bug in the listener code with regards to beams?  Also regarding the DamageListener interface, if the reportDamageApplied method could also include the WeaponAPI that caused the damage, not only would it make the stuff I'm doing in my mods easier it might enable other mod authors to do some weird on-hit stuff with some weapons.  (If there's not already a way to do that sort of thing)

Thanks!

Maybe you're just seeing the beam damage events reported every 1/10th of a second, and they don't line up on the same frame? Haven't looked at the code, but it's *really* hard to imagine how beam damage from multiple beams would accidentally get aggregated and/or only reported once. That'd take some real work and a bunch of code.

Re: passing in a WeaponAPI: duly noted! Would involve passing it through a bunch of method calls that currently don't have it, though. ... perhaps adding it to DamageAPI might be the way to go. I'll make a note.


Hello Alex. How would you decrease the quality of ships (fleets and submarket) globally? I'd love to make pristine ships very rare but have no idea where to start looking at.

Found it - qualityPerDmods setting - set it to something low.

That's not quite what you want, I don't think. E.G. if you set it to 0.05 then a ship with 0.8 quality would get 4 d-mods. But a ship with 1.0 quality would still have 0-1 d-mods, and so on.

Some fleets spawned by the game just have a fixed quality, too, so they wouldn't be affected.

I think the best way to do this would be to apply a quality modifier to all colonies. Something like what PopulationAndInfrastructure does:

float stabilityQualityMod = FleetFactoryV3.getShipQualityModForStability(stability);
market.getStats().getDynamic().getMod(Stats.FLEET_QUALITY_MOD).modifyFlatAlways(getModId(0), stabilityQualityMod, "Stability");

That'd... affect just about everything, except fleet spawns where quality is fixed.


Also, how can I change the buying price of d-modded ships? We have "hullWithDModsSellPriceMult" but not "hullWithDModsBuyPriceMult" (seems to be hardcoded to 0.8 per d-mod).

I don't think you can; there's just a mult the ship buy price, but whether it has d-mods doesn't look like it's factored in at all.
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 712
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7302 on: April 19, 2021, 05:06:12 PM »

In the
Code
DamageListener.reportDamageApplied()
method is there a way to get the WeaponAPI or DamagingProjectileAPI?  So far all the testing I've done shows it as just a ShipAPI.  I don't think it's possible to track a unit of damage back to the originating weapon (or ship system) with the listener, but I wanted to verify that's correct before I start doing anything silly to try and tie it together.  Thanks!
I think you're right, yes.

I'm able to parse apart what's happening with the DamageListener when the damage comes from a DamagingProjectileAPI but when the damage comes from a BeamAPI I'm having trouble.  From what I can tell with beams, multiple damages caused by the same type of weapon are usually only reported once (like if you have an Eagle with 3 gravitron beams hitting the same target, there will be only one DamageListener event.)  But even when there are many dissimilar beams hitting the same target, if all the beams do the same damage type, most of the time there will be only one reported event to the DamageListener. 

Maybe there's a bug in the listener code with regards to beams?  Also regarding the DamageListener interface, if the reportDamageApplied method could also include the WeaponAPI that caused the damage, not only would it make the stuff I'm doing in my mods easier it might enable other mod authors to do some weird on-hit stuff with some weapons.  (If there's not already a way to do that sort of thing)

Thanks!

Maybe you're just seeing the beam damage events reported every 1/10th of a second, and they don't line up on the same frame? Haven't looked at the code, but it's *really* hard to imagine how beam damage from multiple beams would accidentally get aggregated and/or only reported once. That'd take some real work and a bunch of code.

Re: passing in a WeaponAPI: duly noted! Would involve passing it through a bunch of method calls that currently don't have it, though. ... perhaps adding it to DamageAPI might be the way to go. I'll make a note.

Ah, that makes a bit more sense  Any thoughts on the best way of when to check for if a beam should have done damage during a frame?  There's BeamAPI.didDamageThisFrame() but I haven't noticed that lining up with the data in the listeners, but I'll look at it again.

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7303 on: April 19, 2021, 05:32:30 PM »

Any way to change number of planets in system from there that I'm missing? Or is that the .jsons?

Number of planets in a system is determined by minOrbits and maxOrbits in star_gen_data.csv
Logged

Sarissofoi

  • Captain
  • ****
  • Posts: 405
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #7304 on: April 19, 2021, 06:25:06 PM »

Way to modify value of exploration missions?
Like derelict/station scan or surveying a planet?
Pages: 1 ... 485 486 [487] 488 489 ... 706