Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 675 676 [677] 678 679 ... 711

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

alaricdragon

  • Commander
  • ***
  • Posts: 163
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10140 on: September 07, 2023, 12:58:59 PM »

hello once more all you kind people. i am hear with questions again
    1) is there a way to edit the 'hazard rating' of a 'market condition' conditionally? or to otherwise change the 'hazard' of a 'market condition' with code?
    2) is there a way to edit the code that runs when you click the 'hazard pay' button on the market screen?
    3) is there a way to edit the code that runs when you click the 'free port' button on the market screen?
    4) is there a way to change the text and descriptions for the 'free port' and 'hazard pay' buttons on the market screen? ether conditionally or overall?
thank you all again for reading and maybe answering my question. hope you all have a good day =)
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 840
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10141 on: September 07, 2023, 02:20:58 PM »

hello once more all you kind people. i am hear with questions again
    1) is there a way to edit the 'hazard rating' of a 'market condition' conditionally? or to otherwise change the 'hazard' of a 'market condition' with code?
    2) is there a way to edit the code that runs when you click the 'hazard pay' button on the market screen?
    3) is there a way to edit the code that runs when you click the 'free port' button on the market screen?
    4) is there a way to change the text and descriptions for the 'free port' and 'hazard pay' buttons on the market screen? ether conditionally or overall?
thank you all again for reading and maybe answering my question. hope you all have a good day =)
Hi,

1) extremely simple: market.getHazard().modify...;
2) no (trust me, I really, really tried, but it's entirely private static methods)
3) no (freeport code is obfuscated)
4) no (most colony UI code is obfuscated)
« Last Edit: September 07, 2023, 02:22:36 PM by SirHartley »
Logged

Lukas04

  • Captain
  • ****
  • Posts: 372
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10142 on: September 08, 2023, 06:57:47 AM »

Is there a way to get the entity that the player is hovering their mouse over in the campaign?
Specificly without it being a course target.
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10143 on: September 08, 2023, 07:33:00 AM »

Is there a way to get the entity that the player is hovering their mouse over in the campaign?
Specificly without it being a course target.

Doesn't look like it. Just added:
SectorAPI.getMousedOverEntity()
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3027
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10144 on: September 08, 2023, 05:15:14 PM »

Is there a way to get the entity that the player is hovering their mouse over in the campaign?
Specificly without it being a course target.

Doesn't look like it. Just added:
SectorAPI.getMousedOverEntity()

Boom! Campaign ability targeting has been added! (I kid, sortof)
Logged

Mitsuru-Ch

  • Ensign
  • *
  • Posts: 16
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10145 on: September 09, 2023, 04:28:14 AM »

I have a custom faction with custom music. The music does not play ingame. However, if I Alt + Tab or otherwise unfocus the game tab, the music does play. The music only doesn't play if the game window is in focus. Does anyone know what could be causing this?

For context, it used to work fine. I adjusted the music tracks in Audacity and now they do not play ingame, only tabbed out.
« Last Edit: September 09, 2023, 05:33:53 AM by Mitsuru-Ch »
Logged

Lukas04

  • Captain
  • ****
  • Posts: 372
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10146 on: September 09, 2023, 07:54:29 AM »

Actually unrelated to my previous question, how do you get the Mouse Position in Campaign Coordinates?
I want something to happen when the mouse intersects with the radius of a Ring Terrain.
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10147 on: September 09, 2023, 07:59:57 AM »

I have a custom faction with custom music. The music does not play ingame. However, if I Alt + Tab or otherwise unfocus the game tab, the music does play. The music only doesn't play if the game window is in focus. Does anyone know what could be causing this?

For context, it used to work fine. I adjusted the music tracks in Audacity and now they do not play ingame, only tabbed out.

Super weird! Do you have an older version of the track to try with? What you've described makes me wonder if the change to the track isn't just a red herring, and if the issue isn't some change that happened on your system, instead.

Actually unrelated to my previous question, how do you get the Mouse Position in Campaign Coordinates?
I want something to happen when the mouse intersects with the radius of a Ring Terrain.

SectorAPI.getViewport().convertScreenXToWorldX() and convertScreenYToWorldY().

Edit: this may not work when UI scaling is set to anything other than 100% - it takes as input coordinates from mouse input events - InputEventAPI - not the raw mouse coordinate values. So if using raw mouse coordinates, you'd need to adjust them by the screen scale multiplier, which you can get from SettingsAPI.getScreenScaleMult().
« Last Edit: September 09, 2023, 08:02:58 AM by Alex »
Logged

rogerbacon

  • Commander
  • ***
  • Posts: 151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10148 on: September 10, 2023, 11:36:19 AM »

How do I create a beam weapon that does not interact with fighters? In other words, I want it to pass over fighters and only affect ships.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10149 on: September 11, 2023, 08:50:57 AM »

In the .wpn file, set:
"collisionClass":"<class>",
"collisionClassByFighter":"<class>", # when *fired* by a fighter

Where <class> is one of:
HITS_SHIPS_AND_ASTEROIDS
HITS_SHIPS_ONLY_FF
HITS_SHIPS_ONLY_NO_FF

Whichever one of those is desired. "FF" means "friendly fire".
Logged

touchofvanilla

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10150 on: September 12, 2023, 05:46:10 PM »

I'm trying to make a planet that receives only very little light from its local star; however, I can't seem to find a way to visually make the planet completely dark on the campaign layer. What would be the best method to go about this?
Logged
-Vanilla

Lukas04

  • Captain
  • ****
  • Posts: 372
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10151 on: September 13, 2023, 04:37:43 AM »

Anyway to make an icon appear on the Hyperspace-Starscape map without a system being in that location?
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10152 on: September 13, 2023, 10:40:49 AM »

I'm trying to make a planet that receives only very little light from its local star; however, I can't seem to find a way to visually make the planet completely dark on the campaign layer. What would be the best method to go about this?

Hmm, I'm not sure that you can. Possibly calling SectorEntityToken.setLightSource() on it every frame might do the trick? But it also might not work since the game will be doing this too, using the primary star, so it depends on the order of these calls within the frame. I've added a few ways to override this a couple of weeks ago - MemFlags.LIGHT_SOURCE_OVERRIDE and MemFlags.LIGHT_SOURCE_COLOR_OVERRIDE - but these aren't in the currently-out version.

Anyway to make an icon appear on the Hyperspace-Starscape map without a system being in that location?

I don't think so, the only things that shows are 1) stars, 2) the faked up "nebulas" around the stars, and 3) slipstreams, in dev. Oh, and the constellation/other labels. Hmm. No way to piggyback on any of that comes to mind.
Logged

Wispborne

  • Captain
  • ****
  • Posts: 414
  • Discord: wispborne
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10153 on: September 13, 2023, 11:01:49 AM »

Not really a modding question but this kind of a request thread and it's related to modding, so...

Thoughts on adding RAM to the log file in this section?
Code
Starting Starsector 0.96a-RC10 launcher
Running in E:\Starsector\starsector-core
OS: Windows 8.1 6.3
Java version: 1.7.0_79 (64-bit)

The max JVM RAM is a useful thing to know when debugging modded saves. 2GB allocated + 30 mods enabled, hmmmmmm. It is often clear when something is a OOM crash because it says it, but not _always_ (and VRAM crashes don't have any crash message at all).

LazyWizard determines it like so:
https://github.com/LazyWizard/console-commands/blob/master/src/main/kotlin/org/lazywizard/console/ext/SystemInfoExtRAM.kt

GPU doesn't come up as much when troubleshooting (on the Discord anyway) and is more fiddly to get, but if it's a pain point: https://github.com/LazyWizard/console-commands/blob/master/src/main/kotlin/org/lazywizard/console/ext/SystemInfoExtGPU.kt

Also, shameless self-promotion for where I'd use one or both; my logfile viewer: https://chipper.pages.dev/
Logged
Mod: Persean Chronicles | Mod Managers: SMOL & TriOS | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).

Mitsuru-Ch

  • Ensign
  • *
  • Posts: 16
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10154 on: September 13, 2023, 12:45:51 PM »

Is the raider behavior of pirates and luddic path hardcoded? How would I go about making a faction do raids on systems like pirates do?

Is the salvager behavior of independents hardcoded? How would I go about making a faction send out exploration fleets like independents do?
« Last Edit: September 13, 2023, 12:49:16 PM by Mitsuru-Ch »
Logged
Pages: 1 ... 675 676 [677] 678 679 ... 711