System_Desc desc;
- This is an array which holds all the system details in an array.desc.Position = pos;
- The actual position of the star in the galaxy.desc.AutoStar = false;
- I think if set to true then it generate a star using random settings.@sys = @glx.createSystem(desc);
- Places the holder and generates the star if above is true otherwise it will use the next bit below to create the star properties.

Star_Dec desc;
- This is an array to hold all the star details.desc.Temperature = randomf(2000, 21000);
- this sets the star colour, I haven't established when the generator uses different colours but lower values generate red, then yellow to white/blue at the higher end. It is not possible to generate anything other than red (so no black holes!) The values can be set from 0-infinite but there is a point where the value becomes pointless.desc.Radius = randomf(30.f + (desc.Temperature / 1000.f),60.f + (desc.Temperature / 600.f)) * starSizeFactor;
- In this example it uses the star temprature to generate a min/max size to randomly choose from then times it by "starSizeFactor" (default 2.5) this helps keep things in prespective, but can be set to any valid integer, large numbers make it hard for planet spawns to occur.desc.Brightness = 1;
- Specifies how bright the star is, supports float values (eg. 0.5) anything much above 8 is very bright and tends to be reserved for lifeless systems! 1 is default.sys.makeStar(desc);
- generates the star based on the array information

Planet formation is done during the same method as star creation (above), this means that you can be very specific with how many and what types of planets will spawn if you decide to generate specific stars with many claimable planets to none.

This is the bit of code that generates the planet, it is in a for loop to ensure that every planet (pCount) is created.

float pRad = randomf(minPlanetRadius, maxPlanetRadius), pVol = pRad * pRad * pRad * 4.189f;
- This sizes the planet in the star system we just generated, using static variables minPlanetRadius and maxPlanetRadius the planet will be a random size, again this can be changed to any integer. pVol gives the volume of the sphere (our planet) used later for ore values.plDesc.PlanetRadius = pRad;
- Set the planets radius to the planet arrayoRad += randomf(1.f, 2.5f) * orbitRadiusFactor;
- This places the planet in orbit around our star, orbit RadiusFactor is a static variable, if you have intend to generate a lot of planets adjust the upper value here too.plDesc.OrbitRadius = oRad;
- Sets the planet orbit details in the array.plDesc.OrbitEccentricity = randomf(0.5f, 1.5f);
-Not 100% sure, but would appear to affect the orbit path, more testing needed...plDesc.setPlanetType( getPlanetTypeID( "rock2" ));
This is an extra line not normally needed that lets you specify the exact planet type that is being generated, in this example a rocky planet using texture 2 (from the default game setup, see the array note for where planet types are created).

The first line generates the actual planet, the second line tells the planet how many structures are allowed to be placed upon it. This takes in to account the actual planets size, its potential min/max size and the maximum allowed structure space.

Finally the script generates some ore, the planets maximum damage or hit points and any moons, this is all done below and isn't any more complicated than above so I won't break this down.