What if you're using a real world star map and want to generate fictional child bodies for a huge number of stars? Worse, what if you don't want to have a huge, unweildy file afterwards?
First off, I know very little about plugins and scripting. A little reading has gotten me some clues, but it's not like I've written any.
What I need to do:
1. Go to a star or multiple in an existing sector.
2. Check to see if it is within parameters (for example, I am limiting my inhabited worlds to stars of stellar types F8 through G5. This should probably be selectable if anyone besides me wants to be able to use it). If not, cycle to the next star/multiple in the sector.
3. If it is within parameters, generate system contents.
4. If the generated system contains no bodies within parameters (in my case, Hospitable worlds), delete system contents. This keeps the number of total bodies down to manageable size while still following the "hospitable worlds are rare" convention.
5. Cycle to the next star in the sector and repeat.
This would allow random generation of contents for an already existing star map, consisting of dozens or hundreds of worlds spread out over hundreds of light years. If possible, another good feature would be to hide all bodies except those with habitable worlds *and those within X number of degrees of arc to a line drawn between habitable worlds.* This would allow for "outpost worlds" that serve little function other than as waypoints between the hospitable ones.
Any thoughts? Does something like this already exist and I just haven't spotted it?
Comments
If you could do this and the one I posted above, a pretty green user could import starfield data, create a "string of pearls" of sectors and subsectors that comprise dozens or hundreds of systems each, and hide the ones not germane to his current work, all with comparative ease I would think. And all extrapolating from what we actually see when we look up.
Am I off the deep end here? Are there obvious answers I'm not seeing? Or has this already been done?
Assuming b is the root body:
So something like this would delete all system contents, just leaving the parent (root) bodies on the map:
To delete the system itself, there's a DeleteRootBody() method in the Sector class.
Something like this should delete all systems on the map:
There's a function called QuickGenerateSystemContentsKeepName() which is probably what you want. This will generate contents and not rename the root body (doesn't use organic naming). You pass it a body and true/false for whether or not you want populations.
There's also a function called RandomSystem() with the same parameters, but that will wipe out the system and give you all new contents, possibly including names.
What happens if the root body is a multiple or close multiple?
And for whether they fall into particular parameters, can I use the same conventions the search function uses, such as "Spectral like F"? For example, how would I go about defining "If none of the children is Hospitable"?
You can't generally use the Natural Language Search system to search a specific body (you can, but it wouldn't be very efficient). You can use the NLS to search among a group of bodies (such as the entire sector) in code, and then have access to the results. So you could get a list of all bodies that don't have any hospitable planets among them, and then do your regenerations. That's the AstroSearcher Class.
Word of warning... if the plan is to regenerate a system if there is no hospitable planet in it, some systems cannot support a hospitable planet, so you may not get one no matter how many times you try to run the generator.
If you just want to look at specific stars, it may be easiest to look directly at the properties of their planets (gravity, population, etc). Look at the API doc for the list of properties and functions. For example, there is a GetMaxChildHabitability() method that can be called.
I'd love to, but I don't know where it is.
EDIT: Never mind, found it. Thanks!
I have a free VBS editor, so I can get the color coding to help make sense of a script, so long as I change the file extension to .vbs from .astroscript... but I don't see any way I can debug it. I mean yes, I can go through and look for errors, but I can't step through the script, see what it does, and where it fails. I can't run it from a command prompt because it requires AS data not available at a command prompt. I can run it in AS, but I can't see any way to go through it one step at a time for troublehooting purposes.
Okay, what's the obvious answer that I'm missing? I figure there has to be an obvious answer, since I can't possibly be the first person who has wanted to step through an AS script for debugging purposes.
In your editor, you should be able to set it so that you can color code .AstroScript files rather than having to rename the extension each time.
Did you get anywhere with your efforts generating system contents for already placed stars? I'm looking to do something similar - I have several sectors of empty star systems which I want to populate automatically.
Cheers!
Sarah
No, I didn't.
Just a bit over 2 years ago, my mother's house burned to the ground, and she passed away a week later. My sister and I ended up spending the last 2 years fighting with various people who couldn't seem to understand the concept of "No, we don't have any records of _____, they were destroyed in a house fire." It took me nearly 6 months just to get the government to admit that I exist at all. Then there was probate... twice, and my sister building a new house on the land, and... well, let's just say that it was only about 3 months ago that I stopped effectively living out of a bug-out bag.
Sorry, I got kinda distracted.