It looks like you're new here. If you want to get involved, click one of these buttons!
I am trying to write a plugin that will load a text file with a list of bodies along with political affiliations, and proceed to find said bodies in the currently loaded sector and change their PoliticalAffiliation property as per the file.
My problem is what key to use to locate the desired body object in the sector.
The Sector.GetSystem(integer) method needs an int argument, does this mean that for each change I have to iterate through GetSystem(), check the Body.Name property (or something) to find a match, then change the Body.PoliticalAffiliation property as desired? There does not seem to be a way to look up bodies by their UABI, not that the UABI is easily accessible.
I could export the entire sector into an XML file with XMLExport.AstroScript, write a Python program to parse it and forcibly change the political affiliation, then import it into AstroSynthesis via XMLImport.AstroScript. But that just seems to be a round about way to perform the task.
What I am trying to do is create a map with multiple interstellar empires, with ownership of each system defined by which "empire center" is the closest.