Limiting Units

razzach

Warlord
Joined
Mar 14, 2009
Messages
125
How can I limit units that can be built by a certain leader using python? What functions/python file should I look at? Thanks! :)

Also, how does the StrBoost function work in python? :)

Lastly, I'm interested in the python code for weather - slowly terraforming the tiles around a given improvement. Where can I see this Valk? :lol:
 
How can I limit units that can be built by a certain leader using python? What functions/python file should I look at? Thanks! :)

Also, how does the StrBoost function work in python? :)

Lastly, I'm interested in the python code for weather - slowly terraforming the tiles around a given improvement. Where can I see this Valk? :lol:

To limit what can be built in a city, go to CvGameUtils.py. You can use either CanTrain() or CannotTrain(), just keep in mind which one you're in; In the first, returning true allows it, in the second returning true blocks it.

StrBoost is pretty simple... Following code comes from CvEventManager, OnProjectCompleted, for the White Hand ritual.
Code:
newUnit1.changeStrBoost(1)

By weather, do you mean the autoterraforming? That's done in the DLL, python isn't touched. In fact, as of now python CAN"T touch the climate system, but that should be added in the next version.
 
By weather, do you mean the autoterraforming? That's done in the DLL, python isn't touched. In fact, as of now python CAN"T touch the climate system, but that should be added in the next version.

I think what he means is: he's going to expose the DLL to python :)
But I'm not sure :p
 
Back
Top Bottom