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 ... 631 632 [633] 634 635 ... 706

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9480 on: January 12, 2023, 03:52:34 PM »

I guess it's more accurate to say they don't have a *meaningful* mass - the impact values are basically just some random stuff from about 10 years ago that didn't pan out!
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9481 on: January 12, 2023, 06:21:39 PM »

I think you might need to set the StarSystemType for the system, via system.setType().
about that
is there a (safe) way to make system with
several stars orbiting a non-star center
several stations orbiting the stars
AND several stations orbiting a non-star center
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.

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9482 on: January 13, 2023, 02:49:17 AM »

Right, loading-order stuff like this can happen sometimes and it's a huge pain. I think the way you're working around it seems reasonable? Or am I missing something and is there still a problem? Generally though the solution for this sort of thing is "avoid the situation and lazy-load at some later point" etc.
Yeah the workaround is perfectly fine, I was just annoyed that the faction wasn't loading its own def on its own readResolve.

Anyway new question: How often is a hub mission recreated? I've got a case where leaving the conversation, undocking and redocking with the market causes a new instance to be created (verified with a log message in the constructor), but I dunno if it's devmode-specific.
(Trying to fix an issue where leaving the convo and then asking about the mission again sometimes changes the mission target, whose picking logic exists outside the hub mission)
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9483 on: January 13, 2023, 08:56:47 AM »

I'd like to modify the parameters of a projectile (missile) after launch.

I have an OnFireEffectPlugin and in the OnFire method I can make some changes like setMaxFlightTime, setDamageAmount, and setHitpoints. Is there any way to set missile parameters that are normally set by the weapon in the weapon_data.CSV? I'd like to change proj speed and impact, among others.
Logged

Sombra

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9484 on: January 15, 2023, 08:12:21 AM »

Hi! I'm working on a bigger mod which puts "Discovery: Freelancer" into Starsector. (Check this if you are curious!)

I have a few questions where googling was rather unhelpful.

1. How can I make new ships (non-vanilla ships) randomly spawn as derelicts, so you can find them via exploration?

2. I would like to add a new system, but I do not want it to show up on the hyperspace map, making it only accessible via Nascent Gravity Well. I've found the file that spawns a certain system that is only accessible this way, but how would I go about implementing it?

3. I would like to add a faction that exclusively spawns out of nowhere in hyperspace, without a base or planet. How would I go about that, and are there mods that do that?

4. I would like to keep my mod independent from Nexerelin, so it can be played without it. Is there a way to...
a) add faction blueprints to the trait picker screen from Nexerelin, so that if a player chooses "Make your own faction!", they can start with the tech package of faction X, without having Nexerelin being an essential mod to make my mod work?
b) make the factions of my mod automatically be recognized by Nexerelin without Nexerelin being an essential mod to make my mod work?

Thanks in advance!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9485 on: January 15, 2023, 09:57:18 AM »

about that
is there a (safe) way to make system with
several stars orbiting a non-star center
several stations orbiting the stars
AND several stations orbiting a non-star center

As far as having it show "correctly" in the visual representation of the star system? I don't think so.

Yeah the workaround is perfectly fine, I was just annoyed that the faction wasn't loading its own def on its own readResolve.

The vagaries of xstream! Guessing there's a good reason for why it happens sometimes, but, yeah.

Anyway new question: How often is a hub mission recreated? I've got a case where leaving the conversation, undocking and redocking with the market causes a new instance to be created (verified with a log message in the constructor), but I dunno if it's devmode-specific.
(Trying to fix an issue where leaving the convo and then asking about the mission again sometimes changes the mission target, whose picking logic exists outside the hub mission)

Generally speaking the missions get created when the hub is shown and then aborted when the hub is exited. So the important thing is to make sure that mission creation is deterministic to the extent that that's possible.


I'd like to modify the parameters of a projectile (missile) after launch.

I have an OnFireEffectPlugin and in the OnFire method I can make some changes like setMaxFlightTime, setDamageAmount, and setHitpoints. Is there any way to set missile parameters that are normally set by the weapon in the weapon_data.CSV? I'd like to change proj speed and impact, among others.

The missile has mutable stats, like a ship - except, oops, this isn't exposed in the API. Added MissileAPI.getStats(). Beyond that, I'm not sure how you'd go about this.



Hi! I'm working on a bigger mod which puts "Discovery: Freelancer" into Starsector. (Check this if you are curious!)

Hi - very cool!


1. How can I make new ships (non-vanilla ships) randomly spawn as derelicts, so you can find them via exploration?

I don't think there's a super easy/clean way; see: SalvageSpecialAssigner.getNearbyFactions() for how the factions for derelict ships get picked. Basically it's: independents, mercenaries, and pirates, plus whatever factions have colonies within 15 light-years of the location.

You could add your own copy of NearbyEventsEvent that would spawn some additional derelicts now and again; that might be the best way.

2. I would like to add a new system, but I do not want it to show up on the hyperspace map, making it only accessible via Nascent Gravity Well. I've found the file that spawns a certain system that is only accessible this way, but how would I go about implementing it?

I'm not sure what you mean, exactly - aside from copy-pasting this and modifying it?

3. I would like to add a faction that exclusively spawns out of nowhere in hyperspace, without a base or planet. How would I go about that, and are there mods that do that?

I don't know about mods that do that, but, yeah, you would basically add a script that spawns fleets (or adds routes to the RouteManager.getInstance()), depending on what exactly you wanted. This is very much doable with code.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9486 on: January 15, 2023, 05:15:09 PM »

is it possible to get the goal target angle for an individual weaponAPI ?
as in, angle where the weapon is actively turning right now to, but not yet facing
cause weapons in the same weapon group can aim and fire at different things, so it must be on individual per-weapon basis
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.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9487 on: January 15, 2023, 05:35:32 PM »

You'd need to provide a custom weapon AI for it via ModPlugin.pickWeaponAutofireAI(). Which would involve doing more work than just providing the angle - it'd also need to say when to fire, check for friendly fire danger, respect any applicable weapon AI hints (such as it being PD or not), etc.
Logged

bananana

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9488 on: January 15, 2023, 07:42:58 PM »

You'd need to provide a custom weapon AI for it via ModPlugin.pickWeaponAutofireAI(). Which would involve doing more work than just providing the angle - it'd also need to say when to fire, check for friendly fire danger, respect any applicable weapon AI hints (such as it being PD or not), etc.
nonono
i'm not trying to make weapon do anything
i'm just trying to get what exactly is it doing
in this case it looks like it's turning to aim at a specific point of a specific ship
the ship will no longer be there when the weapon finishes turning due to being slow
but i want to know where the weapon is trying to aim at this current moment
is it possible?
something like weapon.whatAreYouAimingAt, which returns float or vector2f
« Last Edit: January 15, 2023, 07:45:41 PM by passwalker »
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.

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9489 on: January 16, 2023, 05:34:02 AM »

Is there a way I can intercept damage to a shield right before it is applied and modify it? If so, has the damage at that point already been affected by any damage modifiers based on damage type, shield efficiency or other things?


I want to create a different type of shield where it doesn't create flux when hit but there is a total amount of damage it can take per battle before shutting down.
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9490 on: January 16, 2023, 05:36:47 AM »

Is there a way I can intercept damage to a shield right before it is applied and modify it? If so, has the damage at that point already been affected by any damage modifiers based on damage type, shield efficiency or other things?


I want to create a different type of shield where it doesn't create flux when hit but there is a total amount of damage it can take per battle before shutting down.

make damageTakenModifier listener & add it to the target ship, they get run before hits get fully processed.
« Last Edit: January 16, 2023, 05:39:30 AM by Ruddygreat »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9491 on: January 16, 2023, 01:35:33 PM »

nonono
i'm not trying to make weapon do anything
i'm just trying to get what exactly is it doing
in this case it looks like it's turning to aim at a specific point of a specific ship
the ship will no longer be there when the weapon finishes turning due to being slow
but i want to know where the weapon is trying to aim at this current moment
is it possible?
something like weapon.whatAreYouAimingAt, which returns float or vector2f

Ahhh, I'm sorry, totally misread what you meant.

AutofireAIPlugin.getTarget() should do it.

You'd get at it by using WeaponGroupAPI.getAutofirePlugin(WeaponAPI weapon).

Stuff could be null at times - the target, or the plugin (possibly, if the weapon is not on autofire at that point; I don't 100% remember).
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 142
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9492 on: January 16, 2023, 07:29:44 PM »

I want to make a hull mod that will be built-in only. If I set no_drop in the hull_mods.csv and don't include it in any blueprint will that be enough or is there some other way to do it?
Logged

Redeye43

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9493 on: January 17, 2023, 11:26:05 AM »

I'm trying to figure out how to make universal mounts capable of mounting any smaller weapon- the json doesn't seem to have anything to fix it, does anyone have any ideas as to how? Did I just blatantly miss something?
Logged

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9494 on: January 17, 2023, 11:37:25 AM »

I'm trying to figure out how to make universal mounts capable of mounting any smaller weapon- the json doesn't seem to have anything to fix it, does anyone have any ideas as to how? Did I just blatantly miss something?

as far as I know you just can't, mounts can only mount smaller weapons that are the same type (and only one size down).
Pages: 1 ... 631 632 [633] 634 635 ... 706