How do I randomly generate solar systems with a star and planets

So I made this:

287942-system.gif

I’ve attached the code in text files ( you just open the text file, copy all and paste into the BP sheet ).

[link text][2]
[link text][3]

The vars in the main BP are:

287946-vars.jpg

It’s a little clunky but works pretty well. One limitation is the planets are a fixed distance apart.

If you can’t get it working, tell me, and I’ll give you a project link.