Re: [nbos] [AS]Data Config holder
NBOS Support
Tue Apr 10th, 2007
At 10:56 AM 4/9/2007, you wrote:
>Does anyone out there know how to use the SystemDataConfigHolder. I'm
>creating a script that reads from a database and I want to add custom
>fields to AS2 that you can see from Left hand display bar.

Some examples...

Adding fields to all selected bodies:

b = oSector.GetSelected( 0)
sdc = CreateSystemDataConfig()
sdc.AddField "The spectral class is", "spectral", "", False
.... add all your fields....

b.SetSystemDataConfig( sdc)

Setting the sector-wide fields for terrestrial planets. Havent tested
this, but should go something like:

sdch = sector.GeSystemDataConfigHolder()

sdc = CreateSystemDataConfig()
sdc.AddField "Radius", "radius", "", False
sdc.AddField "Gravity", "gravity", "", False
sdc.AddField "Rotation", "rotation", "", False
... all your fields get added...

sdch.SetConfigForType( sdc, BODY_TYPE_TERRESTRIAL)

I dont think its possible to read and then alter the existing
systemdataconfig classes via the scripting interface.

The SystemDataConfigHolder is the Sector's 'container' of default sdc's for
each body type. So basically its an array of sdc's with the body type as
the key.


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