I've playing around with a couple of plugins and modifying them for my needs.
I hit a couple of walls.
1) While a plugin is running, is there a way to flush the memory AS3 is using? I'm processing lots of data and get the "out of memory" message a lot.
2) I'm importing my own star data and running plugins to generate contents (see #1). I'm not a fan of either small bodies or space stations. I'm looking for code to cycle through the sector, find either of these types and delete them. I have scripts the cycle through my sector and generate contents, but can't figure out how to eliminate certain body types.
Thanks. Any help will be appreciated.
Comments
#2 - You can try generating a new sector first with the frequency for small bodies set all the way down. Those settings may carry over in the scripts.
Using "Save to File" worked wonders.
No joy on #2. Is there a function to delete a body of a certain type?
Not only is there a total lack of documention within the Alien API docs, the lack of functions is laughable. Why is there an AddChild function but not a DeleteChild function? And I said delete child, I know I can delete all the children, but that's not what I'm after.
Don't get me wrong, I love AS. But I guess AS isn't supposed to be for power users.
You're adding the body to two systems. When one gets deleted, there's a null pointer under the second one, hence the error.
The API is a hook into literally the exact classes and methods used by Astro. Not everything will be in there because some tasks done by the program require direct access to memory, which is not possible in a scripting language.
Instead of doing all this in script, how about simply opening the file in sqlite and deleting the rows you dont want? It'd take a single sql statement to remove all space stations.
I guess I can't see in my code where I was adding the child to a second system. Could you point it out to me?