Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 4 5 [6] 7 8 ... 42

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

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
Re: API request
« Reply #75 on: February 20, 2013, 11:35:29 PM »

seems like we can use hullmods to enable and disable the PD flag on weapons, but not other AI hints. Can that support be added?

not the best with these codes so forgive me if it's already in and I just missed it
Logged
mmm.... tartiflette

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: API request
« Reply #76 on: February 26, 2013, 10:00:59 PM »

Could we have something like a HasLocation interface that defines the getLocation() method, and have those API types that have the method extend it? It would help cut out a lot of almost-identical code dealing with CombatEntityAPIs, SectorEntityTokens, and BattleObjectiveAPIs separately.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24169
    • View Profile
Re: API request
« Reply #77 on: February 27, 2013, 09:29:38 AM »

Made BattleObjectiveAPI extend CombatEntityAPI. Don't want to make it a common interface across campaign and combat entities, since even though the method signature is the same, it's still different conceptually.

If you really want to treat them the same, though, you could write a utility method that uses instanceof, no?


(Will take a detailed look at the other stuff at some point, btw.)
Logged

Apophis

  • Captain
  • ****
  • Posts: 466
    • View Profile
Re: API request
« Reply #78 on: March 19, 2013, 09:56:46 AM »

Add an API to refit ships from code
Logged

ValkyriaL

  • Admiral
  • *****
  • Posts: 2145
  • The Guru of Capital Ships.
    • View Profile
Re: API request
« Reply #79 on: March 21, 2013, 05:54:10 AM »

I was thinking something like the get.entity.by.name,  but for ship designations, so it would be get.ship.designation.by.name. this way you could make voice acting for things like "Battleship lost/destroyed" or perhaps other funny things i'm not to familiar with.
Logged

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: API request
« Reply #80 on: March 21, 2013, 02:47:11 PM »

I was thinking something like the get.entity.by.name,  but for ship designations, so it would be get.ship.designation.by.name. this way you could make voice acting for things like "Battleship lost/destroyed" or perhaps other funny things i'm not to familiar with.

That sounds like fun!
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Wyvern

  • Admiral
  • *****
  • Posts: 3804
    • View Profile
Re: API request
« Reply #81 on: March 26, 2013, 03:04:46 PM »

As discussed here, I'd like the ability to hook new UI into the ship refitting screen - perhaps having a hull mod that lets the user set some parameters when it's selected, or perhaps allowing a plugin to overwrite, for example, the weapon group selection screen.

This would also require API for a hullmod to store information per ship/variant it's installed on.

And, of course, in order to actually implement the mod I want this for, we'd also need hull mods to be able to mess around with autofire targeting priorities in much greater detail than just the current "make it function as PD" option we've got.

...Speaking of UI, is there going to be some straightforward way to replicate the look & feel of the game's normal UI?
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24169
    • View Profile
Re: API request
« Reply #82 on: March 26, 2013, 03:27:24 PM »

The UI as a whole isn't customizable, and it's not ever likely to be - only a few carefully selected elements will be, and they have to be designed from the start for it. The only one right now is the dialog that comes up when interacting with campaign entities.

That one does also allow a fully-customizable panel to be inserted in a specific location, but it's not the kind of thing you could just do anywhere.

...Speaking of UI, is there going to be some straightforward way to replicate the look & feel of the game's normal UI?

Good question. I'd like to add some way to get text out there, because it's such a pain to do otherwise. Buttons might be good, too, but I really don't want to go down the path of providing a full-featured UI creation API. I mean, the game already has this stuff internally, but there's a world of difference between "works" and "exposed effectively via API".

Will probably end up adding things here and there as it goes, but I wouldn't count on anything beyond text and maybe buttons. Buttons wouldn't be that difficult to do in an entirely custom way, either, though...
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3804
    • View Profile
Re: API request
« Reply #83 on: March 27, 2013, 07:05:35 PM »

Two requests:

HullModEffect.isUnlocked( ShipAPI ship, MutableCharacterStatsAPI admiral ) - with the note that admiral may be null, if you're in the context of a mission rather than the campaign.
 - the default implementation would return "true" for hullmods that start the game unlocked, true if admiral is null (all unlocked in missions), or true if you have the appropriate skill at the appropriate level to have unlocked that hullmod.  This would be particularly useful for reducing clutter when you've got ship-specific hull mods; it would be nice if they'd only even show up on the list if the ship in question could install them.  It would also come in handy for hull mods that go obsolete - once you have Integrated Targeting Unit unlocked, there's no point in showing Dedicated Targeting Core.

Skill Effect Type: ALL_FIGHTERS_IN_FLEET (instead of all ships in fleet, or just the player ship, or character stats) - we don't actually need this to make the effect, but, we've got no other way to impact the paranthetical note at the end of the skill / perk description.  I.E., right now if we make a skill that only affects fighters, we have to use ALL_SHIPS_IN_FLEET, and it gets displayed to the player as something like: "+5% armor for fighters (all ships in fleet, +5% per skill level)", when I'd really rather have something that reads "+5% armor (all fighters in fleet, +5% per skill level)"
Logged
Wyvern is 100% correct about the math.

JT

  • Commander
  • ***
  • Posts: 129
    • View Profile
Re: API request
« Reply #84 on: March 28, 2013, 01:39:51 PM »

"+5% armor for fighters (all ships in fleet, +5% per skill level)"

"+5% armor (all fighters in fleet, +5% per skill level)"

To me, those seem synonymous. "For all of the ships in the fleet, if any of them are fighters they get a +5% bonus", in other words.
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: API request
« Reply #85 on: March 28, 2013, 11:56:46 PM »

I`d like to request these new mutables:

- energy damage received
- kinetic damage received
- explosive damage received
- beam damage received
- missile damage received
- projectile damage received

I have some hull mods in my mind that would suck some percentage of one of the listed damage types making the other types do some extra damage. Those are mainly for larger ships, for Rock Fly and for 'AI' faction in Ironclads.

For example - energy absorbing coating that reduces energy damage taken by 25%, but makes explosive and kinetic weapons do extra 10% damage.

Or reactive armour that shrugs off 25% of missile and projectile damage, but is vulnerable to beam weapons. Etc.

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7248
  • Harpoon Affectionado
    • View Profile
Re: API request
« Reply #86 on: March 29, 2013, 11:21:46 AM »

I've been thinking of making a battle recorder/playback mod, and after talking with LazyWizard I think I'd need to do a few things that the API doesn't have yet:

Set armor values
Set weapon disabled status
Spawn beams
Reset ship system timers (not needed if the AI can be turned off).

Some sort of setting for completely turning off the ai (admiral, piloting, and autofire - the works) would also be helpful because the 'playback' part wouldn't have to clean up extra fired projectiles and undo ship system activations.

Its not essential, but being able to get/set the admiral ai orders would be nice because the player could see in the playback what orders they issued.
Logged

silentstormpt

  • Admiral
  • *****
  • Posts: 1060
    • View Profile
Re: API request
« Reply #87 on: April 07, 2013, 06:30:24 AM »

With the new UI, may we have different font on the when you start a conversation box with a specific faction, this sound obvious for both mods im working on, but it does give out a different feeling and makes factions unique on their own:

InteractionDialogPlugin:

  • String getFleetFaction()
  • String setFleetFaction()
  • String setDialogFont()
  • String getDialogFont() <- returns the url of the fonts
  • String setDialogMusic() <- string from the sounds.json
  • String getDialogMusic()
  • DialogAnimationAPI getDialogFrame() <- Animation on the Dialogs!
  • DialogAnimationAPI setDialogFrame()

...

BattleCreationPlugin:

  • String setBattleMusic()
  • String getBattleMusic()
« Last Edit: April 09, 2013, 07:20:47 AM by silentstormpt »
Logged

bbf

  • Ensign
  • *
  • Posts: 12
    • View Profile
Re: API request
« Reply #88 on: April 07, 2013, 09:38:11 AM »


While I eagerly await 0.6 and com.fs.starfarer.api.ModPlugin, I've been checking out the current API.
And if we are to support dynamic mod attaching with other mods, there are some methods that will be critical.
For starters, I cannot dynamically set the relationship of my faction with other modded factions:

SectorAPI
  • List<FactionAPI> getAllFactions(); // or more javalesque: getFactions()

With that, I could iterate them and set the relation ship stats.

Also, I would like to create a dynamic faction, that can change their ship designs.
I haven't seen any API so far that allows that.
Would I have to save every every design with a new random name, or does the engine support running a nameless design?
For example, the player can have the "Custom" design, but does that behind the scenes create a temporary design for each custom design?

Something else that would really help, would be some parameters for the StarfarerLauncher's main method.
I've been launching the game from Eclipse so I can debug stuff, and if there was a way to skip the launcher, or even the title screen, it would be great.
I suggest the following params:

  • -skipLauncher (does what it says)
  • -nosound / -sound (I think that using devMode in settings.json disables sound by default to speed up the loading, but since we are skipping the launcher)
  • -fullscreen / -window (same as above)
  • -campaign <save name / save id> (loads the game directly into that campaign save)
  • -newCampaign <class name that implements CharacterCreationPlugin interface> (that way we can just return null at getPrompt(), and provide a quick way to directly boot into the game in campaign mode with a new player)
  • -mission <mission id> (I haven't ever played a mission so far, and don't really know if it can have any parameters asked at start, but I added this for the sake of completeness)

Resolution parameters aren't really required since you can just use resolutionOverride in settings.json.
I tried peeking to implement these myself, but obfuscation was just too annoying to dig through.
I wasn't really sure if you are passing an ActionListener to StarfarerLauncherUI, or if it's bootstraping the game itself.



Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1365
    • View Profile
    • GitHub Profile
Re: API request
« Reply #89 on: April 09, 2013, 12:30:09 AM »

EngineAPI:
  • boolean isActive()
  • float getThrustLevel() // Current thrust level, normalized between 0 and 1
  • boolean isDisabled()
  • float getDisabledTime()
  • boolean isSpecialEngine() // For things like maneuvering jets

ShipAPI:
  • List<EngineAPI> getEngines()

MissileAPI:
  • EngineAPI getEngine()


Also, certain enums like CollisionClass and WeaponType are exposed in the current API, but others are not. Could the remaining enums like TextureType, BarrelMode, RenderHints, AnimationType and other weapon/ship tags be included in the API as well?
Logged
Pages: 1 ... 4 5 [6] 7 8 ... 42