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)

Pages: 1 ... 678 679 [680] 681 682 ... 701

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

Ruddygreat

  • Admiral
  • *****
  • Posts: 502
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10185 on: September 28, 2023, 12:28:06 PM »

Ah - this is working as intended, yeah. removeEntity() is a low-level method and just removes an entity from the playing field. Anything else that you also want to happen needs to be done directly (and may not have the API exposed, depending on what it is.)

yeah, it doesn't look like anything related to that is exposed to the API (the closest thing sounds like CombatFleetManagerAPI.removeFromReserves(), but that doesn't do it), would it be possible to have those methods get exposed to the API?
Though it's not a *huge* deal, just multiplying the ship's DP by 0 will "fix" the main issue.

Lukas04

  • Captain
  • ****
  • Posts: 322
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10186 on: September 28, 2023, 01:48:10 PM »

1. Is adding more personalities through personalities.csv actually supported, i havent seen a mod add custom personalities with it so im wondering if there is some hurdle there.
2. Is the bravery stat used for anything? Since it appears to be the same for all personalities.
Logged
My Mods

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23736
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10187 on: September 28, 2023, 02:24:15 PM »

Ok, so not even the Width of the beam?

Correct, that's purely visual.

yeah, it doesn't look like anything related to that is exposed to the API (the closest thing sounds like CombatFleetManagerAPI.removeFromReserves(), but that doesn't do it), would it be possible to have those methods get exposed to the API?
Though it's not a *huge* deal, just multiplying the ship's DP by 0 will "fix" the main issue.

I'll keep it in mind!

1. Is adding more personalities through personalities.csv actually supported, i havent seen a mod add custom personalities with it so im wondering if there is some hurdle there.
2. Is the bravery stat used for anything? Since it appears to be the same for all personalities.

1. No; there are hardcoded checks in too many places.
2. It has some effect, I believe, but it'd probably mostly be subtle. To do with how it evaluates some aspects of some threats, but far from comprehensive and not officially supported.
Logged

Kaysaar

  • Captain
  • ****
  • Posts: 348
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10188 on: September 28, 2023, 09:40:51 PM »

Hi I am trying to imitate UI similar to one below, mainly i want to replicate that transparent background
Spoiler
[close]
I am using such code to initalize UI
Spoiler
Code
public class AoTDColonyEventOutcomeDelegate  implements CustomVisualDialogDelegate {
    protected DialogCallbacks callbacks;
    protected AoTDColonyEventOutcomeUI plugin;
    protected InteractionDialogAPI dialog;

    public AoTDColonyEventOutcomeDelegate(AoTDColonyEventOutcomeUI panel , InteractionDialogAPI dialog){
        this.plugin = panel;
        this.dialog = dialog;
    }
    @Override
    public void init(CustomPanelAPI panel, DialogCallbacks callbacks) {
        this.callbacks = callbacks;

        plugin.init(panel, callbacks, dialog);
    }

    @Override
    public CustomUIPanelPlugin getCustomPanelPlugin() {
        return plugin;
    }

    @Override
    public float getNoiseAlpha() {
        return 0;
    }

    @Override
    public void advance(float amount) {

    }

    @Override
    public void reportDismissed(int option) {

    }

Code
public class AoTDColonyEventOutomeDP implements InteractionDialogPlugin {
    public InteractionDialogAPI dialog;
    public AoTDColonyEvent event;

    static enum OptionID {
        INIT,
        LEAVE
    }

    @Override
    public void init(InteractionDialogAPI dialog) {
        this.dialog = dialog;
        this.dialog.getTextPanel();
        dialog.hideTextPanel();
        dialog.setPromptText("");
        dialog.getVisualPanel().finishFadeFast();
        dialog.setOpacity(1.85f);
       
        dialog.setBackgroundDimAmount(0f);
        optionSelected(null, OptionID.INIT);
    }

    public void setEvent(AoTDColonyEvent event) {
        this.event = event;
    }

    @Override
    public void optionSelected(String optionText, Object optionData) {
        if (optionData == OptionID.INIT) {
            //this is where the size of the panel is set, automatically centered
            dialog.showCustomVisualDialog(AoTDColonyEventOutcomeUI.WIDTH + 20, AoTDColonyEventOutcomeUI.HEIGHT + 20, new AoTDColonyEventOutcomeDelegate(new AoTDColonyEventOutcomeUI(),dialog));

        }
    }

    @Override
    public void optionMousedOver(String optionText, Object optionData) {

    }

    @Override
    public void advance(float amount) {

    }

    @Override
    public void backFromEngagement(EngagementResultAPI battleResult) {

    }

    @Override
    public Object getContext() {
        return null;
    }

    @Override
    public Map<String, MemoryAPI> getMemoryMap() {
        return null;
    }
[close]
My problem is I can't get such same effect with transparent background as shown in image and instead got this
Spoiler
[close]
I am using such method because when I used class that implemented CustomDialogDelegate It's not possible to jump from one UI to another after confirm button is pressed.
Honestly now i don't know what to do
Logged

RedDragon924

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10189 on: September 29, 2023, 08:32:18 AM »

Hey, does anyone know how to change the base name of a planet with a code via the console command mod or in the code? I used a code posted elsewhere to spawn a couple planets, forgetting to change the name on the copied code. I didn't think it'd be a problem but now, when I colonize both planets, the game seems to think only one exists and puts the other on a permanent pause. I've tried looking through it in the save's xml file with Notepad++, but the best I can do is just replace a few names here and there, and that doesn't seem to be affecting anything. The help would be greatly appreciated.
Logged

Kaysaar

  • Captain
  • ****
  • Posts: 348
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10190 on: September 29, 2023, 09:01:23 AM »

Hey, does anyone know how to change the base name of a planet with a code via the console command mod or in the code? I used a code posted elsewhere to spawn a couple planets, forgetting to change the name on the copied code. I didn't think it'd be a problem but now, when I colonize both planets, the game seems to think only one exists and puts the other on a permanent pause. I've tried looking through it in the save's xml file with Notepad++, but the best I can do is just replace a few names here and there, and that doesn't seem to be affecting anything. The help would be greatly appreciated.
Code
 for (PlanetAPI planet : Global.getSector().getStarSystem("nameOfSystemWithPlanetsToRename").getPlanets()) {
            if(planet.getId().equals("wantedId")){
                planet.setName("Renamed Planet");
            }
           
        }

Logged

RedDragon924

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10191 on: September 29, 2023, 10:14:27 AM »

Thank you so much! That seemed to do the trick. Both colonies showed up now and progressed normally.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23736
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10192 on: September 29, 2023, 10:22:44 AM »

Hi I am trying to imitate UI similar to one below, mainly i want to replicate that transparent background
Spoiler
[close]
I am using such code to initalize UI

I'm not sure. A dialog using CustomVisualDialogDelegate should have a partially transparent background.

But, this code looks dodgy:
dialog.setOpacity(1.85f);

Opacity should have a value between 0 and 1; I'm actually a bit surprised this doesn't cause a crash.
Logged

TimeDiver

  • Captain
  • ****
  • Posts: 314
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10193 on: September 29, 2023, 10:30:44 AM »

How would someone go about removing / increasing the Burn 20 hard cap without resorting to mods like Sundog's Hyperdrive? Is it something that needs to be done via JavaScript, or is there a setting that I missed when searching in 'data\config\settings.json'?
Logged

Kaysaar

  • Captain
  • ****
  • Posts: 348
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10194 on: September 29, 2023, 10:41:47 AM »

Hi I am trying to imitate UI similar to one below, mainly i want to replicate that transparent background
Spoiler
[close]
I am using such code to initalize UI

I'm not sure. A dialog using CustomVisualDialogDelegate should have a partially transparent background.

But, this code looks dodgy:
dialog.setOpacity(1.85f);

Opacity should have a value between 0 and 1; I'm actually a bit surprised this doesn't cause a crash.
That things with expermenting oppacity was my cry for help.
As problem is such, when I lower oppacity of dialog it does make it transparent, but not only background, UI also becomes transparent to the point when is not readable, and I wondered how could I replicate what was done with example UI I showed
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23736
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10195 on: September 29, 2023, 12:12:50 PM »

How would someone go about removing / increasing the Burn 20 hard cap without resorting to mods like Sundog's Hyperdrive? Is it something that needs to be done via JavaScript, or is there a setting that I missed when searching in 'data\config\settings.json'?

This is actually hardcoded. Along with the UI bar only showing up to 20, though the numbers go up beyond that.


That things with expermenting oppacity was my cry for help.
As problem is such, when I lower oppacity of dialog it does make it transparent, but not only background, UI also becomes transparent to the point when is not readable, and I wondered how could I replicate what was done with example UI I showed

Hmm. Like I was saying, the default custom dialog should have some background transparency - the default amount - so this is all a bit confusing to me.

IIRC the control for how much to dim the background is not exposed for this, unfortunately.
Logged

Kaysaar

  • Captain
  • ****
  • Posts: 348
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10196 on: September 29, 2023, 08:42:28 PM »

How would someone go about removing / increasing the Burn 20 hard cap without resorting to mods like Sundog's Hyperdrive? Is it something that needs to be done via JavaScript, or is there a setting that I missed when searching in 'data\config\settings.json'?

This is actually hardcoded. Along with the UI bar only showing up to 20, though the numbers go up beyond that.


That things with expermenting oppacity was my cry for help.
As problem is such, when I lower oppacity of dialog it does make it transparent, but not only background, UI also becomes transparent to the point when is not readable, and I wondered how could I replicate what was done with example UI I showed

Hmm. Like I was saying, the default custom dialog should have some background transparency - the default amount - so this is all a bit confusing to me.

IIRC the control for how much to dim the background is not exposed for this, unfortunately.
ahh understandable, but gonna say that because of it I needed to rewrite UI and actually this made it better than worse.
Spoiler
[close]
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23736
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10197 on: September 30, 2023, 11:15:16 AM »

That looks nice! Big fan of working illustrations into the UI, for sure.
Logged

nathan67003

  • Commander
  • ***
  • Posts: 128
  • Excellent imagination, mediocre implementation.
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10198 on: October 01, 2023, 10:11:03 PM »

Is it possible to implement a custom star/system/whatever via mods that's outside the Sector's boundaries? It wouldn't show on the map due to being out-of-bounds, for instance.
Logged
I have some ideas but can't sprite worth a damn and the ideas imply really involved stuff which I've no clue how to even tackle.

Ruddygreat

  • Admiral
  • *****
  • Posts: 502
  • Seals :^)
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #10199 on: October 03, 2023, 02:38:36 AM »

kinda vague question, but that's the deal with BALLISTIC_AS_BEAM projectiles?
this is specifically in relation to why changes to their velocity just don't work, though I would generally like to know more about how they work & when to use them over normal projectiles.
Pages: 1 ... 678 679 [680] 681 682 ... 701