Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.98a is out! (03/27/25)

Pages: 1 ... 43 44 [45]

Author Topic: API request thread (please read OP before posting!)  (Read 274104 times)

starficz

  • Lieutenant
  • **
  • Posts: 62
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #660 on: March 02, 2025, 09:25:44 AM »

making ButtonAPI include getListener/setListener along with a public ButtonListenerAPI would be really nice. Currently its possible to add buttons to any TooltipMakerAPI, but its not actually possible to tell when said button is clicked.
« Last Edit: March 02, 2025, 09:29:49 AM by starficz »
Logged

banano of doom

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #661 on: March 04, 2025, 12:32:02 AM »

not so much an API request, but more of a suggestion to how game data json is loaded, and how it can be loaded in a more flexible way
when dealing with json loading for my own purposes, i came to the problem that i do not want to copypaste the entire json object when i want to make a copy of it with only one or two parameters changed
as such i came up with a rather janky, but functional solution, that allows me to define a "parent" key in that json, and on loading said object it will attempt to load also the parent, and inherit all the values not defined in the child, and then garandparent, etc etc, until it reaches the very base definition of that type of object
Spoiler
Code
public static JSONObject getMergedJSONInheritParameters(JSONObject all, String key, String parentKey, String defaultParentID){
        JSONObject j1 = null;
        try {
            j1 = all.getJSONObject(key);
            String p1 = j1.optString(parentKey, defaultParentID);
            while(true){
                JSONObject j2 = all.getJSONObject(p1);
                Iterator<String> kk = j2.sortedKeys();
                while(kk.hasNext()){
                    String k1 = kk.next();
                    if(!j1.has(k1)){
                        j1.put(k1,j2.get(k1));
                    }
                }
                if(p1.equals(defaultParentID))break;
                p1 = j2.optString(parentKey);
            }
        }catch (Exception ex){
            throw new RuntimeException("error parsing "+key, ex);
        }
        return j1;
    }
[close]
so my request is, implement some similar functionality for loading some vanilla data files, in particular ships and weapons, but customEntities would be helpful too.
by adding a special `"extends"` field/column to those json/csv files
this will probably have some impact on loading time, not sure how much. but this will simplify modding and core game development by some amount, in particular things like "_fighter" versions of the weapons, instead of having a full set of all values defined, would have only one or two values, and the rest would be inherited from the parent data.
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

starficz

  • Lieutenant
  • **
  • Posts: 62
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #662 on: March 12, 2025, 04:42:18 PM »

in CustomPanelAPI, it would be nice to have a method that can return the CustomUIPanelPluginAPI bound to it.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1027
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #663 on: March 15, 2025, 03:00:21 AM »

Requesting a memory key that can be set to force allow hazard pay despite a colony being at max size (to keep it from shrinking if possible through modded nonsense)
Logged

Liral

  • Admiral
  • *****
  • Posts: 780
  • Realistic Combat Mod Author
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #664 on: March 27, 2025, 07:01:32 PM »

Please add getArmorRating and setArmorRating to ShipHullSpecAPI because I want to adjust the armor rating of ships to balance them for Realistic Combat.

starficz

  • Lieutenant
  • **
  • Posts: 62
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #665 on: March 28, 2025, 09:05:34 AM »

LabelAPI is currently not an extension of UIComponentAPI even though I think its a strict superset, so it should be. Adding this would be very nice as it allows us to anchor positions relative to LabelAPI's
Logged

Protonus

  • Captain
  • ****
  • Posts: 454
  • AAAAAAAAAAAA
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #666 on: April 04, 2025, 12:52:59 AM »

Spoiler request
Spoiler
RoilingSwarmEffect parameters are currently protected and can't be used for something like another fabricator ship system.
[close]
Logged

The cookies are a weird one, okay.

banano of doom

  • Captain
  • ****
  • Posts: 369
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #667 on: April 05, 2025, 10:04:03 PM »

please add String texturePath parameter to at least one of the engine.addWhateverParticle
there's like 20 different addParticle implementation for different textures, instead of just one that takes texture as parameter

also

please add an escape clause, by tag or stat, to fleet pushing terrains to avoid said push
setting acceleration value to really high value works, but it interferes with outer mechanics

also

please make abyss depth parameters public, from HyperspaceAbyssPluginImpl.getAbyssalDepth, or put them in settings
it's a bit of a hassle to obtain them programmatically by probing that function
i mean the float baseW = 100000f; float baseH = 50000f;
i.e. please add this:
Spoiler
    public static Vector2f getAbyssCenter(){

        float w = Global.getSettings().getFloat("sectorWidth");
        float h = Global.getSettings().getFloat("sectorHeight");
        return new Vector2f(
            -w/2f, -h/2f
        );
    }
    public static Vector2f getAbyssSize(){
        float baseW = 100000f;
        float baseH = 50000f;

        Vector2f out = new Vector2f(baseW, baseH);
        return out;
    }
[close]
« Last Edit: April 10, 2025, 11:26:46 PM by banano of doom »
Logged
my mods:


please do not ask me for permission to use my code or sprites - the answer is "yes" by default, on condition that my involvement is never mentioned

Massacre

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #668 on: April 13, 2025, 03:16:29 AM »

Add getters and setters for PhaseCloak Speed Nerf things, for example if modmaker want to make a hullmod which removes speed nerf completely for example or changes percent of speed. It possible to override these for vanilla Phase Cloak but that way it won't change modded Phase Cloaks. I mean setters for PhaseCloakStats FLUX_LEVEL_AFFECTS_SPEED, MIN_SPEED_MULT and BASE_FLUX_LEVEL_FOR_MIN_SPEED. Also for PhaseCloak would be neat some color override setter, it actually remove need to create custom PhaseCloaks just for different color.
Logged

Massacre

  • Ensign
  • *
  • Posts: 18
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #669 on: April 13, 2025, 03:31:48 AM »

Also good idea might be actually put these variables into settings.json as well
Logged

Histidine

  • Admiral
  • *****
  • Posts: 5135
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #670 on: April 19, 2025, 11:15:40 PM »

HostileActivityCause2.getFactorProgressMult or somesuch (and maybe getFactorMagnitudeMult)

Would be read by BaseHostileActivityFactor. A cause would use this to multiply progress from all causes it shares a factor with (e.g. in vanilla this would let Kanta's protection zero out the other pirate activity causes without them needing to check for protection themselves)
Logged

THEASD

  • Lieutenant
  • **
  • Posts: 56
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #671 on: April 29, 2025, 04:51:27 AM »

Please add:
   PersonAPI getPerson();
for:
    com.fs.starfarer.api.characters.MutableCharacterStatsAPI

If some situations (like createCustomDescription for skills) I should get the officer person from a MutableCharacterStatsAPI, which is currently inconvenient
Logged
Also known as AnyIDElse.
Pages: 1 ... 43 44 [45]