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 ... 591 592 [593] 594 595 ... 706

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

ez

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8880 on: June 30, 2022, 10:23:29 AM »

Thanks guys  ;D
Logged

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8881 on: June 30, 2022, 11:02:18 PM »

I created a custom star system, and added the hyperspace objects manually.

Now the star system name NEVER show on hyperspace, including you can't select it as gate destination when gate travelling.

How I fix that?

And no, the thing that lights out mod does is not what I want...
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8882 on: July 03, 2022, 07:18:53 AM »

A custom allied fleet is having the captain removed from its flagship when I join its battle.
Breakpointing FleetMemberAPI.setCaptain led me to FleetData.ensureHasFlagship in the obsf code.

Am I reading this method right, does the code here mean that a fleet must have its flagship be the first ship in the fleet, else that status is given to the said first ship?
It would be nice if it didn't do this if the fleet already has a valid flagship, or at least if it didn't kick off the old flagship's captain when revoking its flagship status. Or if FleetDataAPI.sort put the existing flagship at the front of the fleet to circumvent this issue.

(The fleet's flagship is a cruiser while there is also a capital in the fleet, which I don't want to be the flagship for reasons)

Can I force the flagship to be at the front of the fleet data somehow?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8883 on: July 03, 2022, 07:51:53 AM »

A custom allied fleet is having the captain removed from its flagship when I join its battle.
Breakpointing FleetMemberAPI.setCaptain led me to FleetData.ensureHasFlagship in the obsf code.

Am I reading this method right, does the code here mean that a fleet must have its flagship be the first ship in the fleet, else that status is given to the said first ship?
It would be nice if it didn't do this if the fleet already has a valid flagship, or at least if it didn't kick off the old flagship's captain when revoking its flagship status. Or if FleetDataAPI.sort put the existing flagship at the front of the fleet to circumvent this issue.

(The fleet's flagship is a cruiser while there is also a capital in the fleet, which I don't want to be the flagship for reasons)

Can I force the flagship to be at the front of the fleet data somehow?

Hmm, that's odd - the first ship does not have to be the flagship, no. I think you can see plenty of fleets in vanilla where this isn't the case. The ensureHasFlagship() method should be a no-op if the fleet has exactly one flagship. Is this a manually created fleet? I suspect it may be an issue with the fleet having a commander set, and the commander being assigned to captain a ship, but there not being a fleet.getFleetData().setFlagship(member) call somewhere in there.

(I don't recall why there's a distinction between "flagship" and "fleet member with the fleet commander assigned as captain", but it exists. Possibly to do with some plans that never materialized?)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8884 on: July 03, 2022, 10:02:30 AM »

So far as I can tell, the flagship has been set correctly in fleet data; only one fleet member returns true for isFlagship(), and it is the same one as returned by fleet.getFlagship(). It's a manually created fleet, yeah.
I'll see later if I can generate a small sample fleet that repros the issue.

I created a custom star system, and added the hyperspace objects manually.

Now the star system name NEVER show on hyperspace, including you can't select it as gate destination when gate travelling.

How I fix that?

And no, the thing that lights out mod does is not what I want...
At a guess, the system needs to have its hyperspace anchor set to appear on the map (which would explain why Ziggurat blacksite doesn't have it).
The javadocs are contradictory and out of date, but: Try calling system.generateAnchorIfNeeded to make the system appear.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8885 on: July 03, 2022, 10:46:14 AM »

Ahh, I think I see the issue - it happens when you actually get into the combat, not just when you join the battle in the campaign screen. Checking it out!

Edit: fixed this up! It would only affect allied fleets, and I *think* it would kick out the fleet commander regardless of what ship they were in, so, a pretty significant bug at that. Thank you for the report!

I don't *think* there's a particularly clean workaround, other than, say, undoing this in some combat plugin's init() method or something similar.
« Last Edit: July 03, 2022, 10:55:09 AM by Alex »
Logged

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8886 on: July 03, 2022, 05:13:08 PM »

So far as I can tell, the flagship has been set correctly in fleet data; only one fleet member returns true for isFlagship(), and it is the same one as returned by fleet.getFlagship(). It's a manually created fleet, yeah.
I'll see later if I can generate a small sample fleet that repros the issue.

I created a custom star system, and added the hyperspace objects manually.

Now the star system name NEVER show on hyperspace, including you can't select it as gate destination when gate travelling.

How I fix that?

And no, the thing that lights out mod does is not what I want...
At a guess, the system needs to have its hyperspace anchor set to appear on the map (which would explain why Ziggurat blacksite doesn't have it).
The javadocs are contradictory and out of date, but: Try calling system.generateAnchorIfNeeded to make the system appear.

I had to go poke in the source to find it.

Basically the map shows as valid systems and gate destinations, only jump points (not gravity wells), and they must end on a star. (or nebula, I assume).

A system anchor is NOT enough. A gravity well is NOT enough either, it must be a jump point, and its target must be a star, not another jump point, not a planet, etc... must be specifically, a star.

What the code does when rendering  the map is is call a function on the jump point itself (thus gravity wells don't have it), and the jump point function grabs its destination, then calls "isStar()".
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8887 on: July 03, 2022, 08:24:16 PM »

There doesn't have to be a star jump point. See: nebula centers.
Logged

speeder

  • Captain
  • ****
  • Posts: 364
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8888 on: July 04, 2022, 06:02:46 AM »

I think nebula centers count as star.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8889 on: July 04, 2022, 07:37:27 AM »

Yes, but there is no jump point for it.
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 #8890 on: July 04, 2022, 09:51:24 AM »

I want to programmatically hide the friendly info boxes during combat because they overlap and clutter the battlefield under the extreme zoom-out my mod involves, and I want to replace them with flux and hull diamonds, for which I already have working code, but cannot find an API call to hide the info boxes. I found a hack by simulating an F11 keypress via Robot, to which the OS responds by asking if Starsector should be allowed to control the computer, but I don't want to make users think that my mod hijacks their machine.  Does or will any workaround exist?
« Last Edit: July 04, 2022, 10:04:51 AM by Liral »
Logged

intrinsic_parity

  • Admiral
  • *****
  • Posts: 3071
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8891 on: July 04, 2022, 04:38:07 PM »

Is anyone aware of a mod that disables the ability to create stable points using an alpha core + story point at a star, or any reason why it wouldn't be possible? I don't seem to be able to do that in my current campaign.
Logged

AccuracyThruVolume

  • Commander
  • ***
  • Posts: 133
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8892 on: July 04, 2022, 04:56:02 PM »

Is it possible to create recoiling barrels on a weapon that overlap?     Example:  3 spaced barrels on "bottom" row, two slightly shorter spaced barrels on the "top" row.   They all recoil.     

Is there a limit to the amount of barrels for a weapon?

What is the mutable stat used for the upcoming ablative armor hullmod?   I'd like to make something similar on a smaller scale.   Haven't spotted it yet.  Perhaps a usage of getArmorBonus or getArmorDamageTakenMult?

This is assuming there isn't some other function used in a future update.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8893 on: July 04, 2022, 06:34:33 PM »

Is it possible to create recoiling barrels on a weapon that overlap?     Example:  3 spaced barrels on "bottom" row, two slightly shorter spaced barrels on the "top" row.   They all recoil.
Don't believe so, but I think it's a good idea; being able to spec a "turretGunSprite2" and "hardpointGunSprite2" would be cool for making, say, quad cannons. It does run into the problem of adjudicating which sprite should recoil based on which offsets; unfortunately only our gracious host can really answer the question of whether this is worth his time to consider.

Is there a limit to the amount of barrels for a weapon?
I've made (test) weapons with as many as forty barrel offsets (note, this is a major pain to keep track of and I don't recommend it), but as far as I know there's no set limit.
Logged

SpaceDrake

  • Captain
  • ****
  • Posts: 484
  • Piloting space mecha for fun and profit(?)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #8894 on: July 04, 2022, 10:07:57 PM »

Is anyone aware of a mod that disables the ability to create stable points using an alpha core + story point at a star, or any reason why it wouldn't be possible? I don't seem to be able to do that in my current campaign.

Are you certain you don't already have two occupied points in the system in question?

Somewhat counter-intuitively, gates take up what would be a point slot, IIRC.

I've made (test) weapons with as many as forty barrel offsets (note, this is a major pain to keep track of and I don't recommend it), but as far as I know there's no set limit.

... I'm a little terrified to ask how big that turret was, and I'm someone who's a fan of the Infernus's mega-turret.
Logged
Pages: 1 ... 591 592 [593] 594 595 ... 706