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 ... 11 12 [13] 14 15 ... 46

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

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1374
    • View Profile
    • GitHub Profile
Re: API request
« Reply #180 on: April 17, 2014, 10:17:16 PM »

EveryFrameCombatPlugin:
  • void end()

A lot of current combat plugins have static variables and clear them in init(). Adding this method would allow those scripts to clean up after themselves and prevent those objects from being held in memory between battles. It'd also allow us to have custom battle end events that execute before the back from engagement results are calculated.
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
« Reply #181 on: April 23, 2014, 01:56:52 AM »

EveryFrameCombatPlugin:
  • void end()

A lot of current combat plugins have static variables and clear them in init(). Adding this method would allow those scripts to clean up after themselves and prevent those objects from being held in memory between battles. It'd also allow us to have custom battle end events that execute before the back from engagement results are calculated.

That is fairly essential to some really interesting things I we need to do with modding.

Here are some other things from the ShipAPI as well I'd like to see:
getName() - String name variable
getSinceLastDamageTaken()
getSinceLastShieldDamageTaken()
getAimAccuracy()
getTimeDeployed()
getFullTimeDeployed
getCrMalfunctionThreashold()
setCrMalfucntionTreshold()
getCrCriticalMalfunctionDamage()
setCrCriticalMalfunctionDamage()
getBaseCriticalMalfunctionDamage()
setBaseCriticalMalfunctionDamage()
getEngineFractionPermanentlyDisabled()
setEngineFractionPermanentlyDisabled()
getSinceLaunch()
getEngineLocations() ArrayList
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1827
    • View Profile
Re: API request
« Reply #182 on: April 23, 2014, 01:14:37 PM »

getName() - String name variable
Would this do the trick? ship.getHullSpec().getHullName()

Perhaps it would be a good idea to wrap* that though, if only to make it easier to find.
*Is 'wrap' the right word? I meant doing this:

public class ShipAPI {
    String getName() {
        return this.getHullSpec().getHullName();
    }
}

getEngineFractionPermanentlyDisabled()
Already exists.

getEngineLocations() ArrayList
You can get this information by iterating over ship.getEngineController().getShipEngines() and calling ShipEngineAPI.getLocation().


Speaking of ship engines, we could do some pretty neat stuff if ShipEngineAPI was more flexible (e.g. setAngle, setLocation, setWidth, setLength, setColor)

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2902
    • View Profile
    • Sc2Mafia
Re: API request
« Reply #183 on: April 23, 2014, 01:51:34 PM »

getName() - String name variable
Would this do the trick? ship.getHullSpec().getHullName()

Perhaps it would be a good idea to wrap* that though, if only to make it easier to find.
*Is 'wrap' the right word? I meant doing this:

public class ShipAPI {
    String getName() {
        return this.getHullSpec().getHullName();
    }
}

That gets the name of the hull.  Like Onslaught or Apogee.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1827
    • View Profile
Re: API request
« Reply #184 on: April 23, 2014, 02:21:34 PM »

Oh, silly me. I thought that's what he was requesting.

The name of a specific ship could be retrieved like this:
Global.getCombatEngine().getFleetManager(ship.getOwner()).getDeployedFleetMember(ship).getMember().getShipName()

So, yeah. I'm thinking ship.getName() would be a tad more elegant.

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #185 on: April 23, 2014, 04:45:28 PM »

Also ShipAPI setName() to change the name of a ship in combat

At the moment the way I get the ship name is cross reference it's fleet Id with FleetMemberAPI then grab it's name from there, but I have to iterate that list to get it.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #186 on: April 28, 2014, 11:18:11 PM »

CombatEngineAPI

boolean isPlayerRetreating()
boolean isEnemyRetreating()
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #187 on: May 07, 2014, 05:51:39 PM »

This is a strange one, not really sure on the namespace for this one, but it is a very special request.

I'm looking at making a 'Ship Grinder', a mission that doesn't end, and the player is not involved, it would be nice if I could automate the camera so it randomly follows different ships.

Potentially I can see an API for the camera being useful for people who want to have in-combat mini-movies or little encounters with some pop-up text or audio or what not.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #188 on: May 09, 2014, 05:05:43 AM »

WeaponAPI.MutableStat or WeaponAPI.StatBonus.

Essentially allow certain attributes of a particular or weapon type to be altered

Also with Beam weapons a DO_NOT_FADE_IN hint makes it so that during the charge sequence, there is no 'beam, so that the laser only fires at full intensity during main firing sequence. This allows for effects/sounds to be created during the 'charge' time without any damage being done.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #189 on: May 11, 2014, 10:33:56 PM »

A SpawnShipOrWing method or any of the other derivitives that allows you to spawn in the normal 'location' at the bottom of the map. That is, I can ask for 10 Astrals to be deployed in a single frame and I needn't worry about the location, that is automatically handled by the normal deployment process.
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #190 on: May 13, 2014, 09:24:57 PM »

AnimationAPI MissileAPI.getAnimation() to allow use to make VLMS without a whole ton of hacky missile replacement crap.

Also set/getFuseDistance(), set/getMIRVDistance, set/getCollisionClass, set/getSize, set/getCollisionRadius, set/getExplosionColor,set/getEngineSpec, set/getMissileType.

Also boolean Global.isAlexAwesome() which always returns true.
Logged

Cycerin

  • Admiral
  • *****
  • Posts: 1665
  • beyond the infinite void
    • View Profile
Re: API request
« Reply #191 on: May 14, 2014, 08:12:34 AM »

Two small requests that aren't technically API-related, but:
- The ability to set a sound when a MIRV splits in the .proj file (I assume this is something you'll want for the core game anyway down the road)
- The ability to flag a ship as uncapturable without having to change the entire encounter dialog
Logged

Uomoz

  • Admiral
  • *****
  • Posts: 2663
  • 'womo'dz
    • View Profile
Re: API request
« Reply #192 on: May 14, 2014, 11:53:21 AM »

FactionAPI.getColour();

For even fancier dialogues :)
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: API request
« Reply #193 on: May 20, 2014, 03:11:02 AM »

We needs someway to get access to the Options menu, so we can add toggle-able options for mods like ShaderLib
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: API request
« Reply #194 on: May 24, 2014, 01:41:13 AM »

engine.spawnDamagingExplosion() - exactly like the spawnExplosion but does damage.
Logged
Pages: 1 ... 11 12 [13] 14 15 ... 46