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: Planet Search Overhaul (07/13/24)

Pages: 1 ... 711 712 [713] 714 715 ... 735

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

Killer of Fate

  • Admiral
  • *****
  • Posts: 1358
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10680 on: May 13, 2024, 05:39:13 AM »

using dev mode's variant editor... Just a question, where is the game saving those variants? Cause I have no idea... It doesn't seem to replace the internal, but they are somewhere out there, cause the SCVE is detecting them... Just where? Checked saves but didn't see anything.
Logged

Zumberge

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10681 on: May 13, 2024, 06:53:36 PM »

It doesn't seem like this was asked, and I can't recall seeing any examples, so here goes.

There are ships with multiple modules to them - stations in the base game, and ships proper in mods like Roider Union, Knights of Ludd, and Low Tech Armada.  But would - or could - a phase ship with multiple modules function properly?  That is, if it phased, would all of the modules phase out with the main part of the ship?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10682 on: May 14, 2024, 10:20:14 AM »

I have a question.
I need an instruction how to implement specific faction's fleet randomly spawning at renmant controlled factions (Ones with warning beacons).
I mean i have my faction and i want to get my faction fleets randomly fly around renmant controlled systems and attack droneship fleets.


Take a look at something like com.fs.starfarer.api.impl.campaign.procgen.themes.RuinsFleetRouteManager, what that does and where/how it's used - that's what spawns scavengers flying around in various systems. Alternatively you might try a simpler script that doesn't bother with "routes" and just spawns fleets directly when the player is around. see DisposablePirateFleetManager for an example of that.

using dev mode's variant editor... Just a question, where is the game saving those variants? Cause I have no idea... It doesn't seem to replace the internal, but they are somewhere out there, cause the SCVE is detecting them... Just where? Checked saves but didn't see anything.

I don't know offhand where it goes when used from a game install, I always run it from my dev setup. I'd suggest doing a search for .variant files.

It doesn't seem like this was asked, and I can't recall seeing any examples, so here goes.

There are ships with multiple modules to them - stations in the base game, and ships proper in mods like Roider Union, Knights of Ludd, and Low Tech Armada.  But would - or could - a phase ship with multiple modules function properly?  That is, if it phased, would all of the modules phase out with the main part of the ship?

IIRC it will not work as far as phasing modules in sync wth the ship's body. That might be possible to script around, though - have a hidden build-in hullmod that syncs things up, something like that.
Logged

Massacre

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10683 on: May 15, 2024, 09:28:06 AM »

Alex I have question about FleetInflationListener and reportFleetInflated, it is possible to somehow call it before player hovers mouse on fleet? It works okay for fleet modifications which doesn't change ships, but if I modify ships in fleets, for example I add or remove ships, it noticeable how fleet in campaign level changes when player hover mouse on it. Except this issue, FleetInflationListener so far is most convenient way of modifying existing fleets.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10684 on: May 15, 2024, 04:56:36 PM »

Hmm, are you sure? The fleet inflation and the listener callback happen before the tooltip is created, as far as I can tell, so you shouldn't see any changes on it from the tooltip.

You'd see changes on in the campaign fleet itself, though, if that's what you mean? But I'm not sure what I can do about that.
Logged

Massacre

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10685 on: May 16, 2024, 12:03:59 AM »

Actually I accomplished what I wanted with different Listnener with reportFleetSpawned, which seems spawns correctly now, but the FleetInflationListener, not the regular FleetInflater works like I described - it modifies fleet once player hovers cursor on said fleet. It okay if mod maker adds extra SMod or something, it wont be noticeable, but it isn't suited for modifying fleet itself, since fleet on campaign level will be changed literally on player's eyes once he hovers on fleet, and player will see how fleet is mutated into another one.
Logged

Zsar

  • Captain
  • ****
  • Posts: 312
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10686 on: May 16, 2024, 09:49:46 AM »

Where is the implementation of data.hullmods.DedicatedTargetingCore, data.hullmods.IntegratedTargetingUnit ?
I cannot find a data.hullmods package anywhere. I can find all the mods in com.fs.starfarer.api.impl.hullmods.

Why I am asking: I added 200 base range to all weapons. Heavy Blaster projectiles now dissipate even without any range modifiers before they can hit a target well within range. But 200 is 1/3 of the vanilla range of 600, so a Heavy Blaster on a Capital Ship with ITU should have the same issue (600 - 600 * 1.6 = 360; 360 > 200) - and it does not (presumably).

I'd like not to reimplement (divergingly) the assorted projectile lifetime modifier.
(But if I must, I presume I have to set ProjectileSpecAPI#setMaxRange in addition to WeaponSpecAPI#setMaxRange ? It's not set in heavyblaster_shot.proj , FWIW.)

(Side note: com.fs.starfarer.api.impl.hullmods.BallisticRangefinder does nothing to projectile lifetime... does that mean that a weapon with sufficiently marginal projectile life time would also suffer from prematurely dissipating projectiles on a ship with Ballistic Rangefinder, even though without the mod it would work fine?)
« Last Edit: May 16, 2024, 09:51:49 AM by Zsar »
Logged

Zsar

  • Captain
  • ****
  • Posts: 312
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10688 on: May 16, 2024, 10:40:19 AM »

Is there an easy way to tell ship AI to try and keep a minimum safety distance to other ships - especially hostile ones?

I tried to increase all the ranges, so they do not need to, but many ships nevertheless move so close to their targets that they hinder each other's movement.

It would be nice, if I could tell them something like
- do not try to close further than 200 su
- do not try to close further than (your shortest weapon range) / 2
- (if phase ship) only move into the target on your way out to the other side
or similar.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10689 on: May 16, 2024, 10:55:06 AM »

Where is the implementation of data.hullmods.DedicatedTargetingCore, data.hullmods.IntegratedTargetingUnit ?
I cannot find a data.hullmods package anywhere. I can find all the mods in com.fs.starfarer.api.impl.hullmods.

In the data.hullmods folder :) Compiled on startup by Janino.

Why I am asking: I added 200 base range to all weapons. Heavy Blaster projectiles now dissipate even without any range modifiers before they can hit a target well within range. But 200 is 1/3 of the vanilla range of 600, so a Heavy Blaster on a Capital Ship with ITU should have the same issue (600 - 600 * 1.6 = 360; 360 > 200) - and it does not (presumably).

I'd like not to reimplement (divergingly) the assorted projectile lifetime modifier.
(But if I must, I presume I have to set ProjectileSpecAPI#setMaxRange in addition to WeaponSpecAPI#setMaxRange ? It's not set in heavyblaster_shot.proj , FWIW.)

(Side note: com.fs.starfarer.api.impl.hullmods.BallisticRangefinder does nothing to projectile lifetime... does that mean that a weapon with sufficiently marginal projectile life time would also suffer from prematurely dissipating projectiles on a ship with Ballistic Rangefinder, even though without the mod it would work fine?)

I think there may be some confusion. The flight time is computed automatically based on the actual, fully modified range of the projectile, when the shot is fired.


I want to increase the returns from and cooldown between raids by a factor of 30.
Where should I look to get started?

MarketCMD, $global.raid_cooldown

For the returns from raids, see MarketCMD.performRaid(), I suspect tweaking this would not be very easy though. You'd probably have to implement your own method (and call it) and I'm not sure just how far up the chain you'd have to go replacing things to be able to put in your own implementation. Might be easier to go with a ShowLootListener and somehow detect that it's from a raid and modify what the player gets.

Is there an easy way to tell ship AI to try and keep a minimum safety distance to other ships - especially hostile ones?

Not that I'm aware of. (The AI will close in more than it needs to to hit the enemy, in certain situations, because doing so makes it harder for the enemy to back out of range.)
Logged

Zsar

  • Captain
  • ****
  • Posts: 312
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10690 on: May 16, 2024, 11:22:09 AM »

I think there may be some confusion. The flight time is computed automatically based on the actual, fully modified range of the projectile, when the shot is fired.
Nope, just tested it. The projectile's max range is set when parsing the files, when a script calls WeaponSpecAPI#setMaxRange, then the assorted ProjectileSpecAPI#getMaxRange is and remains exactly the original WeaponSpecAPI#getMaxRange.

(And indeed, updating my script to add the same offset to WeaponSpecAPI and ProjectileSpecAPI fixes the issue that Heavy Blaster, Heavy Autocannon, Mjolnir Cannon projectiles dissipate in-range... I am a bit surprised that Light Needler and Heavy Needler projectiles did not seem to have that issue. All beams worked just by calling WeaponSpecAPI#setMaxRange too, but I guess that's more because they do not have a projectile?)

In the code for the various kinds of targeting computer, I see that unlike Ballistic Rangefinder and my own script, they call MutableShipStatsAPI#getBallisticWeaponDamageMult and from there MutableStat#modifyPercent . ... I think I cannot do that, because as far as I can see, WeaponSpecAPI, ProjectileSpecAPI, MissileSpecAPI neither give or take MutableStats or StatMods.

... Alas.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10691 on: May 16, 2024, 12:01:51 PM »

Ballistic Rangefinder works w/o this "fading too early" issue.

But I see what you're doing now; if you're modifying data in the specs rather than the range for weapons, then that could have all sorts of issues, such as what you ran into with apparently the numbers on the projectile and the weapon specs getting out of sync, so you have to be careful. The flight time IS computed when the shot is fired, so all normal ways of modifying weapon range work here, as long as the data isn't messed up.
Logged

banano of doom

  • Captain
  • ****
  • Posts: 259
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10692 on: May 16, 2024, 04:00:00 PM »

question
how would i obtain a random generic ship or person name, from those available to the given faction?
or access a specific name pool by id?
Logged
Any and ALL sprites i ever posted on this forum are FREE to use. even if i'm using them myself. Don't ever, EVER ask for permission, or i will come to your home and EAT YOUR DOG!!!
i do NOT want to see my name appear in the credits section of any published mod and will consider it a personal insult.

Lukas04

  • Admiral
  • *****
  • Posts: 537
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10693 on: May 16, 2024, 04:34:36 PM »

What is "progress" in ShipSystemAPI.forceState actually supposed to be in, i always get some weird results with it and im not sure if its supposed to be a level from 0-1 or some other kind of value.
« Last Edit: May 16, 2024, 04:36:46 PM by Lukas04 »
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24690
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10694 on: May 16, 2024, 04:50:35 PM »

What is "progress" in ShipSystemAPI.forceState actually supposed to be in, i always get some weird results with it and im not sure if its supposed to be a level from 0-1 or some other kind of value.

It's 0 to 1, how far along it is when charging up/down/in cooldown. Looking at the code, I think it's not supported for setting the state to ACTIVE as far as what the progress would be.

question
how would i obtain a random generic ship or person name, from those available to the given faction?
or access a specific name pool by id?

FactionAPI has a pair of pickRandomShipName() methods.

For a person, it has createRandomPerson() - you could do that and grab the name.
Logged
Pages: 1 ... 711 712 [713] 714 715 ... 735