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 ... 737 738 [739]

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24809
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11070 on: November 02, 2024, 02:27:04 PM »

If the system boosts top speed and turn rate, these will make it slow the speed/turn rate down to the ship's normal maximums when the ship system finishes working.
Logged

TimeDiver

  • Captain
  • ****
  • Posts: 399
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11071 on: November 02, 2024, 02:58:46 PM »

On a somewhat-related note; is it just me, or are all ships that are not fighter wings capped to ~600 SU per second, barring small boosts from hullmods and/or ship systems?

I mean, it's already hilarious that some mods' frigates are outrunning (most) carriers' fighter wings, but from a purely in-engine perspective I remain curious.
Logged

banano of doom

  • Captain
  • ****
  • Posts: 263
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11072 on: November 02, 2024, 10:01:59 PM »

how could i make a campaign ability that can be toggled on and off while paused, and take effect while paused? i.e. make things happen on even of toggle on/off, not after unpausing
i can't quite figure out which methods to override for that, is there an example?

also
how can i get absolute size of a starSystem? using getMapGridWidthOverride causes null crash
« Last Edit: November 02, 2024, 11:13:08 PM by banano of doom »
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: 24809
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11073 on: November 03, 2024, 09:42:29 AM »

On a somewhat-related note; is it just me, or are all ships that are not fighter wings capped to ~600 SU per second, barring small boosts from hullmods and/or ship systems?

I mean, it's already hilarious that some mods' frigates are outrunning (most) carriers' fighter wings, but from a purely in-engine perspective I remain curious.

I think fighters are limited to that, too? It's 600 plus whatever acceleration the object is capable of in one frame. It's there because when stuff goes faster, collisions etc gets a little weird.

how could i make a campaign ability that can be toggled on and off while paused, and take effect while paused? i.e. make things happen on even of toggle on/off, not after unpausing
i can't quite figure out which methods to override for that, is there an example?

If you look at TransponderAbility, the activateImpl() method gets called while the game is paused. Pretty much all the abilities can be toggled on/off while paused - I think literally all.

how can i get absolute size of a starSystem? using getMapGridWidthOverride causes null crash

I'm fairly sure that what's causing a crash is not this method, but trying to cast a null Float returned by this method to a float. It's a good idea to be careful when casting Float/Integer/etc into the corresponding primitives, since you'll get an NPE if the object is null.

I'm not sure the question makes sense, star systems don't have a size, the map grid has a size. There's some default value - I forget exactly what it is? Might be something like 44000 units or 22000, I don't honestly remember. And if getMapGridWidthOverride() is set (i.e. not null) that gets used instead. There's also a bug (fixed in dev) where one of the two overrides - either the width or the height - gets ignored and just he one of them is used for both dimensions of the grid.
Logged

ctuncks

  • Commander
  • ***
  • Posts: 152
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11074 on: November 04, 2024, 01:06:21 AM »

Just wondering is there anyway to disable a .wpn file being read on application load?

Example: I have a small mod that has the taclaser.wpn file inside of it's data/weapons folder. The only changes to it's file are the Fringe, Core & Flash Colours which overwrite the base games entry in the file.

Is it possible to tell the game not to read my version of the file so it will default to the base games or any other mod that has a version of the same file? Looking to make a settings toggle in config.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24809
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11075 on: November 05, 2024, 10:47:19 AM »

Hmm, I think that's called "renaming the file to something else or deleting it"? I'm not sure why you'd want the file to have the exact name and be there if you *don't* want the game to read it.
Logged

ctuncks

  • Commander
  • ***
  • Posts: 152
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11076 on: November 05, 2024, 10:15:19 PM »

I do want the game to read the files, but I also want users to be able to easily disable them via a settings file if they're not so fond of the colour choices I've made. Effectively have multiple mini-modules that can be enabled or disabled within the module.

I think using an external executable jar might be what I'm looking for. Having said jar delete the files when the config file calls for it or copying them back in otherwise when executed, thanks for the reply it's gotten me to think a little bit more out of the box on this matter and a few others.
Logged

Mycophobia

  • Lieutenant
  • **
  • Posts: 51
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11077 on: November 06, 2024, 03:03:39 AM »

Asking this on behalf of Chinese Modder CJY who asked me to translate and forward the question:

While assisting with the Gamma War mod, I helped the author added a function that allows a specific hullmod to be added to a ship of the player's choice through conversation with an NPC. I found that if the player tries to add the hullmod (through member.getVariant().addHullMod() ) to a start that was given at the start of the game (like the free wolf at vanilla start, or any ship given at nex start), the hull mods are not installed on the ship in the refit screen and the script associated with the hullmod do not function. However, a check for Variant.hasHullMod() for the added hullmod will return true.

Ships that isn't given at the start can display and use the added hull mod fine. Can anyone advise what is going on?

Logged

Genir

  • Captain
  • ****
  • Posts: 252
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11078 on: November 06, 2024, 08:32:57 AM »

Not sure if this thread is the right place for this question, but how can I embed Vimeo videos on the forum?

https://fractalsoftworks.com/forum/index.php?topic=8117 says to just past the link, but it doesn't seem to work:

https://player.vimeo.com/video/1026930513?h=9c69150945

Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24809
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11079 on: November 06, 2024, 11:18:35 AM »

I do want the game to read the files, but I also want users to be able to easily disable them via a settings file if they're not so fond of the colour choices I've made. Effectively have multiple mini-modules that can be enabled or disabled within the module.

I think using an external executable jar might be what I'm looking for. Having said jar delete the files when the config file calls for it or copying them back in otherwise when executed, thanks for the reply it's gotten me to think a little bit more out of the box on this matter and a few others.

Hmm, that doesn't sound like a great idea - deleting files is fairly easy to mess up and has potentially bad consequences for the user's system. It sounds like maybe providing two versions of the mod might be the simplest way to go? Though if you want to have many such options, not just on/off for everything, hm. Not sure what I'd suggest.

Not sure if this thread is the right place for this question, but how can I embed Vimeo videos on the forum?

https://fractalsoftworks.com/forum/index.php?topic=8117 says to just past the link, but it doesn't seem to work:

Seems to work for me! The video is embedded in the post.

Asking this on behalf of Chinese Modder CJY who asked me to translate and forward the question:

While assisting with the Gamma War mod, I helped the author added a function that allows a specific hullmod to be added to a ship of the player's choice through conversation with an NPC. I found that if the player tries to add the hullmod (through member.getVariant().addHullMod() ) to a start that was given at the start of the game (like the free wolf at vanilla start, or any ship given at nex start), the hull mods are not installed on the ship in the refit screen and the script associated with the hullmod do not function. However, a check for Variant.hasHullMod() for the added hullmod will return true.

Ships that isn't given at the start can display and use the added hull mod fine. Can anyone advise what is going on?

I'm not sure where this is being done, but if you look at the NGCAddStandardStartingScript class, its adjustStartingHulls() method modifies variants successfully, so the issue may be due to where/at what time this modification happens.
Logged

ctuncks

  • Commander
  • ***
  • Posts: 152
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11080 on: November 06, 2024, 10:25:08 PM »

Hmm, that doesn't sound like a great idea - deleting files is fairly easy to mess up and has potentially bad consequences for the user's system. It sounds like maybe providing two versions of the mod might be the simplest way to go? Though if you want to have many such options, not just on/off for everything, hm. Not sure what I'd suggest.

That's a valid concern, but my intended scope in this case is only duplicate .wpn files in my own mods directory nothing within either the base directory or anyone else's mod.
Logged

AtlanticAccent

  • Lieutenant
  • **
  • Posts: 80
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11081 on: November 07, 2024, 06:24:39 AM »

Just wondering is there anyway to disable a .wpn file being read on application load?

Example: I have a small mod that has the taclaser.wpn file inside of it's data/weapons folder. The only changes to it's file are the Fringe, Core & Flash Colours which overwrite the base games entry in the file.

Is it possible to tell the game not to read my version of the file so it will default to the base games or any other mod that has a version of the same file? Looking to make a settings toggle in config.

Fwiw, at least fringe and core have setters on BeamWeaponSpecAPI. So you can grab the root WeaponSpecAPI from SettingsAPI, cast it to BeamWeaponSpecAPI and then modify those values globally from there. I can't find a getter or setter for flash colour though - maybe I'm looking for the wrong thing?

Edit: if by flash you're referring to muzzle flash, there doesn't seem to be a neat way to obtain the global spec for a given muzzle flash. MuzzleFlashSpec does exist in the public API, but there's no neat getter for it specifically in WeaponSpecAPI or SettingsAPI. SettingsAPI does have an arbitrary `getSpec(   Class c, String id, boolean nullOnNotFound )` method, but I don't know what the ID should be for a muzzle spec. In this case I might ask Alex if he knows a solution or could add something to the API for this.
« Last Edit: November 07, 2024, 10:49:11 AM by AtlanticAccent »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24809
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11082 on: November 07, 2024, 09:52:01 AM »

That's a valid concern, but my intended scope in this case is only duplicate .wpn files in my own mods directory nothing within either the base directory or anyone else's mod.

Yeah, I get it. Key word being "intended" :) Any code that goes and deletes files in a loop, man, it makes me nervous. Not telling you not to do it, just my advice is to be very, very, very careful.
Logged

Genir

  • Captain
  • ****
  • Posts: 252
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11083 on: November 07, 2024, 11:02:01 AM »

Seems to work for me! The video is embedded in the post.

Indeed! Turns out the video is not visible only when using reply Preview option. Thanks for the reponse.
Logged

NikoTheGuyDude

  • Captain
  • ****
  • Posts: 375
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #11084 on: November 07, 2024, 03:59:27 PM »

How does RingBandAPI setColor() work? I've been using it to set color of a thing of mine to red, but it remains white. Texture attached.

Code
        val band = system.addRingBand(
            hole,
            "planets",
            "MPCatmosphere3",
            7f,
            1,
            Color.RED,
            40f,
            5000f,
            5f
        ) as RingBandAPI

Note the Color.RED. I've tried calling the method manually, no dice.
It seems to have no effect on other RingBandAPI instances.
Logged
Pages: 1 ... 737 738 [739]