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 ... 28 29 [30] 31 32 ... 42

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #435 on: January 05, 2021, 04:02:43 PM »

I'm not entirely sure which part of my post is a new feature. The game already has tri-pad menus that have scrollable tabs and side menus (intel and command screens). I'm mainly asking that we can call up the drawing of the tri-pad window, as well as whatever functionality is in the actual content window.

The checkboxes (settings/help tips), and text inputs (character creation text boxes, faction creation text boxes) are also in the game, we just can't make them without doing all the LWJGL work to emulate them. I'll admit, multi-line text boxes don't exist currently, from what I can remember.

I don't mean to argue, just think I didn't communicate it properly.

Ah - basically this thread is for things where "this method already probably exists in the core class and fulfilling the request is likely just a matter of adding it to the interface exposed in the API". Anything beyond that is outside the scope for this thread.

So for example something like making a core widget usable by mods requires more work/thought/design/etc than that. This is meant to be a simple gathering place for... basically, stuff that could be trivially exposed, and that someone needs. A collection of extremely low-hanging fruit, if you will.

(Edit: I should say, most of the stuff mentioned here ends up being a bit more involved than just adding a method. So I generally go through it and pick out the things that are still quick and easy to add in.)
« Last Edit: January 05, 2021, 04:13:44 PM by Alex »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #436 on: January 05, 2021, 04:50:09 PM »

There are several mods that add special hullmods that don't strictly meet the criteria of a proper hull modification. In my case it's Starship Legends, which adds a hullmod that represents the ship's reputation, but there's also Commissioned Crews (faction-trained crew), Automatic Orders (AI modification flags), and Extended Hullmods (sub-systems that boost other hullmods). I'm sure there are others. The special hullmods added by these mods are represented the same way as any other hullmod by the GUI, which seems pretty janky to me. It would be nice if such hullmods had a way of visually distinguishing themselves from actual hullmods. To that end, I would greatly appreciate the following additions to BaseHullMod:
  • getBorderColor
  • getNameColor
  • getDisplayOrder
Thanks for your consideration, Alex!

Did all these! Well, in some form.


any chance we'll ever get access to the visual part of spawnEmpArc ?
i mean, without all the targeting and damage dealing and so on, just renderEmpArc from point A to point B. because that's what it's generally used for in most cases outside of vanilla, except currently it also requires setting up a fake combat entity because emp arc can't just be cast at point.
i'd suspect both spawnEmpArc and spawnEmpArcPierceShields are already using something like that under the hood, and it is sad that it is not callable directly

There'll be a CombatEngineAPI.spawnEmpArcVisual method in the next release.


FactionAPI.getShipNamePrefix()
Conspicuously missing from the API.

Added.


I've just noticed game can render select boxes (e.g. Codex, Weapons, Small/Medium/Large and Energy/Ballistic/Missile) - could we have this exposed in TooltipMakerAPI? Example:

You mean functionally a checkbox, right? That's actually added for the next release! Via:
ButtonAPI.addAreaCheckbox(); ButtonAPI has isChecked()/setChecked()


Could we get a method in IntelUIAPI to refresh the list of intels (left side), ideally without redrawing the currently selected one?

Done.


I was trying to add some counter-intel (bounties countering something presented in an intel) and found it impossible. My idea was to offer another type of missions to the player, e.g.
  • Stop Smuggler - prevent the smuggler from reaching initial market, or making trip back
  • Stop Pirate Raid - fight and break the pirate raid before it reaches return (after successful raid) stage
  • Stop Trade Fleet - similar to Stop Smuggler, make sure the fleet never arrives at the destination
In all 3 cases, the bounty would be paid if player destroyed fleets associated with the initial intel. Could we please get a "CampaignFleetAPI getMainFleet()" and "List<CampaignFleetAPI> getFleets()" methods on intel objects that involve fleets (formalized via an interface)? This would allow to register own FleetEventListener (thus succeeding the bounty when initial one failed and vice versa) and check some other bits (to decide on bounty payout and to be able to generate sensible intel descriptions).
Thanks!

This isn't really possible - for example, for pirate raids, the fleets don't even exist much of the time, except as a "RouteData" (see: RouteManager) that resolves into an actual fleet only when the player is nearby.  Likewise for smugglers and trade fleets.

Hmm. Let me add TradeFleetDepartureIntel.getRouteData().

For RaidIntel, you can use getRouteSourceId() and cross-reference that with RouteManager to see the status of the fleets (or not-yet-fleets) involved - I think all the needed methods should be in place.


Naming constellations is difficult to figure out because NamePick is convoluted. Also, it would be nice if we had more control over the name and label. I'd like to see:

setNameOverride(String) // Set the constellation's name directly, bypassing the NamePick stuff and blocking addition of "constellation"/"nebula" in various places
setColorOverride(Color) // The color of the name label
setAngleOverride(float) // The angle of the name label

Added the name override method.


I looked in the API, and both the WeaponAPI and BeamAPI have this "getDamage()" method to the DamageAPI, while BeamAPI also has the "getWeapon()" method to get a WeaponAPI. Here, the Ion Beam goes straight from the BeamAPI to the damage instance, but the Tachyon Lance takes a detour through its WeaponAPI to achieve the same thing.

What is the significance of this? Is there any reason to use one format over the other? All I can think of is that one is a burst beam and one is a sustained beam, does that cause a difference in what is handled by the DamageAPI?

Ah, hmm - looking into it, they should both be using beam.getDamage(), this looks like a bug. It wouldn't have a major effect but I think a few things - such as the damage mutliplier based on the beam brightness, that sort of thing - would not get applied when getting damage from the WeaponAPI rather than the beam. Thank you!


I'd like to request a public method in BaseIndustry that allows for modification of the current build progress via
Code
protected float buildProgress

Done.


would be nice to
Code
weapon.getGlowSprite();
like we can do with main and barrel sprites. for consistency sake, if nothing else.

Done.


Not sure if this is technically api related but can the no sell tag be made to be useable on ships in the ship_data csv? Feels something that would be present with unboardable ships. Also allows for modders to be able to add ships that they don't want the player to get their hands on through the market.

Done.


I believe it's come up before but it would be pretty handy for WeaponAPI to have:

- setAmmoPerSecond()

Also potentially useful, though not specifically for anything I'd need:

- getReloadSize()
- setReloadSize()

Added AmmoTrackerAPI, retrieved via WeaponAPI.getAmmoTracker(), has ... a bunch of methods in it, including these.


com.fs.starfarer.api.combat.ShipSystemSpecAPI
  • JSONObject getSpecJson()

Done.
Logged

Arcvale

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #437 on: January 05, 2021, 06:03:00 PM »

I hate to make another request hot on the heels of a wave of excellent additions, but there's a number of extra levers that it would be nice to have for weapon-related applications of MutableShipStatsAPI.



 - getBeamRoFMult()

Continuous beams don't have a fire rate to affect, but burst beams do. Currently, when writing a ship system or hullmod that would modify weapon rate of fire, you need to decide whether to leave continuous beam damage unaffected, or attempt to compensate with getBeamWeaponDamageMult() and alter burst beam RoF and damage. Being able to alter beam RoF specifically would help a lot here.



 - getBeamAmmoBonus()

On the topic of beam-related edge cases, this would also be helpful to correct for burst-beam-related jank.



 - getBallisticMaxRecoilMult()
 - getBallisticRecoilPerShotMult()
 - getBallisticRecoilDecayMult()
 - getEnergyMaxRecoilMult()
 - getEnergyRecoilPerShotMult()
 - getEnergyRecoilDecayMult()
 - getMissileMaxRecoilMult()
 - getMissileRecoilPerShotMult()
 - getMissileRecoilDecayMult()

Weapon-type-specific recoil modifiers would be nice to use as a balancing factor alongside other modifiers. Something like lower-damage, lower-recoil ballistic projectiles, for example.



 - getBallisticProjectileSpeedMult()
 - getEnergyProjectileSpeedMult()
 - getMissileProjectileSpeedMult()

Same deal here - more tools to modify specifically one type of projectile velocity would be great.



Thank you, and my apologies if any of these are already set to be implemented and I've just missed them somehow  :)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #438 on: January 05, 2021, 06:53:41 PM »

Hi, and welcome to the forum!

Ah, these are more along the lines of "additions" rather than "exposing existing stuff via the API". I'll keep 'em in mind, but they're not the sort of thing I can just knock out super quick (and, importantly, not need to test much/at all) like the batch of stuff above.
Logged

Arcvale

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #439 on: January 05, 2021, 07:07:33 PM »

Hi, and welcome to the forum!

Ah, these are more along the lines of "additions" rather than "exposing existing stuff via the API". I'll keep 'em in mind, but they're not the sort of thing I can just knock out super quick (and, importantly, not need to test much/at all) like the batch of stuff above.

Ah, that's a shame, but thank you very much!
Logged

theDragn

  • Captain
  • ****
  • Posts: 305
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #440 on: January 28, 2021, 12:30:50 PM »

Two requests:

com.fs.starfarer.api.combat.MutableShipStatsAPI:
  • getBeamVelocityBonus()

com.fs.starfarer.api.combat.WeaponAPI
  • getBeamVelocity()

Being able to access and modify beam velocity is definitely an edge case, but it would be useful.
« Last Edit: January 28, 2021, 01:35:00 PM by theDragn »
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #441 on: February 08, 2021, 12:36:29 AM »

Small request, could we have something along the lines of:

public void onDevModeReload() added to BaseModPlugin ?

That way mods would be able to reload their settings files easily instead of each having their everyFrame plugins running at once to detect a key press, or reload everything on every battle start (or restarting the whole game).
Logged
 

RustyCabbage

  • Captain
  • ****
  • Posts: 347
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #442 on: February 12, 2021, 08:24:54 AM »

Is it possible to get a

public void setHidden(boolean hidden) method in Industry, the way LionsGuardHQ is hidden if Sindria is not owned by the Diktat?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #443 on: February 12, 2021, 08:27:48 AM »

Small request, could we have something along the lines of:

public void onDevModeReload() added to BaseModPlugin ?

Just to make sure - specifically when would you like this to be called?
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #444 on: February 12, 2021, 08:38:19 AM »

Right after using F8 to reload all the vanilla data files in dev mode. I can add a plugin that track button presses to MagicLib, but I figured the game does it already, so why not have it done the proper way.
« Last Edit: February 12, 2021, 08:41:50 AM by Tartiflette »
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #445 on: February 12, 2021, 09:17:59 AM »

Right after using F8 to reload all the vanilla data files in dev mode. I can add a plugin that track button presses to MagicLib, but I figured the game does it already, so why not have it done the proper way.

Thank you! For some reason I was thinking in terms of the campaign and it wasn't quite clicking.

Added:

/**
 * Called after F8 is pressed in combat while in devMode.
 * Note: the game becomes potentially unstable after an F8-dev mode reload. That is,
 * crashes may occur that would not have occured otherwise and are not indicative of bugs.
 */
void onDevModeF8Reload();



Is it possible to get a

public void setHidden(boolean hidden) method in Industry, the way LionsGuardHQ is hidden if Sindria is not owned by the Diktat?

Did that.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #446 on: February 12, 2021, 10:32:08 AM »

Thank you very much!
Logged
 

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #447 on: February 12, 2021, 04:50:24 PM »

No problem! (Bit off-topic, but I like your idea with the modSettings file, I hope it goes places.)
Logged

RustyCabbage

  • Captain
  • ****
  • Posts: 347
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #448 on: February 21, 2021, 05:57:30 PM »

Is it possible to get a

public void setHidden(boolean hidden) method in Industry, the way LionsGuardHQ is hidden if Sindria is not owned by the Diktat?

Did that.
Thanks a lot! Another request: I don't know how feasible this is on the back end, but would you be able to add

String getExtendedShipFilePath() to ShipHullSpecAPI and String getExtendedVariantFilePath() to ShipVariantAPI?
For example, using getShipFilePath() on a vanilla hullSpec provides the full ".../Fractal Softworks/Starsector/starsector-core/data/hulls/..." path, but the same method on a modded hullSpec only gives the "/data/hulls/..." portion.

Alternatively, some other method for determining what mod a given hullSpec/variant came from would work, but that's probably outside of the scope of this thread.

devurandom

  • Ensign
  • *
  • Posts: 30
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #449 on: March 01, 2021, 05:03:10 PM »

ShipHullSpecAPI.setNoCRLossSeconds(float)
BaseWeaponSpec.setOrdnancePointCost(float)

RuleAPI.getScript()
RuleScriptAPI.newInstance(String)

An API to control which markets contribute to the export market value would also be nice. e.g. Remove an isolationist faction from the global market or allow player colonies to contribute to market size.
Logged
Pages: 1 ... 28 29 [30] 31 32 ... 42