_planetId is a text value stored to be just later, fill this with the planet/star that you want the ring to orbit around
runcode String _planetId = "planet_id";
_fleet stores the player fleet that we get through: Global.getSector().getPlayerFleet();
so it can be used later
SectorEntityToken _fleet = Global.getSector().getPlayerFleet();
_sys stores the current star system the player fleet is in.
again to it can be used later
StarSystemAPI _sys = (StarSystemAPI)_fleet.getContainingLocation();
from the current _sys(StarSystemAPI) get the entity with id _planetId
SectorEntityToken _planet = _sys.getEntityById(_planetId);
math magic, takes the location of the player fleet and the planet location to do numbers
float _orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(_fleet.getLocation(), _planet.getLocation());
float _orbitDays = _orbitRadius / (20f + new Random().nextFloat() * 10f);
and the part that adds the ring to the planet
using _sys as it seems to be the highest location entity aviable.
and passes _planet as the orbit focus
_sys.addRingBand(_planet,
The key uner which the texture location data can be found
the texture name to be used to display the ring in game
the with of the texture image file
the index of the texture to be used, a texture can have multiple images
start counting at 0. So you want the 3 thing in a texture it is the number you need is 2, because
0(1),
1(2),
2(3).
I do not know what the colour effects, maybe the mask/lighting?
The with if the ring in game
the radius form the centre of the planer tot the centre of the player fleet.
this means that the middle of the ring will spawn on the player fleet
that amount of day it compleaits one loop around the planet