Tying in # of units to # of buildings?

Aeon221

Lord of the Cheese Helmet
Joined
Apr 22, 2003
Messages
1,995
<PrereqBuildingClasses>
<PrereqBuildingClass>
<BuildingClassType>BUILDINGCLASS_JEWISH_TEMPLE</BuildingClassType>
<iNumBuildingNeeded>2</iNumBuildingNeeded>
</PrereqBuildingClass>
</PrereqBuildingClasses>

I saw this in the code while playing hunt for ideas, and I wondered if it could be used for other things...

eg: I want to limit the number of Frigates a civilization has based on the number of harbors it controls.

So I would like to use the rolling system that Cathedral's use, where first is 2 temples, second is 3, third is 4 (not sure if those are 100% accurate, because I rarely build many of these things...).

Would I do this:

<PrereqBuildingClasses>
<PrereqBuildingClass>
<BuildingClassType>BUILDINGCLASS_HARBOR</BuildingClassType>
<iNumBuildingNeeded>2</iNumBuildingNeeded>
</PrereqBuildingClass>
</PrereqBuildingClasses>

Then just plug it in somewhere in the Frigates Coding?


This is different from the global limits that spies have, and I can actually think of a few uses for it. So, people in the know, would this work?

I'd test it, but my computer takes so long to load the game I wouldn't find out til next week...

(Thats called hyperbole, and no I don't need a link to Harkonnen's patch :P)
 
No, you cannot just chop and change XMLs, unfortunetely.

You'd have to do something in python I think. You'd check the amount of harbours, and disallowing the production of frigates (maybe by giving/removing an invisable tech, as I'm not sure you can disallow production as such) if you don't have enough.
 
Aeon221 said:
So I would like to use the rolling system that Cathedral's use, where first is 2 temples, second is 3, third is 4 (not sure if those are 100% accurate, because I rarely build many of these things...).

Cathedrals don't do that. Actually, the only thing in the game with scaling requirements like that are golden ages. Cathedrals are always the same number of temples per cathedral on the same map (map size is the determinant, not number of cathedrals built).
 
Back
Top Bottom