how does PlanetAPI.setSecondLight() work?
I'm setting it in an EveryFrameScript with runWhilePaused returning true but it only ever actually works while the game is paused, if I unpause the planet goes back to being unlit.
later edit : I've also checked with a debugger, the planet's secondLightColor & secondLightLocation fields do get properly filled out wether the game is paused or not
I've also tried setting it once when the planet is generated, but that didn't seem to work either
the script that gets added to the system the planet is in
(I also use this to block transverse jumping out of the system)
public class SSCHomeSystemTJBlocker implements EveryFrameScript {
public final StarSystemAPI system;
public SSCHomeSystemTJBlocker(StarSystemAPI system) {
this.system = system;
}
@Override
public boolean isDone() {
return false;
}
@Override
public boolean runWhilePaused() {
return true;
}
@Override
public void advance(float amount) {
CampaignFleetAPI playerFleet = Global.getSector().getPlayerFleet();
if (playerFleet.getContainingLocation() != system) return;
PlanetAPI planet = (PlanetAPI) Global.getSector().getEntityById(IDs.gardenPlanetID);
SectorEntityToken SSCStation = Global.getSector().getEntityById(IDs.cronusStationID);
planet.setSecondLight(
new Vector3f(SSCStation.getLocation().x, SSCStation.getLocation().y, SSCStation.getCircularOrbitRadius() * 0.75f),
new Color(255, 225, 125, 255)
);
if (!playerFleet.hasAbility(Abilities.TRANSVERSE_JUMP)) return;
if (playerFleet.getAbility(Abilities.TRANSVERSE_JUMP) == null) return;
playerFleet.getAbility(Abilities.TRANSVERSE_JUMP).setCooldownLeft(Global.getSettings().getAbilitySpec(Abilities.TRANSVERSE_JUMP).getDeactivationDays());
}
}