I'm trying to figure out a way to change if a ship loses CR during combat through a hullmod. There's a function to get if this happens (ShipAPI.losesCRDuringCombat), but I can't find anything to set it. Multiplying PPT to a ridiculous number is a silly and improper way to do it. What am I missing?
ship.getMutableStats().getCRLossPerSecondPercent().modifyMult(id, 0)
Might work? Not 100% sure.
what I mean is...
a ship that has phase anchor trigger in the combat 'layer', instead of dying it sets its health to 1 and retreats
upon returning to the campaign layer, such as for pursuit or the like, the ship has basically 1 health
what I want is to be able to set that health to something higher than 1 when the phase anchor triggers, and have the ship come out of that battle with that health.
using ship.setHealth is not working for this, it still comes out with 0% hull. tried ship.getFleetMember().getStatus().repairHullFraction(), as well, but that also didnt work.
so I guess a short way of putting it is that I want a hullmod-modified current hull level in battle to persist into the campaign after that battle.
Ah, hmm. I think FieldRepairs does something similar, and you *might* be able to do something like:
stats.getDynamic().getMod(Stats.INSTA_REPAIR_FRACTION).modifyFlat(id, 0.5f);
That may repair the ship after combat by that amount, and the change shouldn't persist past the combat, while the health should.
is stationProb an stationRole within salvage_entity_gen_data.csv only work for derelict mothership or can I spawn a different kind of station let say a high tech star fortress by tritachyon??
It doesn't work when I was putting different factions, and I don't know what stationRole is used even after looking through the API.
It should work with different factions, but a ship role containing the station variant needs to be defined in the .faction file. See derelict.faction for an example of that.
Is there any way to remove collisions from destroyed ship's hulk / make them disappear faster? In large battles they seem to severely reduce FPS and blocking almost all shooting vectors which turns fight into space caterpillar simulator...
You should be able to CombatEngineAPI.removeObject() them. And to setCollisionClass(CollsisionClass.NONE).
how does anti-Lidar Array AI work?
Does it start detecting the enemy's increased range as soon as the system's charge up begins? Or does it do it only after the charge up is complete?
I don't remember 100% but I think it reacts to the targeting lasers (which do substantial dps) and then that smoothly transitions into reacting to the main guns themselves.