I spliced together two commands to make one that creates both an asteroid belt and its ring band.
Back up the save before you mess with it. This can actually BRICK saves.I want to make an Asteroid Belt in a Star System named
Arcadia, near planet #
2. (For tech-oriented people: it isn't 0-indexed. The planet #0 is the central star.) (You can use getEntityById, i just found it clunkier. For stars, it's probably better to use getStar(), getSecondary() and getTertiary().)
I want to chuck in
50 asteroids that you can interact, with the starting point of the Belt being
700 pixels away from the star specified, with the entire asteroid belt being
240 pixels THICC, in it some asteroid takes
400 days to complete an orbit some taking
600 days to complete their orbit, with the ring itself taking
500 days to orbit. I want to name it
Ring of Power.
I want the ring to have the texture #
3. (It can be any value 0-3, though 1 and 2 are very similar.)
RunCode Global.getSector().getStarSystem("Arcadia").addAsteroidBelt((PlanetAPI)Global.getSector().getStarSystem("Arcadia").getPlanets().get(2), 50, 700f, 240f, 400f, 600f, Terrain.ASTEROID_BELT, "Ring of Power");
Global.getSector().getStarSystem("Arcadia").addRingBand((PlanetAPI)Global.getSector().getStarSystem("Arcadia").getPlanets().get(2), "misc", "rings_asteroids0", 256, 3, Color.RED, 240f, 700f, 500f)