The commit didn't go through last night so wasn't quite ready for use yet but its in now so I'll answer your questions here.
Is it still necessary to check all free buildings for construct conditions?
Yeah, I still think this is in general a good check but it wouldn't work for cities in the process of being founded based on other free buildings they may be getting. So it's good I think but not for THIS application so much. If we find it problematic I'll probably end up removing it and it wouldn't hurt anything to do so.
The new method is pretty much the basis for everything you'd need to work with I think.
And how excactly do these new ones work?
First of all, the MapTypes tag must be applied to all terrains or this won't have any effect. So that's the first step, defining the terrains we already have as validly representing one or more planetary types. Eventually, the map building systems will also use these to filter for the types they can place depending on the map type being generated.
But as it is, a plot in the game looks to the definition of its terrain to find its map type(s) - it's possible for a terrain to be defined as valid for multiple map types but not advisable for most applications I think. I just kept the door open for it because it didn't seem to be something that would make a large impact not to.
Cities basically inherit the map type of the terrain they are placed on.
Once that step is done:
If I add:
<PrereqMapTypes>
<MapType>MAP_LUNAR</MapType>
</PrereqMapTypes>
to a building, can it only be build in a city that has lunar terrain?
Yes. But you can also add a second line like:
Code:
<PrereqMapTypes>
<MapType>MAP_LUNAR</MapType>
<MapType>MAP_INITIAL</MapType>
</PrereqMapTypes>
to make the building valid for both the moon and earth BUT no other types.
What happens if a building does not have one of these tags at all? Is it default buildable on earth?
It is then buildable everywhere. This is how I've been able to introduce this without adding an immediate need to review all existing building XML!
What if you want to have an earth building be buildable on the moon after you build an acology there for example?
Put the arcology as a ConstructCondition. But this cannot be made to be a prereq for one and not for the other unless we add further coding to enable a more complex ConstructCondition where Map Type is a GOM that can be defined there. That would be a little challenging for me but I might be able to if it was absolutely necessary... then figuring out how to build the xml for the construct condition would be an interesting challenge as well.