Tying units and buildings to specific leaders.

Jheral

Prince
Joined
Apr 29, 2009
Messages
502
I was wondering, how would one go about making certain units leader-specific, rather than civ-specific?

Say, for instance, that you have a civ with three leaders, and you want to make those three leaders each represent a different 'faction' within the civ, each with access to some units or buildings of their own.

Would something like that even be possible?
 
I can think of one way, its not very elegant. Each leader could have a unique trait. The buildings and units could then be tied to the unique trait. I think this would work. Seems like a bit of a crude workaround. Otherwise you might look into how the Scion leaders build their corresponding heroes.
 
For the DIAL mod, Goodreau is getting a unique version of the Museum that enables him to generate Great Prophets for Altar levels.

The way I'm doing this is creating a UB of the Museum that requires his specific trait. However, to do this for leaders with the common traits, such as the Ljosalfar, it would probably need to grab the string with the actual leader in it.

Xivan works similarly, since the Usurper trait allows the Mendactites, so check out that for an example.
 
I think you could probably just create the unit normally, and then disable it via Python for everybody but the specific leader you want it to be tied to. In CvGameUtils, cannotConstruct and cannotTrain will both let you do this. Look to the code for Auric to get a few examples.
 
Back
Top Bottom