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 ... 22 23 [24] 25 26 ... 42

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

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #345 on: April 11, 2018, 11:29:34 AM »

MissileAPI hasMIRVed;  boolean; returns whether a MissileAPI has converted itself when reaching the detection distance.

Vanilla MIRVs have given me huge trouble on multiple occasions, because there appears to be nothing at all that can be used in mod code to detect when this has happened.  The MIRVs aren't being destroyed, aren't giving false on isArmed() after conversion, etc., etc., apparently.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #346 on: August 26, 2018, 12:42:59 AM »

SubmarketAPI:

float getPrice(String commodityId, TransferAction action, float basePrice)
float getPrice(CargoStackAPI stack, TransferAction action, float basePrice)
float getPrice(FleetMemberAPI member, TransferAction action, float basePrice)

Base price is what the commodity or ship would normally cost without tariffs. The method looks at the base price and does whatever calculations it needs (or ignores it entirely, like a literal dollar store or such) and returns the desired final pre-tariff price.

The idea is to allow a submarket to set arbitrary prices for specific things (unlike tariffs, which affect everything). This desired for a feature in a particular mod.
Logged

Nicke535

  • Commander
  • ***
  • Posts: 240
  • Degenerate Core
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #347 on: August 28, 2018, 09:01:14 AM »

BaseHullMod.isApplicableToShip(ShipAPI ship, MarketAPI market)
BaseHullMod.getUnapplicableReason(ShipAPI ship, MarketAPI market)

So alternate versions of the existing functions, this is for getting which MarketAPI a hullmod is being mounted at, if any (inspired by this twitter post, since it confirms that certain hullmods needing a drydock is going to be a vanilla feature). Alternatively, these functions could give the SectorEntityToken where the hullmod is installed, if that is easier (since that would allow getting the market via SectorEntityToken.getMarket, and would not need to return Null for in-flight hullmod mounting)


This would allow some special structures/markets which allows special hullmods to be mounted.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #348 on: August 28, 2018, 10:31:59 AM »

Yep, how it works already, with the addition of CoreUITradeMode as a parameter :)


Side note: I'm planning to look through this thread in the near future, but if there's something of particular import, I'd appreciate someone letting me know so I can be sure to take a close look at it.
Logged

Nicke535

  • Commander
  • ***
  • Posts: 240
  • Degenerate Core
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #349 on: August 29, 2018, 03:54:30 AM »

Yep, how it works already, with the addition of CoreUITradeMode as a parameter :)
Nice, good to hear.

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #350 on: September 05, 2018, 03:44:54 AM »

Could we have something along the lines of
engine.getWidth()

I'm making custom vernier engines and it would be nice to have a single script that automatically scale the deco weapon to the size of the hidden engine underneath (so that they can still be flamed out and hit by EMP/salamanders).
Logged
 

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: API request thread (please read OP before posting!)
« Reply #351 on: November 27, 2018, 10:34:39 PM »

SettingsAPI:
  • List<MarketConditionSpecAPI> getAllMarketConditionSpecs()

Global.getSettings().getAllSpecs(MarketConditionSpecAPI.class) returns an empty Collection. It appears that the only way to retrieve the list of condition IDs right now is to load and parse market_conditions.csv ourselves.
« Last Edit: November 27, 2018, 10:40:35 PM by LazyWizard »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #352 on: November 28, 2018, 04:39:26 AM »

rulescmd.MarketCMD:
  • Make all methods public/protected (currently the bombardment ones are private)
  • Make TempData's members public (currently they're protected; Java won't let child classes of MarketCMD access them)

EDIT: already done for 0.9.1
« Last Edit: January 31, 2019, 01:55:14 AM by Histidine »
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: API request thread (please read OP before posting!)
« Reply #353 on: December 02, 2018, 10:20:35 PM »

SettingsAPI:
  • boolean fileExistsInCommon(String filename)
  • deleteTextFileFromCommon(String filename)
« Last Edit: December 02, 2018, 10:35:34 PM by LazyWizard »
Logged

Obsidian Actual

  • Commander
  • ***
  • Posts: 102
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #354 on: December 07, 2018, 10:22:27 PM »

WeaponAPI:

void powerOff()

  • Much like disable(), prevents a weapon from firing (either via AutoFire or LMB), difference being that the weapon's health is unaffected, no malfunction smoke/spark VFXs are rendered, and no hovering text yelling "Disabled!" either.
  • Should work regardless of weapon type (beam, projectile, uses ammo, etc.)

void powerOn()

  • Reverses the effects of powerOff() if it had previously been applied.
Logged

Obsidian Actual

  • Commander
  • ***
  • Posts: 102
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #355 on: December 08, 2018, 02:18:36 PM »

Actually, seeing as there are already a few void setXXXX() methods in WeaponAPI, would something along the lines of void setFluxCostToFire() be possible?

Would give us more individual control over weapons than the "change this for all energy/ballistic/missile weapons" methods from MutableShipStatsAPI.
Logged

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Re: API request thread (please read OP before posting!)
« Reply #356 on: December 13, 2018, 07:05:37 AM »

Alex: can you move AI Core and Survey Data items from commodities to special items? for...stuff. :D
Logged

Gwyvern

  • Captain
  • ****
  • Posts: 318
  • I build ships.
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #357 on: December 16, 2018, 04:06:20 AM »

Let me preface this with: This is not an API request exactly but: ALEX SPECIFICALLY REQUESTED THAT I POST THIS HERE for his own benefit.

Two requests for features to be added to weapons.CSV

1: A tag that prevents weapons from appearing in loot drops like research stations, weapons caches and tech mining. Currently such lootboxes draw from ALL available weapons, and the only way to stop a weapon from appearing in them is to give a weapon a SYSTEM tag, which prevents it from being modular mounted altogether.

2: A hint for weapons that tells the AI to ignore a weapon's ammo completely. Weapons that try to use fast-reload limited-ammo setups are hampered by the fact that even with a DO_NOT_CONSERVE hint, the AI is still somewhat stingy with the weapon's ammo, cutting the weapon's effective DPS. While there are currently other ways to set a weapon up to achieve a similar result, there is no means to achieve the exact result specified here.
« Last Edit: January 31, 2019, 03:26:50 PM by Gwyvern »
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #358 on: December 20, 2018, 01:05:55 AM »

TooltipMakerAPI doesn't support the same highlight-text methods (specifically highlightInLastPara() to hightlight different strings in one para in different colors) as TextPanelAPI, and it tripped me up today. Would be cool to get that in, and maybe the other related ones too.
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #359 on: December 20, 2018, 03:24:14 AM »

TooltipMakerAPI doesn't support the same highlight-text methods (specifically highlightInLastPara() to hightlight different strings in one para in different colors) as TextPanelAPI, and it tripped me up today. Would be cool to get that in, and maybe the other related ones too.
TooltipMakerAPI.addPara returns a LabelAPI, you can add the highlights to that.

(yeah this took me a while to notice too)
Logged
Pages: 1 ... 22 23 [24] 25 26 ... 42