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 ... 20 21 [22] 23 24 ... 42

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

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #315 on: April 05, 2017, 09:36:59 PM »

Just an off-hand suggestion/query regarding the fleet creation API for single missions. Specifically, I discovered today that the only options within
   
Code
api.addToFleet(FleetSide.[FLEET SIDE], ......)

are "PLAYER" and "ENEMY". Would it be possible to also have "ALLY" be an option?

My thinking behind this would be to match the circumstance in the campaign where you join an existing battle between two fleets, or a friendly fleet supports your forces when you engage in combat. Under these circumstances you still have control over your ships, but the "ally", while fighting on your side, will give their own orders independent to you.

I reckon it would be nice to have "ALLY" be an option for single missions with similar effects, so you can create a mission that matches a storyline where you are assisting/being assisted by another friendly fleet with its own commander. Off the top of my head I can't think of any problems with this (although you could possibly abuse it by creating a mission where all the friendly ships are "allies" and the player has no control of anything).

Thoughts?
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #316 on: April 07, 2017, 12:29:19 PM »

Just an off-hand suggestion/query regarding the fleet creation API for single missions. Specifically, I discovered today that the only options within
   
Code
api.addToFleet(FleetSide.[FLEET SIDE], ......)

are "PLAYER" and "ENEMY". Would it be possible to also have "ALLY" be an option?

My thinking behind this would be to match the circumstance in the campaign where you join an existing battle between two fleets, or a friendly fleet supports your forces when you engage in combat. Under these circumstances you still have control over your ships, but the "ally", while fighting on your side, will give their own orders independent to you.

I reckon it would be nice to have "ALLY" be an option for single missions with similar effects, so you can create a mission that matches a storyline where you are assisting/being assisted by another friendly fleet with its own commander. Off the top of my head I can't think of any problems with this (although you could possibly abuse it by creating a mission where all the friendly ships are "allies" and the player has no control of anything).

Thoughts?

I'm of two minds on this. On the one hand I could see it as an "easy" way for modders to get some story/mission content into a mod considering how complex putting stuff into the campaign is getting.

On the other hand, I have felt for a while now that missions are a deprecated feature entirely and could possibly do with a removal.  :P  They were originally designed to give players a way to sink their teeth into combat while the game was still fairly early in development. To provide scenarios that would happen in the context of the real game, the campaign.

They were revised a while back to include more depth of story and characters, but even there I think that it was more of a band-aide to make an old feature more attractive and to give us a bit more backstory to the sector at a large. As much as I love stuff like this, (I requested a blog post on the lore of a faction after all XD ) I would rather see these types of missions actually dynamically take place in the campaign with rewards and rippling impacts to the sector's stability/politics.

A more continual story arc, so to speak, even if more focused on the players exploits with only bits and pieces of lore/story/background thrown in from time to time.

This alone wouldn't be enough to warrant a removal, but they also do (or.. at least used to haven't checked in a bit) weird things like give you access to all hullmods (even built ins) and weapons in the refit screen. Something I personally don't want in my mod for REDACTED reasons.  :)
Logged

Toxcity

  • Admiral
  • *****
  • Posts: 561
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #317 on: April 07, 2017, 01:01:33 PM »

I do agree that letting you create allies for a mission could be nice to create a certain feel.

As for missions themselves, I think they are a worthy addition. The backstory/description of missions is only one aspect of what makes missions a good feature.

Putting the player in a scenario they would not enter in the campaign (the mission Predator or Prey? for example) is a great way of learning how to pilot a ship well. Not having to worry about skills or losing a ship when doing so is also nice.

They're also a great way to let the player test out a ship (Sinking the Bismar). As for modding, missions are also a great place for a modder to let the player try out their ships without needing campaign integration. This is especially important considering that campaign integration gets more complicated with each version.
« Last Edit: April 07, 2017, 01:03:27 PM by Toxcity »
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #318 on: April 07, 2017, 02:51:55 PM »


On the other hand, I have felt for a while now that missions are a deprecated feature entirely and could possibly do with a removal.  :P  They were originally designed to give players a way to sink their teeth into combat while the game was still fairly early in development. To provide scenarios that would happen in the context of the real game, the campaign.


Ah, see I adore missions. I think they still do an excellent job at easing a player into the game, and they also introduce you to key points of the lore as well, which I love. And honestly, the way each mission's independent story is written is just beautiful to me. :) Something I try very hard to match when modding, but highly doubt I manage it, even as an amateur writer.



As for missions themselves, I think they are a worthy addition. The backstory/description of missions is only one aspect of what makes missions a good feature.

Putting the player in a scenario they would not enter in the campaign (the mission Predator or Prey? for example) is a great way of learning how to pilot a ship well. Not having to worry about skills or losing a ship when doing so is also nice.

They're also a great way to let the player test out a ship (Sinking the Bismar). As for modding, missions are also a great place for a modder to let the player try out their ships without needing campaign integration. This is especially important considering that campaign integration gets more complicated with each version.

Yeah, that's about my opinion of missions, although the specifics might be a little different. Nontheless, Sinking The Bismar might be my favourite mission just because of the context and what actually goes on in the battle. I mean, you have two extremely high-tech frigates, two high-tech interceptor wings and a carrier, against a single, outdated, armour-tank, guns-a-blazing battleship. Tons of chaos, tons of fun, every time I play that missions.  ;D
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #319 on: April 08, 2017, 02:21:15 AM »

Would it be possible to also have "ALLY" be an option?
Use public void setAlly(boolean isAlly)

On the other hand, I have felt for a while now that missions are a deprecated feature entirely and could possibly do with a removal.
Somehow I get the feeling that you never watched the Fleet Building Tournament, or tried Starsector Arcade, or the Stampede Challenge, or the Customizable Battle mission...
Logged
 

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #320 on: April 08, 2017, 02:24:40 AM »

In addition, just working on mod content would be infinitely more time consuming without missions...

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #321 on: April 08, 2017, 02:30:13 AM »

In addition, just working on mod content would be infinitely more time consuming without missions...

Damn right.  ;D
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #322 on: April 08, 2017, 02:30:59 AM »

Would it be possible to also have "ALLY" be an option?
Use public void setAlly(boolean isAlly)

... Umm. Where? XD In the mission definition?
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #323 on: May 08, 2017, 09:36:17 PM »

I'd like a ShieldType OTHER, that can be set via ShipAPI.setShield()

This ShieldType would be treated like the SS AI and player controls like any other Shield, in terms of control states (isOn() would return true if turned on) but would otherwise behave as ShieldType NONE, other than coded behavior provided by the modder.

This would fix a bunch of issues relating to building things that use the Shield control state to do <stuff>, freeing modders from having to use Systems to do alternative Shield behaviors or other complicated workarounds.

Alternatively, simply let us use ShipAPI.setShield(ShieldType.FRONT, 0f, 0f, 0f) where that doesn't come with a minimum Arc; it would effectively like NONE but the AI would think it had a 360 shield.

I'm saying all of this because I got true skin-shield behaviors working in the engine, even better than what I did with the Acanthus back in the day, except for the control issues; essentially, if I try ShipAPI.setShield(ShieldType.FRONT, 0f, 0f, 0f), there's some tiny wedge of Shield in front of the ship and the rest of the ship doesn't register hits properly, to boot (and attempting to get around this by moving the Shield's center far away or setting the shield's Radius to a small number resulted in a ship that didn't register collisions, which I feel is a straight-up bug). 

And of course the SS AI doesn't really respond well to this situation; I want it to think it has a 360 shield, ideally.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #324 on: May 28, 2017, 07:56:57 AM »

AOE weapons that generate a hit do so through some black-box code; I'm guessing they simply:

1.  Fulfill detonation requirements.
2.  See if a ray of distance <radius> from them to (potential target) intercepts the collision circle.
3.  Checks if the ray intersects the hull's collision box if 2 is true (since that's way more expensive).
4.  Then does damage at that location, via CombatEngineAPI.applyDamage() (or maybe even more-ancient code; I know AOE got added super-early).

Unfortunately, this means that nowhere is that hit registered in a way that modders can access for <purposes>; to get access, we'd have to check a lot of things about a Projectile right now, which would be very expensive.  

When something uses applyDamage(), can we get a list of  "hitEvents" in EveryFrameCombatPlugin, perhaps? 

This would deal with AOE weapons, modded weapons that are dealing damage by <insert weird thing> etc.; if applyDamage() had a boolean to handle whether a hit effects Armor, it would cover all of the major cases, too. 

I'm not sure what the performance hit would be, but I doubt it would be significant.  It would also mean that my weird, weird, workaround for Missiles wouldn't be necessary, because we'd see a hitEvent, etc.
« Last Edit: May 28, 2017, 08:36:40 AM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #325 on: June 04, 2017, 07:58:37 PM »

Request:
com.fs.starfarer.api.loading.WeaponSpecAPI:
Code
String getSpriteName()
Reason:
The WeaponAPI's getSprite method cannot be accessed from a WeaponSpecAPI. This would allow the rendering of weapon sprites outside of combat.
Logged

Sutopia

  • Admiral
  • *****
  • Posts: 1005
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #326 on: June 17, 2017, 07:50:43 PM »

Is it possible to change the hullmod API ?
Code
public boolean isApplicableToShip(ShipAPI ship)
I dislike how mods have to just remove the vanilla hullmods for conflicting rather than not showing conflicting vanilla ones in first place.
Maybe add a conflict group tag to hullmod themselves?
when existed any of hullmod in a group, other hullmods in same group return false.
Logged


Since all my mods have poor reputation, I deem my efforts unworthy thus no more updates will be made.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #327 on: July 17, 2017, 10:05:44 AM »

I'd like a method in ShipAPI where last frame's damage events can be seen (ideally, where, what WeaponAPI, how much).  Both modded methods through causing damage and AOE weapons' AOE damage effect aren't detectable readily otherwise.  This makes implementing a bunch of things harder than I'd like.

It'd be nice to have a generic way for Weird Mod Gun Damage to be registered, too, but that can probably be best handled through a data structure in LazyLib or something.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #328 on: July 20, 2017, 05:53:04 AM »

boolean CombatEngineAPI.isSideDefeated(FleetSide side)
Returns true if that side has lost all its ships or is in full retreat. When called with FleetSide.ENEMY, should return true if and only if the player can now use the End Battle option in the escape menu (assuming no devmode).

Currently I'm checking CombatTaskManagerAPI.isInFullRetreat() && !CombatTaskManagerAPI.isPreventFullRetreat() to detect victory, but it seems to sometimes trigger prematurely for the enemy side.
Logged

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #329 on: July 23, 2017, 07:19:36 PM »

Is it possible to change the hullmod API ?
Code
public boolean isApplicableToShip(ShipAPI ship)
I dislike how mods have to just remove the vanilla hullmods for conflicting rather than not showing conflicting vanilla ones in first place.
Maybe add a conflict group tag to hullmod themselves?
when existed any of hullmod in a group, other hullmods in same group return false.
I'd like for ships to have an isHullmodApplicable method which calls a dynamic array of methods passed via e.g. getHullmodApplicable().add((HullModAPI hullmod) -> hullmod.getId() != "flux_shunt").
Logged
Pages: 1 ... 20 21 [22] 23 24 ... 42