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: Simulator Enhancements (03/13/24)

Pages: 1 ... 29 30 [31] 32 33 ... 42

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

Carabus

  • Lieutenant
  • **
  • Posts: 66
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #450 on: April 08, 2021, 12:56:39 PM »

Can I make a request to have the generation of the d-mod and s-mod bars on ship icon (see below) abstracted and made accessible to the modding API?

I mean these:

In Fleet screen: (here the bars even have tooltips)


In Refit screen:


The bars are also visible on ships icons in the encounter dialogs, and in fleet tooltips in campaign, no idea if elsewhere.

What I request is some way for a mod to decide how many and what color of bars it wants display on a ship icon, to possibly add extra types for some special hullmods in addition to the default green and red ones.
Right now they are hardcoded in the obfuscated part of the code (sorry to dig there, I wanted to check how hardcoded or moddable it is).
The hardcoded logic gets the number of d-mods and displays correct number of red bars with corresponsing tooltips, and then gets the number of built-in mods and displays green bars with corresponding tooltip, which is exactly what we see. What I request is to have this logic to be abstracted and fully or partially overridable by custom implementation.

Simple way - allow full replacement of default bars:

- overridable method getShipIconHullModBars() -> returns list of objects, each object representing one group of colored bars, with fields like this:

class HullModBarsGroup {
   Color barColor;
   int numberOfBars;
   String tooltipText;
}


More advanced way (not exclusive with simple way) - allow adding of new bars at specified place, without removing exisitng ones (would provide better compatibility between mods that all want to add their own special groups):

- overridable method getShipIconExtraHullModBars() -> returns list of objects, each object representing one group of colored bars, and its ordering, with fields like this:

class HullModBarsGroup {
   float order;
   Color barColor;
   int numberOfBars;
   String tooltipText;
}


The default implementation of getShipIconHullModBars() to match the current logic would look like this:

Code
public List<HullModBarsGroup> getShipIconHullModBars(ShipVariantAPI shipVariantAPI) {
   HullModBarsGroup dmodBars = new HullModBarsGroup(
       Color.red,
       DModManager.getNumDMods(shipVariantAPI),
       "Number of d-mods this ship has."
   );
   HullModBarsGroup storyModBars = new HullModBarsGroup(
       Misc.getStoryOptionColor(),
       Misc.getCurrSpecialMods(shipVariantAPI),
       "Number of built in mods this ship has. Only counts mods custom built in after the ship was produced."
   );

   return Arrays.asList(dmodBars, storyModBars);  // assuming they are added right-to-left, which seems to be the case
}
« Last Edit: April 12, 2021, 05:17:17 PM by Carabus »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #451 on: April 08, 2021, 02:19:26 PM »

Can EMP become a DamageType, please?

It's the only kind of damage that doesn't have a type, can't be seen explicitly via DamageListener so far as I could tell, etc., etc.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

RustyCabbage

  • Captain
  • ****
  • Posts: 347
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #452 on: April 12, 2021, 06:03:19 AM »

In HullModSpecAPI, could we get a setManufacturer(String manufacturer) method? Seems like you can change almost everything else.

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #453 on: April 12, 2021, 11:55:49 AM »

Could we get access to whatever script is determining if a skill is unlocked? The skill tree change has proven quite controversial to say the least and having a hundred modders trying to come up with a better system might yield interesting results. I have an idea myself I'd love to implement.
Logged
 

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #454 on: April 13, 2021, 02:39:55 AM »

1. Could we get some input taking UI elements added to the API? You can type your character name, so it does exist. Input box, text area...

2. Also renewing my ask from 0.9.1a for checkboxes - those also exists (codex for example) in core.

3. While I am sharing my wishlist... Could we get cargo / fleet member pickers to work outside of dialogs? Might be affected by the one below...

4. ... And finally renewing my ask for the ability to create UI elements (custom panels) on top of an existing screen. Hope this is not a huge change though (functionality exists, but I get it if it's highly coupled with other code). Ideally I'd love to create a smaller (blocking) panel on top of intel UI (or campaign UI), with an X button and custom content (kinda like you can view commodity demand/availability on top of current market screen).
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 712
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #455 on: April 21, 2021, 11:03:58 PM »

Would you please add a getter for the member DamagingExplosion.damagedAlready ?

Simply:
Code
    public List<Ship> getDamagedAlready() {
        return this.damagedAlready;
    }

Need this in the Detailed Combat Results mod to watch for doom damages.

Thanks!!!

Wyvern

  • Admiral
  • *****
  • Posts: 3786
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #456 on: May 08, 2021, 08:53:07 AM »

It'd be useful if BoostIndustryInstallableItemEffect had at least getters for its protected values; right now, if I want to determine if a thing to be installed in a non-player market is better or worse than what's already installed, I have to:
1: Register my own campaign event listener, because the vanilla implementation in CoreScript just uses Industry.wantsToUseSpecialItem(), which (for vanilla industries) will never allow item upgrades outside of the one corrupted-to-pristine-nanoforge case.
2: Use Industry.getSupplyBonus().getFlatStatMod() with the special item's ID to see if the industry's existing special item provides a bonus - and whether that bonus is larger or smaller than the one offered by the mod item I'm adding.

This is all a bit inconvenient. Honestly, what I'd really like is a 'priority' value in special_items.csv that could then be read by the default implementation of Industry.wantsToUseSpecialItem(), allowing multiple mod-added installable items to co-exist without everyone involved needing their own workaround code.
(Though, even there, I'd still need my own CampaignEventListener, as the default CoreScript implementation assumes that there are no installable items that can apply to multiple industry types - so if you sell a stack of two-or-more such items, it will install exactly one of them.)
Logged
Wyvern is 100% correct about the math.

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #457 on: May 17, 2021, 11:19:54 AM »

Fighters deserve a separate interface altogether.
I mean a class implementing ShipAPI.
Especially regarding AI of fighters, I only want to override the behavior when carrier is set to engage but currently can’t; or maybe someone would want to override only the regroup behavior.

Or at very least add the setEngageAI() and setRegroupAI() to ShipAPI.
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #458 on: June 03, 2021, 10:03:02 AM »

For BaseHullmodAPI, I think it would be reasonable to have a method ConditionalRequired that returns a map of hullmod id and a condition interface that has a single method returning boolean.

The main purpose is addressing the assault package exploit where you build the package in then remove the militarized subsystem. With this method added it can hook an additional not-removable check for the required hullmod to mitigate the exploit.
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

Yunru

  • Admiral
  • *****
  • Posts: 1560
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #459 on: July 10, 2021, 01:26:29 AM »

I would very much like a way to add (and remove) AIHints for ships.

(For example, an installable Missile Autoforge would make great use of adding the ALWAYS_PANIC hint, so the AI actually makes use of its infinite missiles.)

Mira Lendin

  • Captain
  • ****
  • Posts: 315
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #460 on: August 14, 2021, 03:55:42 AM »

As if right now there is no way to get the Original Weapon id for any projectile on the map, you can only get the id for the weapon that was assigned to the projectile the moment it was created (example:"engine.spawnProjectile(...etc") if you try to get the id of the Damaging Projectile weapon it will return the id of it's assigned weapon and not it's original weapon as mentioned in the Excel file, this can cause some catastrophic crashes if you try to replicate a projectile that was created by a beam weapon via a script since the engine will try to spawn projectiles based on the responsible beam weapon instead.
(in short, plz give us the ability to obtain WeaponSpecId from ProjectileSpecAPI)
« Last Edit: August 14, 2021, 05:44:26 AM by Mira Lendin »
Logged
^^

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #461 on: August 22, 2021, 07:40:17 PM »

Can we get MissileAPI.setSprite()? MissileAPI lets us get the sprite, but not change it for an existing missile.

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #462 on: August 28, 2021, 05:42:31 AM »

Can I get 'no_autofit' tag but for .variant files or at least in the form of a boolean? Basically don't sanitize this variant if this variant gets picked for this hull, but sanitize every other variant that doesn't have the no_autofit.

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #463 on: August 31, 2021, 08:56:10 PM »

Can I get a request for TextPanelAPI.addSkillPanel(PersonAPI person, boolean admin) to list skills that aren't admins or combat-only skills? It's for a quest that grants a random skill for the player to keep as a reward.

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #464 on: September 09, 2021, 12:43:03 PM »

can we get removeSMod and addSMod, the same as add/removeMod and add/removePermaMod?

I'd like it for some faction-specific hullmod replacements, so they override autofitted smods properly (and it just kinda seems weird that it isnt a thing already) 
Pages: 1 ... 29 30 [31] 32 33 ... 42