Ok, im assuming you did the part 1 tutorial before this. You should know how ASOD stores and retrieves data on celestial objects and how to place them in a desired solar system. You should also have done the garbage collector tutorial.
First lets look at some sample code that makes the "Asteroid Belt 1" in Ziaac.
space = new cosmos(2, 1001, 9632, "Asteroid Field I"); space.setSolarSystem("Ziaac"); space.setPlanetTexture(Toolkit.getDefaultToolkit() .getImage(getUrl( "test_asteroid_0003.png")));
The code got a little disorganized on the site, but you can tell what it does. You see it has a planettexture like a planet or station, and is loaded in th same way. You see the name and position are declared the same way and that the solar system is set the same way.
There are differences, look here:
space = new cosmos(2, 1001, 9632, "Asteroid Field I");
Notice the 2 after cosmos( . This is the new type declaration for asteroid belts. By making a celestial's type 2, you are making it an asteroid.
What does Type 2 mean in-game?
An object of type 2 is an asteroid of some kind. It can be mined releasing raw ore.
space = new cosmos(3, 5600, 10034, "Riol Nebula"); space.setSolarSystem("Ziaac"); space.setPlanetTexture(Toolkit.getDefaultToolkit() .getImage(getUrl("test_gas_0004.png")));
That code is for the Riol Nebula in Ziaac. You see that it is essentially the same as an asteroid belt. However, notice the type of 3 instead of 2. This means that in-game it shows up as a gas cloud on the HUD and it released stellar gases when mined.
Never forget to hook the garbage collector, due to size these objects take up especially high amounts of memory.