Starsector > Suggestions

API request thread (please read OP before posting!)

(1/125) > >>

LazyWizard:
Important notice: This is not a general suggestion thread. It is meant for requesting API hooks into existing features - in other words, access to things the game already keeps track of. If you want to suggest an entirely new feature, you should start a separate thread in the Suggestions sub-forum so your idea can be properly discussed without cluttering this thread.

You should also avoid overly broad requests. For example, posts like "give us access to NPC character creation" aren't very helpful. "Could we have a method createPerson() in FactoryAPI that returns a PersonAPI?", on the other hand, describes exactly what you're looking for.

There's a bit of gray area regarding the above, but as a general rule-of-thumb: if you can't reduce it down to a self-descriptive method signature, it's probably out of scope for this thread.

xenoargh:
It'd also be nice to have:

WeaponAPI
string getWeaponName() - not the display name, but the internal name, since display names can be the same but internal names must be unique.

FleetSide
Does not have a NEUTRAL and HOSTILE designation;  it'd be nice to have, so that we can spawn NEUTRAL objects (not attacked by anybody, doesn't attack anybody) and HOSTILE objects (attacks and is attacked by everybody).  This would provide for a .junk alternative and allow for gameplay stuff.

SectorAPI
boolean isBattleOccurring(true)
List currentBattles(for each entry, fleet1.id, fleet2.id)
callback BattleEnded(fleet1.id,fleet2.id,faction1.id,faction2.id,winnerfaction.id)

Basically, stuff for keeping a better eye on what's happening throughout the System, which right now is a bit of a pain.

Lastly, it'd be nice to have a script that runs when entering a Station; then we could implement profitable trading relatively easily.

Alex:

--- Quote from: LazyWizard on November 28, 2012, 08:52:12 AM ---MutableShipStatsAPI

* ShipAPI getOwner()
--- End quote ---

Curious - where are you getting a MutableShipStatsAPI that you don't also have access to the ShipAPI? There may be a good reason for that.


--- Quote from: LazyWizard on November 28, 2012, 08:52:12 AM ---ShipAPI

* ShipAPI getTarget() (or a way to get the currently selected target outside of ShipSystemAIScript's advance())ShipVariantAPI

* String getVariantName()WeaponAPI

* float getBaseDamage()
* boolean isDisabled()
* float getDisabledDuration()
--- End quote ---

Added, except for getBaseDamage(), which is actually quite a pain. Hmm. Looks like the variant API could use a lot more attention, too. I'll note both of these down for later. Thanks for making the suggestions, I really appreciate it.

Alex:

--- Quote from: xenoargh on November 28, 2012, 09:14:39 AM ---It'd also be nice to have:

WeaponAPI
string getWeaponName() - not the display name, but the internal name, since display names can be the same but internal names must be unique.

--- End quote ---

There's WeaponAPI.getId() which does exactly that.


--- Quote from: xenoargh on November 28, 2012, 09:14:39 AM ---FleetSide
Does not have a NEUTRAL and HOSTILE designation;  it'd be nice to have, so that we can spawn NEUTRAL objects (not attacked by anybody, doesn't attack anybody) and HOSTILE objects (attacks and is attacked by everybody).  This would provide for a .junk alternative and allow for gameplay stuff.

SectorAPI
isBattleOccurring(true,fleet1.id,fleet2.id)
BattleEnded(fleet1.id,fleet2.id,faction1.id,faction2.id,winnerfaction.id)

Both would allow for a lot more context-sensitive battlefield control.

Lastly, it'd be nice to have a script that runs when entering a Station; then we could implement profitable trading relatively easily.

--- End quote ---

Ah yes, asking for features under the guise of API additions. I see what you did there :) Btw, where you see the "owner" id as an int (rather than a FleetSide), 0 is player, 1 is enemy, and 100 is neutral. Though setting a ship to neutral would make it fire on everyone, I think.

Added CombatEntityAPI.setOwner(int owner) - that should take care of spawning neutral stuff, I think.

LazyWizard:

--- Quote from: Alex on November 28, 2012, 09:16:15 AM ---
--- Quote from: LazyWizard on November 28, 2012, 08:52:12 AM ---MutableShipStatsAPI

* ShipAPI getOwner()
--- End quote ---

Curious - where are you getting a MutableShipStatsAPI that you don't also have access to the ShipAPI? There may be a good reason for that.

--- End quote ---

ShipSystemStatsScript.


--- Quote from: Alex on November 28, 2012, 09:16:15 AM ---Added, except for getBaseDamage(), which is actually quite a pain. Hmm. Looks like the variant API could use a lot more attention, too. I'll note both of these down for later. Thanks for making the suggestions, I really appreciate it.

--- End quote ---

Thank you for adding those in. Hmm, is the problem with getBaseDamage() due to the MutableStats? If so, would a getDamage() method suffer the same difficulties? Sorry to bother you about this, but I'm trying to write helper classes that calculate the threat generated by nearby enemies, and damage is fairly important to the equation. ;)

And thank you for putting in so much effort on the modding side of things. I've been modding for 12 years, and Starfarer is (by far!) the most enjoyable of all the games I've ever modded. :)

Oh, and if you're noting things that need attention, ShipAPI's getPhaseCloak() still returns a placeholder Object. ;)

Navigation

[0] Message Index

[#] Next page

Go to full version