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: Codex Overhaul (05/11/24)

Pages: 1 ... 629 630 [631] 632 633 ... 717

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

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9450 on: January 03, 2023, 06:51:44 AM »

Is there any way to create a association between a debris field and the battle that spawned it, as well as, potentially, the specific engagement results that caused it to spawn?

Ex. if a hegemony and tritach fleet fight, hegemony loses 3 onslaughts, tritach loses 4 paragons, I want to be able to assocaite that debris field with 3 hegemony onslaughts vs 4 tritach paragons. I want to do this so I can spawn derelicts in-combat when you fight inside a debris field.

I was thinking a reportbattleoccured listener that would add a script that checks next frame for a debris field on the battle coordinates (or this frame), but this could get false positives potentially. It would probably be a lot easier with a terrain creation listener.
Logged

Ontheheavens

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9451 on: January 03, 2023, 06:53:43 AM »

I'm setting my text width override in TooltipMakerAPI and then adding text:

(first screenshot)
Code
        moduleInfoPanel.setTextWidthOverride(200f);
        String shortenedShipName = moduleInfoPanel.shortenString(member.getShipName(), 175);
        LabelAPI shipNameLabel = moduleInfoPanel.addPara(shortenedShipName, PanelConstants.PLAYER_COLOR, 2f);

All good. But as soon as I swap addPara() for addTitle(), width override gets seemingly ignored. Nothing else was changed, it is most certainly difference between addPara and addTitle. Did I do something wrong here? What did I overlook? Can I get identical to addTitle() formatting using addPara()?
 
(second screenshot)
Code
        moduleInfoPanel.setTextWidthOverride(200f);
        String shortenedShipName = moduleInfoPanel.shortenString(member.getShipName(), 175);
        LabelAPI shipNameLabel = moduleInfoPanel.addTitle(shortenedShipName, PanelConstants.PLAYER_COLOR);

[attachment deleted by admin]
Logged
   

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24326
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9452 on: January 03, 2023, 10:58:05 AM »

And is this true for ships generally, besides the Conquest?  :D

This is for broadside ships deciding which broadside to use.

All good. But as soon as I swap addPara() for addTitle(), width override gets seemingly ignored. Nothing else was changed, it is most certainly difference between addPara and addTitle. Did I do something wrong here? What did I overlook? Can I get identical to addTitle() formatting using addPara()?

IIRC that method is only for addPara(). But you could emulate the same format as addTitle() by doing tooltip.setParaFont("graphics/fonts/orbitron12condensed.fnt"), I believe. The default title color is "tooltipTitleAndLightHighlightColor" in settings.json.
Logged

Ontheheavens

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9453 on: January 03, 2023, 11:24:58 AM »

All good. But as soon as I swap addPara() for addTitle(), width override gets seemingly ignored. Nothing else was changed, it is most certainly difference between addPara and addTitle. Did I do something wrong here? What did I overlook? Can I get identical to addTitle() formatting using addPara()?

IIRC that method is only for addPara(). But you could emulate the same format as addTitle() by doing tooltip.setParaFont("graphics/fonts/orbitron12condensed.fnt"), I believe. The default title color is "tooltipTitleAndLightHighlightColor" in settings.json.

Thank you, just what I needed! Incidentally, I was using Misc.getPlayerColor() as a substitute for title color (didn't know better), glad to be corrected.
« Last Edit: January 03, 2023, 11:35:44 AM by Ontheheavens »
Logged
   

alaricdragon

  • Commander
  • ***
  • Posts: 167
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9454 on: January 03, 2023, 12:22:20 PM »

hey all, i got myself one last random question for now.
1) is there a way to replace PlayerFleetPersonnelTracker pacifically its GroundRaidObjectivesListener, with my own version of said class? i need to replace some things in it.
thank you again all for the kindness of helping me with the things.
Logged

Tranquility

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9455 on: January 03, 2023, 11:03:37 PM »

Is there a way to force custom secondary and tertiary stars (as well as their orbiting planets) to show up on the Star Systems list in the Planets tab? I've been using the StarSystemAPI's setSecondary() and setTertiary() to set the second and third stars on my modded star systems, but they don't seem to make them show up on the Systems list at all. Nothing in the Core World .java files in data.scripts.world.systems seems to indicate how this is done, especially considering the Core World systems with two stars do have their second star show up on the list (not to mention that they also do setSecondary() too). If this information helps, I'm generating my modded star systems using onNewGameAfterProcGen(); I'm hoping that the point at which a system generates doesn't affect whether the Star System list will show the secondary and tertiary stars.

On a related note, the orbiting Ta'xet star in the Tia-Ta'xet system doesn't have its own corona yet, nor is it set as a secondary star in the TiaTaxet.java file (it also doesn't show up on the Star Systems list either). If nothing else, maybe that can be fixed in the next update?

Ontheheavens

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9456 on: January 04, 2023, 01:41:19 AM »

Code
setHighlightBrightness(float highlightBrightness)
in ButtonAPI doesn't seem to work as one would expect: that highlight would be less pronounced when mousing over button. In fact, whether I pass 0.0001f or 900f as argument doesn't seem to change anything at all (calling the method right after creating ButtonAPI instance). Is this method supposed to work only under certain conditions? If yes, are there any other ways I can influence degree of color change when button is moused over on?

Edit: another question - is tooltip background of some vanilla UI tooltips created using 32x32 sprite (ui/bgs/panel00_center.png), or with equivalent amount of GL11-drawn lines?
In other words, are few calls of one big background sprite rendering preferable to considerably more numerous GL11 calls of vertex rendering? Or is there no difference, granted custom UI panel environment?
« Last Edit: January 04, 2023, 05:51:27 AM by Ontheheavens »
Logged
   

Liral

  • Admiral
  • *****
  • Posts: 725
  • Realistic Combat Mod Author
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9457 on: January 04, 2023, 07:11:54 AM »

This is for broadside ships deciding which broadside to use.

Wow have you thought of everything over the years!

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24326
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9458 on: January 04, 2023, 10:03:23 AM »

Thank you, just what I needed! Incidentally, I was using Misc.getPlayerColor() as a substitute for title color (didn't know better), glad to be corrected.

Glad that did it!

hey all, i got myself one last random question for now.
1) is there a way to replace PlayerFleetPersonnelTracker pacifically its GroundRaidObjectivesListener, with my own version of said class? i need to replace some things in it.
thank you again all for the kindness of helping me with the things.

That might be a little tricky. You'd need to look at the places it's being used and do some careful surgery. The cleanest way to go might be to leave it in Sector memory, under $core_personnelTracker (so that the game doesn't keep trying to re-create it), and to remove it from Global.getSector().getGenericPlugins() and from Global.getSector().getListenerManager().

And then to add your version to those places. Also, the MercsOnTheRunBarEvent directly references PlayerFleetPersonnelTracker (it probably shouldn't), so you'd need to provide another version of that that works with your implementation.


Is there a way to force custom secondary and tertiary stars (as well as their orbiting planets) to show up on the Star Systems list in the Planets tab? I've been using the StarSystemAPI's setSecondary() and setTertiary() to set the second and third stars on my modded star systems, but they don't seem to make them show up on the Systems list at all. Nothing in the Core World .java files in data.scripts.world.systems seems to indicate how this is done, especially considering the Core World systems with two stars do have their second star show up on the list (not to mention that they also do setSecondary() too). If this information helps, I'm generating my modded star systems using onNewGameAfterProcGen(); I'm hoping that the point at which a system generates doesn't affect whether the Star System list will show the secondary and tertiary stars.

I think you might need to set the StarSystemType for the system, via system.setType().


On a related note, the orbiting Ta'xet star in the Tia-Ta'xet system doesn't have its own corona yet, nor is it set as a secondary star in the TiaTaxet.java file (it also doesn't show up on the Star Systems list either). If nothing else, maybe that can be fixed in the next update?

Thank you, let me make a note.


Code
setHighlightBrightness(float highlightBrightness)
in ButtonAPI doesn't seem to work as one would expect: that highlight would be less pronounced when mousing over button. In fact, whether I pass 0.0001f or 900f as argument doesn't seem to change anything at all (calling the method right after creating ButtonAPI instance). Is this method supposed to work only under certain conditions? If yes, are there any other ways I can influence degree of color change when button is moused over on?

This only affects the brightness when the button is .highlight()'ed - a more permanent, non-mouse-over state like e.g. for the currently-selected tab in a UI with several tabs.
Let me add:
   float getGlowBrightness();
   void setGlowBrightness(float glowBrightness);
To ButtonAPI.

Edit: another question - is tooltip background of some vanilla UI tooltips created using 32x32 sprite (ui/bgs/panel00_center.png), or with equivalent amount of GL11-drawn lines?
In other words, are few calls of one big background sprite rendering preferable to considerably more numerous GL11 calls of vertex rendering? Or is there no difference, granted custom UI panel environment?

I'm fairly sure the tooltip background is generally just a black quad. In places where it's not, generally something like graphics/fx/scanline11.png would be used. I wouldn't use GL11 lines for something like this, no - it's a lot of lines and the performance impact would generally be significant.
Logged

Ontheheavens

  • Commander
  • ***
  • Posts: 137
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9459 on: January 04, 2023, 11:06:08 AM »

This only affects the brightness when the button is .highlight()'ed - a more permanent, non-mouse-over state like e.g. for the currently-selected tab in a UI with several tabs.

Huh, turns out I was woefully mistaken about the very nature of the methods I was calling. Perhaps some form of short hint-like Javadoc in ButtonAPI could be of use for the future modders like me?

Although, what moved me to tinker with highlight brightness was the fact that there appeared to be next to no difference in button color when mousing over it, because I called highlight() on it right after creation, so I thought mouseover is what highlight() is for, said highlight being a manual call to the mouseover state. Testing again right now:

Creating ButtonAPI like this:

Code
        ButtonAPI toggleButtonInstance = capacityPanel.addButton(status, null,
                Misc.getBasePlayerColor(), Misc.getDarkPlayerColor(), Alignment.MID,
                CutStyle.ALL, 75f, 25f, 2f);
        if (capacity.isToggledOn()) {
            toggleButtonInstance.highlight();
        }

Two relevant colors are base player and dark player colors. Button is immediately recreated on click via remove/add parent component, so gets created in a finished state. Such a setup produces an unsatisfactory result with almost no visual telling if button is moused over, see attached picture. I am able to work around this (not to perfect satisfaction, sadly), just thought it might be thought-provoking.

Edit: excuse my poor wording, problem was a bit different: color of the button is identical when mousing over it whether it is in an enabled or disabled state. That's what I deemed unsatisfactory at the time, perhaps the issue is in the eye of the beholder. Indeed, thinking it over and everything makes plenty of sense - tab buttons are supposed to be like this, and for having one button for disable/enable there are area checkboxes. My fault, sorry!

Let me add:
   float getGlowBrightness();
   void setGlowBrightness(float glowBrightness);
To ButtonAPI.

You are my hero, sir!

I'm fairly sure the tooltip background is generally just a black quad. In places where it's not, generally something like graphics/fx/scanline11.png would be used. I wouldn't use GL11 lines for something like this, no - it's a lot of lines and the performance impact would generally be significant.

I see, thank you. Now thinking about it, can't even recall where I got this idea that something had that striped background...

[attachment deleted by admin]
« Last Edit: January 04, 2023, 11:24:51 AM by Ontheheavens »
Logged
   

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9460 on: January 04, 2023, 03:21:36 PM »

Is there any way to spawn a hulk in combat, and then split it? I ask because I was recently told that setHulk(true), or some similar method, would automatically force a ship to become a hulk. I'm not sure of how true this is, but in the case it's wrong, all I want is some way to just create derelicts in combat without messing around with post-battle loot/creating the death message.

I also want the resulting ship to be dead, so split() works, and I'm not sure if setHulk(true) kills a ship or not.
Logged

Tranquility

  • Commander
  • ***
  • Posts: 172
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9461 on: January 04, 2023, 08:58:10 PM »

I think you might need to set the StarSystemType for the system, via system.setType().

It worked! I set the appropriate type for the custom binary and trinary star systems, and I was able to get those systems to display their secondary/tertiary stars on the Star Systems list. Thank you, Alex!

rogerbacon

  • Commander
  • ***
  • Posts: 151
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9462 on: January 05, 2023, 04:11:11 PM »

I'd like to add an option to the player's choices when he has the option to stabilize cargo pods floating in space. Where would I do that?
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 249
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9463 on: January 07, 2023, 10:07:33 AM »

Are InstallableItemEffects singletons, or does an instance of this exist for every item? Ex. if I install 3 nanoforgres on 3 worlds, do those 3 nanoforges each have their own instance of this class?
Logged

Great Wound

  • Captain
  • ****
  • Posts: 283
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #9464 on: January 07, 2023, 10:27:29 AM »

Hey Alex, could you add a way for ships to house drone-fighters only. Currently the only way is through the automated ship hullmod and there's nothing in the hullmod itself that governs this so I'm guessing it's handled elsewhere.

It would be nice if we could, for example, remove the mining pods from the Shepherd and upgrade it to carry wasps... or worse...
Pages: 1 ... 629 630 [631] 632 633 ... 717