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 ... 34 35 [36] 37 38 ... 42

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

Timid

  • Admiral
  • *****
  • Posts: 640
  • Personal Text
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #525 on: July 16, 2022, 08:16:57 PM »

I'd like this private static to be public please, so modded Luddic factions can add their majority presence here.  :-[
Code
public class LuddicMajority extends BaseMarketConditionPlugin {

private static String [] luddicFactions = new String [] {
"knights_of_ludd",
"luddic_church",
"luddic_path",
};
public void apply(String id) {
if (Arrays.asList(luddicFactions).contains(market.getFactionId())) {
market.getStability().modifyFlat(id, ConditionData.STABILITY_LUDDIC_MAJORITY_BONUS, "Luddic majority");
} else {
market.getStability().modifyFlat(id, ConditionData.STABILITY_LUDDIC_MAJORITY_PENALTY, "Luddic majority");
}
}

public void unapply(String id) {
market.getStability().unmodify(id);
}

}

THEASD

  • Ensign
  • *
  • Posts: 42
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #526 on: July 27, 2022, 11:57:27 PM »

please add List<SegmentAPI> getOriginalSegments() for BoundsAPI
Logged
Also known as AnyIDElse.

THEASD

  • Ensign
  • *
  • Posts: 42
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #527 on: August 04, 2022, 09:28:33 PM »

AsteroidAPI for asteroid that extends CombatEntityAPI, and at least a getSpriteAPI() for it? it would be better if with setJitter() etc.
Logged
Also known as AnyIDElse.

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #528 on: August 27, 2022, 05:31:39 PM »

Could you change the way reapplyCondition() works, to rather than calling unapply() then apply(), it just calls a new method, reapply(), which /itself/ calls unapply() then apply()? I'm trying to make a planetary condition that adds a bunch of satellites in an orbit around a planet, but in order for it to support the removal of the satellites when the condition is removed without resetting the satellites and orbits every time the condition is reapplied (which is a LOT), I need to do an everyframescript to keep track of it. At least I think.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3010
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #529 on: August 27, 2022, 06:24:24 PM »

Use a single every frame script that tracks all the markets with the condition and all the satellites for them. When a market gains the condition, it adds the satellites around that market. When a market no longer has the condition, it cleans up the satellites. The condition itself doesn't have to do anything.
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #530 on: August 27, 2022, 06:48:15 PM »

Use a single every frame script that tracks all the markets with the condition and all the satellites for them. When a market gains the condition, it adds the satellites around that market. When a market no longer has the condition, it cleans up the satellites. The condition itself doesn't have to do anything.

Actually not a bad idea to have a /global/ script that does this rather than an instance for each planet, and I might end up doing that, but that's besides the point,

I wouldn't need to do this if I had a reapply() method I could override so it didn't keep calling unapply() and apply().
Logged

Liral

  • Admiral
  • *****
  • Posts: 717
  • Realistic Combat Mod Author
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #531 on: September 26, 2022, 06:19:48 PM »

1. Replace Indirect Chains of Methods with Instance Methods

Some API object instances lack instance methods to answer questions about their direct relationships to other API object instances, which are returned only by indirect chains of methods that involve repeating the name of the object instance.  I propose that such instance methods as would answer these questions be added to the corresponding API object instances and further, for clarity, the indirect chains be deprecated and later removed.

For example, a WeaponAPI cannot tell you the WeaponGroupAPI to which it belongs,

Code: Instance Method
weapon.getWeaponGroup()

but must instead ask its ship,

Code: Indirect Chain
weapon.getShip().getWeaponGroupFor(weapon)

Getting the AutofireAIPlugin of a WeaponAPI entails an even more indirect and repetitive chain.

Code: Instance Method
weapon.getAutofireAIPlugin()

Code: Indirect Chain
weapon.getShip().getWeaponGroupFor(weapon).getAutofireAIPlugin(weapon)


2. Remove the String source argument from the instance methods of MutableStat and add it to the fields and constructor of that class.
« Last Edit: September 27, 2022, 05:00:17 AM by Liral »
Logged

THEASD

  • Ensign
  • *
  • Posts: 42
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #532 on: September 27, 2022, 02:53:18 AM »

please add:
boolean isHyperspaceMode();
void setHyperspaceMode(boolean hyperspaceMode);
for LocationAPI

it would be better if the "BackgroundAndStars" can be modified - such as setBackgroundAndStars() - to render background in different ways.
« Last Edit: September 27, 2022, 02:56:54 AM by THEASD »
Logged
Also known as AnyIDElse.

THEASD

  • Ensign
  • *
  • Posts: 42
  • *Confused Cat Noise*
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #533 on: September 28, 2022, 05:49:22 AM »

please add
float getFacing();
for ShipEngineAPI(com.fs.starfarer.api.combat.ShipEngineControllerAPI.ShipEngineAPI)
which represents the facing of a single engine's absolute facing.
Logged
Also known as AnyIDElse.

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #534 on: October 19, 2022, 01:57:43 PM »

I asked about this a while ago but I'm a lot better with my words now,

Please add some way for planetary conditions to tell if they're being unapplied or reapplied on apply() and unapply(). A simple apply() and unapply() boolean arg would do.
Logged

Lukas04

  • Captain
  • ****
  • Posts: 337
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #535 on: October 23, 2022, 06:17:15 AM »

I would like to request a "getScripts" method for SectorEntityToken that displays all scripts attached to the entity. 
Some subclasses inherit a method like this from another interface (CampaignFleetAPI gets it from FleetOrStubAPI for example) but its something missing if you work with Custom Entities and Planets.
Logged
My Mods

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #536 on: November 01, 2022, 10:17:09 AM »

Please give all terrainplugins some kind of isInActiveFlareArc() method. It's literally impossible to determine, reliably, if a fleet is in the flare or not. THis is important for *** like coronas and magnetic fields.
Logged

NikoTheGuyDude

  • Commander
  • ***
  • Posts: 229
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #537 on: November 02, 2022, 10:30:13 AM »

Please expose CombatNebulaAPI's internal class a little more in the API. Ideally, so that we could create nebulae dynamically during combat without the need for a battlecreationplugin or casting down to the internal class.

On that note, it'd also be nice if Cloud (the nebula internal class) had an API, even if only for getting it's tiles/cells and location.

And yes this is pretty much just me following your advice to make an API request rather than use internals (lmao).
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #538 on: November 26, 2022, 04:24:31 AM »

Hi Alex, can the shield and engine render layers be exposed in CombatEngineLayers please?

The engine render layer would be especially nice since my Fast Engine Rendering mod has to re-render weapon sprites since there is no current way to render below weapons.

My second request is a toggle in ShieldAPI to enable/disable rendering. This will allow my HexShields mod to act as a performance enhancer similar to my Fast Engine Rendering mod, rather than setting the colour of the shield to rgba 0, which results in faint black artifacts even at 0 alpha.

If that's possible that would be awesome. Hope you are well, cheers.
« Last Edit: November 26, 2022, 04:26:07 AM by tomatopaste »
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #539 on: November 26, 2022, 04:28:10 AM »

please add
float getFacing();
for ShipEngineAPI(com.fs.starfarer.api.combat.ShipEngineControllerAPI.ShipEngineAPI)
which represents the facing of a single engine's absolute facing.

                float absoluteAngle = ship.getEngineController().getShipEngines().get(0).getEngineSlot().getAngle() + ship.getFacing();
                if (absoluteAngle >= 360f) absoluteAngle -= 360f;
Logged
Pages: 1 ... 34 35 [36] 37 38 ... 42