Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 19 20 [21] 22 23 ... 42

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #300 on: February 25, 2016, 06:04:59 PM »

In MissionDefinitionAPI nebulae are currently added using a location and a radius. Is that converted to tiles under the hood, or is the tile system more along the lines of "there's a nebula somewhere within this square"?

It's converted to tiles under the hood, yeah. The location + radius methods do some randomization of the brightness (perlin noise, iirc? probably overkill if it is) etc when generating the tiles.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #301 on: February 25, 2016, 06:08:05 PM »

Added:
void setHasNebula(int cellX, int cellY, float brightness);
Logged

Deathfly

  • Modders' Vanguard
  • Commander
  • ***
  • Posts: 245
  • Murdered by T. H. Morgan
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #302 on: February 26, 2016, 03:10:37 AM »

Could we have this methods to modify the center of shield in combat?

com.fs.starfarer.api.ShieldAPI

    void setCenterX(float X);

    void setCenterY(float Y);
Logged
A not-so-noob functional geneticist
And a free bug hunter
Code and decode almost everythings with a genomics approach.
Served in Neutrino corporation as a long-term services and supports staff.

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #303 on: February 26, 2016, 03:30:11 AM »

ShieldAPI.setCollisionClass(CollisionClass collisionClass)
ShieldAPI.getCollisionClass()

(as in yeah, it could be handy if a shield could have a different collision class from the ship having it)
Logged

Snrasha

  • Admiral
  • *****
  • Posts: 705
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #304 on: February 26, 2016, 03:39:34 AM »

We have multiple method in combat for nebula, we can have for campaign? Thank

com.fs.starfarer.api.fleet.FleetMemberAPI

         boolean isInsideNebula();
         boolean isAffectedByNebula();
         void  setAffectedByNebula(boolean affectedByNebula);
         void setInsideNebula(boolean isInsideNebula);


This is maybe not correctly method because we have, except if i have wrong, two levels of nebula, normal and hard nebula where hard , you lose very more burnlevel. So maybe:

        boolean isAffectedByNebula(); =>  int isAffectedByNebula(); who give 0,1 or 2. (0 , you are not affected, 1, normal effect and 2, this is hard effect)
        void  setAffectedByNebula(boolean affectedByNebula); => void  setAffectedByNebula(int affectedByNebula);   (Same thing for int value)

This method can be usefull for qew too rare thing, i think, so i can understand why you refuse. (After, maybe for a better IA, for later... actually who can go inside without problems because he have not need fuel or supplies[Just for very very very big fleet, because pirates fleets, this is a protected area for them])

Logged
I am pretty bad on english. So, sorry in advance.

Gladiator Society
Add battle options on Com Relay/ Framework for modders for add their own bounty.

Sanguinary Autonomist Defectors A fan-mod of Shadowyard.

Deathfly

  • Modders' Vanguard
  • Commander
  • ***
  • Posts: 245
  • Murdered by T. H. Morgan
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #305 on: March 12, 2016, 12:44:47 AM »

In some cases we realy needs to make armor regen.

ShipAPI.syncWithArmorGridState();
ShipAPI.syncWeaponDecalsWithArmorDamage();
Logged
A not-so-noob functional geneticist
And a free bug hunter
Code and decode almost everythings with a genomics approach.
Served in Neutrino corporation as a long-term services and supports staff.

hqz

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #306 on: March 15, 2016, 07:34:17 AM »

Could ShipAPI extend AssignmentTargetAPI? I might be doing something wrong but it seems like it would be convenient to use ships as assignment targets directly. Especially since the ShipAPI already has all the required method AFAICT (through the CombatEntityAPI interface).

http://fractalsoftworks.com/starfarer.api/com/fs/starfarer/api/combat/ShipAPI.html
http://fractalsoftworks.com/starfarer.api/com/fs/starfarer/api/combat/AssignmentTargetAPI.html
Logged

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #307 on: March 15, 2016, 08:33:16 PM »

Could ShipAPI extend AssignmentTargetAPI? I might be doing something wrong but it seems like it would be convenient to use ships as assignment targets directly. Especially since the ShipAPI already has all the required method AFAICT (through the CombatEntityAPI interface).

http://fractalsoftworks.com/starfarer.api/com/fs/starfarer/api/combat/ShipAPI.html
http://fractalsoftworks.com/starfarer.api/com/fs/starfarer/api/combat/AssignmentTargetAPI.html

You can do this with a DeployedFleetMemberAPI object if you explicit cast it, but I can't remember if it works with ShipAPI or FleetMemberAPI:

Code
// Get combat fleet manager for the deployed ship's fleet side
CombatFleetManagerAPI combatFleetManagerAPI = Global.getCombatEngine().getFleetManager(shipAPI.getOwner());

// Create an escort assignment on the deployed ship
CombatFleetManagerAPI.AssignmentInfo assignmentInfo = combatFleetManagerAPI.getTaskManager(false).createAssignment(CombatAssignmentType.LIGHT_ESCORT, (AssignmentTargetAPI)this.getDeployedFleetMemberAPI(shipAPI), false);

// Give the escort assigned to another ship
combatFleetManagerAPI.getTaskManager(false).giveAssignment(this.getDeployedFleetMemberAPI(otherShipAPI), assignmentInfo, false);

Supporting code (I think a duplicate of this might exist in LazyLib):
Code
private DeployedFleetMemberAPI getDeployedFleetMemberAPI(ShipAPI shipAPI) {

        CombatFleetManagerAPI fm = Global.getCombatEngine().getFleetManager(shipAPI.getOriginalOwner());
        return fm.getDeployedFleetMember(shipAPI);
    }
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #308 on: March 20, 2016, 10:19:00 AM »

I'd like:

DestroyEntity(CombatEntityAPI entity)

Where:

1.  Whatever it has its hitpoints set to zero, does whatever death animations it's supposed to, etc.
2.  If a ShipAPI, it's destroyed immediately and is removed, not converted into a Hulk (even this frame).
3.  Its "I'm dead" flag (or equivalent) is set.

This would replace some workaround methods I've had to use to get the same things done, like moving ships I need destroyed immediately thousands of SUs off the battlefield, etc.

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 #309 on: April 03, 2016, 12:54:55 PM »

I'd like to be able to modify stats access through WeaponAPI.getStat. For example, (with Weapon as an instance of WeaponAPI.) weapon.getRange.modifyPercent(id, 10f); doesn't work.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #310 on: September 10, 2016, 01:45:14 PM »

Briefly checked and didn't see this and think it could be useful:

method: FleetMemberAPI.getPlayerHullAccess(CAPITAL, false);

Sorry if any syntax errors I'm still learning basic programming, but the idea here is a method to access what hull types the player has access to and returns a boolean shutting them on/off from purchasing or acquiring that ship type.

I'd like it to be accessible to skills so you can put sill points to unlock access to hull classes. It provides another way to limit player ship progression with a variable other than credits and reputation (the latter is a lighter limit anyway since right now you can theoretically board enemy ships).

Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: API request thread (please read OP before posting!)
« Reply #311 on: November 18, 2016, 11:58:41 PM »

List<Float> WeaponAPI.getHardpointAngleOffsets()
List<Float[]> WeaponAPI.getHardpointOffsets()
and corresponding methods for turrets.

enum WeaponAPI.getBarrelMode()
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 713
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #312 on: February 01, 2017, 01:07:49 PM »

ShipAPI.getShipAI() returns a Ship.ShipAIWrapper object which isn't available in the API so there's nothing that can really be done with the wrapper (like getting at a custom AI inside the wrapper)

Perhaps either make the ShipAIWrapper class public in the API or have the ShipsAPI.getShipAI return the actual AI

Wyvern

  • Admiral
  • *****
  • Posts: 3803
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #313 on: March 11, 2017, 09:48:14 AM »

It's already in the initial post, but I'd like to second the requests for setLocation() methods on ShipEngineAPI and WeaponAPI; I'm looking to do some semi-fancy things with moving parts, and it'd be much lighter-weight to use decorative weapons than decorative station-style modules.  (...Though now that I think about it, I'm assuming I can make those move relative to the base hull, aren't I?)
Logged
Wyvern is 100% correct about the math.

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: API request thread (please read OP before posting!)
« Reply #314 on: March 31, 2017, 01:07:10 PM »

Honestly surprised its not in there considering there is getAmmoBonus(), but after a double check I could use:

Code
com.fs.starfarer.api.combat.MutableShipStatsAPI.getMissileAmmoRegenBonus();

and

Code
com.fs.starfarer.api.combat.MutableShipStatsAPI.getEnergyAmmoRegenBonus();

Need these for a built-in hullmod for my fighters to lessen the strike capabilities of their weapons.
Logged
Pages: 1 ... 19 20 [21] 22 23 ... 42