Colony Capital Modding Question

So I wanted the colony capital's to be able to be relocated and made them destructible and removed the '<Unavailable> True'.     I ran into a couple issues.   One can be built on the homeworld now which I don't mind and for some reason when I took over a colony from an enemy it was lacking a colony capital and had 0 population :(  (I guess the AI must of destroyed it for some odd reason?  it's the only one I've seen that happen to so far.)

So I'm thinking there must be a file somewhere I'm missing that tells the AI which buildings to build and gives them some kind of value which the colony capital building must not be included since it's auto built.   I want to make it a mandatory building with a high value so it gets built first on capital world and if destroyed on other worlds for them to rebuild it.

Anyone know the file that assigns the AI value's to improvements ?  I don't see anything like that in ImprovementDefs.xml.

__________________________________

Edit:  Well I got them to start building the colony capital but for some reason like 30% or more new colonies they either destroy the colony building or it never get's auto built and they lose all there pop.  Probably not going to work.  I really like being able to relocate capitals from random positions.

8,781 views 2 replies
Reply #1 Top

According to the Improvements schema there is an element called 'RelativeWeight'.

I am not sure what it does or even if it is implemented.
You could try adding this to the improvement and setting a high value.

 

There is also an element called 'Tech' in the AIStrategyDefs schema, again no idea what it does or whether it is implemented. 

N.B. If you add an element to your xml, it must be in the same order they appear in the schema.

Let us know if you get it working |-)  

Reply #2 Top

I went a different way since the AI's kept destroying there capitals if I took off the 'IsIndestructible' =  True line.  Sometimes they were even destroying there main capital.

I kept the capital's as they are so they can't be moved but changed the SpaceElevator and YorResourceExtractor to match alot of what the colony capital has and removed some things from colony capital.  Now the AI will build those 2 usually within the first couple buildings and usually they in a much better position to be surrounded by other buildings.  I just changed the 3 icon lines for those 2 buildings to match the capital building icon and changed there text a bit.  I also added <Preclusions> for those 2 buildings so they can't be built if the other one exists already (when the colony is taken over).

It's working really good.