Re: [nbos] [AS] VBScript System Generator
Sam Orton
Thu Sep 20th, 2007
This is a mod to get it to leave already existing systems alone rather than overwriting their system data. It still has its bugs in that:

1) It will not generate system components for multiple systems that already have the stars in them (the condition is that ChildrenCount of the root body be 0), and

2) The generator still renames things, so it may take some hunting to find them again.

'From NBOS Planet Blazon Generator

sector = GetCurrentSector()
j = sector.SystemCount

'iterate through all the bodies on a map
For i = 1 to j

'check if Esc key pressed
nKey = GetKey()
If nKey = 27 Then
Exit For
End If

sector.RenderMessageBig = CStr( i) & " of " & CStr( j)

o = sector.GetSystem( i-1)

'Minor modification from NBOS Random System Generator

if o.ChildrenCount = 0 then
RandomSystem o, true 'run the system through the built-in astro generator, w/ populations

'if system is populated, change the label color
if o.ChildPopulation > 0 then
o.LabelColor = rgb( 255, 128, 0)
end if

'do this so that astro can keep track of things like populations & political affiliations more efficiently


I worked with GWBasic 3.3 up through QBasic, so I'm not unfamiliar with this really, but this is the first time I've ever looked at VBScript language, so it might be clumsy. Not too bad for a rough though, I think.


P.S. I attached the script itself, but I won't be surprised if the mail system strips it.

"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect intended us to forego their use." - Galileo Galilei

Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
Nbossoftware mailing list

Copyright © 2003-2007, NBOS Software. All rights reserved. 'Fractal Mapper', 'ScreenMonkey', 'Character Sketcher', 'Inspiration Pad', 'Fractal World Explorer', 'Goblin API', 'AstroSynthesis' are trademarks of NBOS Software. 'Dwarven Beserker' art by V. Shane.
Member contributed resources