Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.98a is out! (03/27/25)

Pages: 1 ... 14 15 [16] 17 18 ... 45

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

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1374
    • View Profile
    • GitHub Profile
Re: API request thread (please read OP before posting!)
« Reply #225 on: August 10, 2014, 10:04:49 PM »

CombatEngineAPI:
  • boolean isMission()
  • String getMissionId()

FighterWingAPI:
  • String getWingId()
« Last Edit: August 10, 2014, 10:22:52 PM by LazyWizard »
Logged
Active mods: LazyLib | Combat Radar | Console Commands | Version Checker  ||  Old mods: Autosave | Omnifactory | Simulator Overhaul
Feel free to use any code I've written or PM me for help with your own. Anyone is free to translate my work.

Sundog

  • Admiral
  • *****
  • Posts: 1815
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #226 on: August 25, 2014, 12:10:29 AM »

DerivedWeaponStatsAPI:
  • float getBurstEmp()
  • float getEmpOver30Sec()
  • float getSustainedEmpPerSecond()

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1374
    • View Profile
    • GitHub Profile
Re: API request thread (please read OP before posting!)
« Reply #227 on: August 30, 2014, 03:33:35 PM »

SettingsAPI:
  • List<String> getLoadedModIds()
  • JSONObject loadJSON(String filename, String modId)
  • JSONArray loadCSV(String filename, String modId)
  • String loadText(String filename, String modId)

Sometimes you really want the exact .json data from a mod's folder.

That this would allow Version Checker to use mod_info.json is purely coincidental, I assure you. ;)
Logged
Active mods: LazyLib | Combat Radar | Console Commands | Version Checker  ||  Old mods: Autosave | Omnifactory | Simulator Overhaul
Feel free to use any code I've written or PM me for help with your own. Anyone is free to translate my work.

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #228 on: September 04, 2014, 12:16:07 PM »

MissileAPI
float getFlightTime()
float getMaxFLightTime()
float maxSpeed()
float getSpeed()
float getElapsed()
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1374
    • View Profile
    • GitHub Profile
Re: API request thread (please read OP before posting!)
« Reply #229 on: September 04, 2014, 02:49:48 PM »

MissileAPI
[...]
float getSpeed()
float getElapsed()

You should be able to get missile speed with getVelocity().length().

What do you mean by getElapsed()?
Logged
Active mods: LazyLib | Combat Radar | Console Commands | Version Checker  ||  Old mods: Autosave | Omnifactory | Simulator Overhaul
Feel free to use any code I've written or PM me for help with your own. Anyone is free to translate my work.

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #230 on: September 04, 2014, 06:52:54 PM »

Max flight time would be maximum time the object can exist, including time the missile is flying without power before fade out. Flight time would be the time the engine is active and is able to avoid friendlies. Ie. before it fizzles.
Elapsed would be the current time it has spent flying.

Come to think of of it a setter for the elapsed time may also be useful.
« Last Edit: September 05, 2014, 04:41:14 AM by Debido »
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #231 on: September 07, 2014, 06:23:47 AM »

WeaponAPI
setHealth(float)

or some means of damaging the weapon directly weapon itself.

Basically need the ability to directly damage a weapon and not have to damage the ship at the same time. Or maybe a addDamage or notifyDamage so as to let the game engine determine if the weapon is damaged enough to go offline and for the damage glow on the weapon to take effect.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1374
    • View Profile
    • GitHub Profile
Re: API request thread (please read OP before posting!)
« Reply #232 on: September 26, 2014, 12:17:26 AM »

ShipSystemAPI:
  • int getMaxAmmo()
  • setAmmo(int ammo)

TextPanelAPI:
  • clear()
Logged
Active mods: LazyLib | Combat Radar | Console Commands | Version Checker  ||  Old mods: Autosave | Omnifactory | Simulator Overhaul
Feel free to use any code I've written or PM me for help with your own. Anyone is free to translate my work.

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #233 on: September 26, 2014, 05:28:17 AM »

Seeing as Alex will soon be digging into the API requests, here are some more. Most of these are requested from the Starsector Skype Channel that has almost every major mod author and contributor.

+Collision API (per previous discussion)
(unsure of existing inputs/outputs)

+DamagingProjectileAPI
float elapsed()
float getDamageMult()
void setDamageMult(float)
void setHitPoints(float)
float getMoveSpeed()
void setDamageAmount(float)

+MissileAPI
void setHitPoints(float)

+ShipEngineControllerAPI.ShipEngineAPI
float getHealth()
void setHealth(float)
setStyleID(string)
setEngineColor(Color)
setContrailParticleSizeMult(float)
setContrailParticleDuration(float)
setContrailParticleFinalSizeMult(float)
setContrailMaxSpeedMult(float)
setContrailAngularVelocityMult(float)
setContrailColor(Color)
setType(GLOW/SMOKE)
void setEngineFlameSprite(SpriteAPI sprite)
void setEngineGlowSprite(SpriteAPI sprite)
void setEngineGlowSecondarySprite(SpriteAPI sprite)
void setContrailParticleSprite(SpriteAPI sprite)

string getStyleID()
Color getEngineColor()
float getContrailParticleSizeMult()
float getContrailParticleDuration()
float getContrailParticleFinalSizeMult()
float getContrailMaxSpeedMult()
float getContrailAngularVelocityMult()
float getContrailColor()
TYPE getType()

+ShipSystemAPI
void setAmmo(float)
void setCooldownRemaining(float)
float getCooldownMax()
void setCooldownMax(float)
float getFluxPerUse()
void setFluxPerUse(float)
float getFluxPerSecond()
void setFluxPerSecond(float)

+ShieldAPI
void setShieldRingColor(Color)
Color getShieldRingColor()
void setShieldInnerColor(Color)
Color getShieldInnerColor()
void setArc(float)
void setFacing(float)
void setRadius(float)
void setRadius(float, SpriteAPI sprite) where sprite is the desired shield texture.


+ShipAPI
void setVentCoreColor(Color)
Color getVentCoreColor()
void setVentFringeColor(Color)
Color getVentFringeColor()
void setVentTexture(SpriteAPI sprite)
void setVentTexture(String spriteID)
getHullStyleID()
setHullStyleID(string)
boolean getHoldFire()
void setHoldFire(boolean)
boolean isPhased()
void addJitterCopy(Vector2f location, float duration)
float timeSinceLaunch() (for fighters?)

+CombatEntityAPI
void setCollisionRadius(float)

+WeaponAPI
Color getGlowColor()
void setGlowColor(Color)
MuzzleFlashAPI getMuzzleFlash
float getDamage()
void setDamage(float)
WeaponGlowJitterAPI getWeaponJitter()

+MuzzleFlashAPI
float getLength()
float getSpread()
float getParticleSizeMin()
float getParticleSizeRange()
float getParticleDuration()
float getParticleCount()
Color getParticleColor()

void getLength(float)
void getSpread(float)
void getParticleSizeMin(float)
void getParticleSizeRange(float)
void getParticleDuration(float)
void getParticleCount(float)
void getParticleColor(Color)

+WeaponGlowJitterAPI
void setDuration(float)
float getDuration()
float setJitterX(float)
float getJitterX()
float setJitterY(float)
float getJitterY()

+BattleObjectiveAPI
SpriteAPI getSprite()
void setSprite(SpriteAPI sprite)

+BeamAPI
void setHitGlow(SpriteAPI sprite)
SpriteAPI getHitGlow()
float getHitGlowBrightness
float getWidth()
void setWidth(float)
float getPixelsPerTexel()
void setPixelsPerTexel(float)
Color getCoreColor()
void setCoreColor(Color)
Color getFringeColor()
void setFringeColor(Color)
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #234 on: September 26, 2014, 08:32:41 AM »

We're also in need of a way to get the DamagingProjectileAPI objects before the core sends the damage amount to the
Code
public O0OO.o notifyDealtDamage(Vector2f paramVector2f, G paramG, com.fs.starfarer.combat.o0OO.H paramH)

This allows to perform changes in these projectiles before any calculation is done. You can only imagine how much magic this would allow us in creating defensive and offensive systems without resorting to very heavy iterations on all projectiles on the game and other highly volatile coding to get said systems done.
« Last Edit: September 26, 2014, 08:38:27 AM by silentstormpt »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25822
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #235 on: October 01, 2014, 08:45:16 AM »

@Debido:

(I meant to respond here a while back, but I forgot.)

While I appreciate you taking the time to put this together, it kind of looks like a method dump from a bunch of interfaces. Aside from the fact that this probably involved decompiling core code (but let's leave that aside for now), it's... well, it doesn't exactly line up with the idea here. I mean, I already know what methods are in the core classes, right? Telling me again isn't exactly providing new information :)

From my perspective, what's really helpful about this thread is that when I see something here, I know that someone specifically wants it, and gave some thought to using it in a real scenario (vs "it might come in handy at some point, so why not?"). That, in turn, makes it worth it for me to look at more closely and figure out whether it belongs in the API - it saves me some of the work in deciding what's important and what's not, and at least some of the work of deciding whether something really belongs in the API, or doesn't. A shotgun approach takes these benefits away. It's an "if everything is important, then nothing is important" sort of thing. I don't know if I'm being very clear here, hopefully it makes some sort of sense.
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #236 on: October 01, 2014, 09:52:57 AM »

While it was directed to Debido, we're (most of the mod community) been on the same Skype channel doing/creating mods/scripts and all those suggestions are a compilation of what we felt needed and its just not possible without using black magic (or long endless scripts to get something a single return method could solve it) and looks simple enough to be un-blocked on the API. Blame the long time we had before this patch cames in  ;)
« Last Edit: October 01, 2014, 02:46:29 PM by silentstormpt »
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #237 on: October 01, 2014, 11:38:34 AM »

Thank you for replying Alex. Though I can see how one might initially see that it is grabbing everything in sight, but there are lots of interfaces in the campaign and the engine which are not there as they are not requested at this time.

As silentstormpt mentioned, this was done in collaboration with quite a number of community members, many of which have been contributing to mods and wanting these features since before I delved into modding.

You're more than welcome to join the Skype channel Alex! We would love to have you you there to discuss these requests and chat with you about the game when you have some time from your busy schedule!

+Collision API (per previous discussion)
CollisionAPI would be exceedingly useful in the case of a multi-ship, or cases where you wanted to build a ship with 'armour' parts that overlap the host ship. We discussed this in PM, I'm just documenting this for the list.

+DamagingProjectileAPI
float elapsed(): Find the most recently fired projectile from a WeaponAPI, or the oldest one fired, or possibly figure out in what sequence each were fired. Knowing the most recently fired projectile you can perform replacements based upon rules such as 1 in 4 are fragmentation rounds.
float getDamageMult(): Find the current damage multiplier

void setDamageMult(float): You could do a per-projectile damage increase or decrease. You could have a weapon that increases or decreases in damage with more bullets fired in a burst, you could nurf damage or increase damage of a projectile that is scripted to do additional onHit damage. Or you could have a value in the weapoon_data.csv that is used by the autresolve, then use this to set in combat damage with scripting.

void setHitPoints(float): Dynamically assign hitpoints to a projectile or manually apply without the need for an applyDamage. Manually perform collision damage etc.

float getMoveSpeed(): Get the speed of the projectile without referring to the CSV values. This should really have a setter, not sure if it's per instance of the projectile, if it is you can have a projectile with dynamic speed. Say a projectile that gets faster the further away it is or slower the further away it is.

void setDamageAmount(float): Similar purpose to get/setDamageMult

+MissileAPI
void setHitPoints(float): Manual collisions and/or damage modifiers, scripted AOE damage to missiles, missiles with regenerative health.

+ShipEngineControllerAPI.ShipEngineAPI

A highly requested section for customisation and dynamic engines. Want an engine that changes colour when engaging 'super' mode? Done! Want an engine that gets 'hotter' on the kelvin scale? Done. By having on the fly customisable engines you can create unique visual styles under many scripted situations.

In particular being able to set our own contrail particles, engine flames and glow sprites would make for some unique faction engines never seen before, and using scripts to make it dynamic would allow certain looks under various situations that the mod author decides upon.


+ShipSystemAPI

Another highly requested section as there are missing setters for this API, but allowing more access to the attributes and setters would be very helpful. Being able to recharge the ammunition in a scripted fashion is useful. You could have the Cool down related to the ship flux, or have the flux per use increase with each use of the system, or change the flux per second based upon some other derived formula that is related to a special shield that absorbs damage. Lots of possibilities.

+ShieldAPI
Changing the shield colour on the fly would be great, but the main and most important request here is for custom shield textures. People really want custom shield textures to differentiate their faction, or to show a system is active etc.

The other aspects such as setting the arc, I think we can already do as I already have a mod that does that, but setting the facing angle or the radius could be really helpful. Having a dynamically expanding shield that can cover a greater area could be a great area denial system and setting the facing angle would let you have a rapidly rotating omni shield.


+ShipAPI
Dynamic venting colour would be requested a bit below the ship engines, dynamic vent colouring that could be related to the vent rate or the amout of flux being vented per second, or maybe even the colour changes as it 'cools down' dynamically.

The vent texture change is fairly high on the priority list, I don't personally see the uniqueness in having a vent texture for your faction, but people really love to do these things.

Anyway there is also requests for changing the HullStyle (all the styles for the ship) on the fly. Ship systems that change the shields and engines styles on the fly would be possible. Customisation of colour and styles in the use of and unique systems are a popular request.

Smaller things like finding if the ship is holding fire, or forcing a ship to hold fire can be used in some AI coding situation, as is the 'isPhased()' method. You can find if a ship is phased already, but the code is longer than it needs to be. Shouldn't it be simpler?

Jitter copies of a ship are something a few people have been wanting to get a hold of for some ship systems, and perform special effects beyond what is provided by the PhaseTeleporter system. You could create some truly unique systems, or create a ship 'blur' effect as it is moving very quickly or through phase. Or possibly create a unique scripted system that makes your one ship appear as 3 or 4 copies, confusing the player (the AI is another issue we'd need to take care of). I think the interface would need more controls, like those listed in the Phase Teleporter system.

float timeSinceLaunch() could be used to find the most recently launched fighter and apply scripted buffs or modifiers based upon

+CombatEntityAPI
void setCollisionRadius(float) - for certain aspects of a mult-part ship collision, and dealing with AI.

+WeaponAPI
Lots of customisation in the WeaponAPI. being able to set and get the damage on the weapon allows for certain scripted circumstances, and getting around the issue of auto-resolve damage and combat onHitEffect damage. Dynamically changing or changing aspects of the Weapon Glow has also been requested by the community.


+MuzzleFlashAPI
A sub-interface of a weapon for dynamically changing aspects of a Weapon as it fires. You could have a system like the Ammo Feeder that changes the look of Ballistic Weapons when firing, or changing the colour of the particles with greater number of projectiles fired as if it is getting hotter, or some kind of charging effect.


+WeaponGlowJitterAPI
Another sub-interface for a energy weapon, allows the mod author to control the vibration/jitter as the vanilla jitter is sometimes too much or too little

Control on the glow could allow to make custom muzzle flashes (that last only a couple of frames) or weapons that heat up without jittering. Right now it necessitate lengthy animations while it could be done with one single layer.

+BattleObjectiveAPI
Want a custom Battle Objective sprite? Maybe make it a sprite of a Starbase or something altogether different, many possibilities.


+BeamAPI
At the moment Beams are statically set in the proj file, and that is it. Being able to dynamically change the colour, width and other attributes can make for some scripted beams that take it to the next level of customisation. A beam that gets 'hotter' or gets wider as it charges up? Would now be possible. Community members also desire the ability to have a custom hit glow sprite to reflect more about the special attributes or lore of the weapon.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25822
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #238 on: October 01, 2014, 11:45:02 AM »

Thank you - I really appreciate the breakdown, it'll help prioritize things. (It's a reality that I won't be able to get to *everything*...)
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #239 on: October 01, 2014, 11:57:40 AM »

Thank you Alex!
Logged
Pages: 1 ... 14 15 [16] 17 18 ... 45