Help : an improvement that makes terrain impassable

Fabrysse

Charming-snake learner
Joined
Sep 11, 2006
Messages
430
Location
Toulouse - France
Hi,
I don't know if it's possible. And I don't know how to do that.
So I ask... :mischief:

I want the worker unit to be able to create a new improvement that makes the terrain impassable for other units. Of course, a worker unit could destroy this improvement too.
I want to do that without SDK modif (only XML & Python).

Is it possible ? How ? :confused:

Thanks for your help.
 
I think you should ask Jeckel...

I already ask Jeckel a lot of things, because I use several of his ModComps !! :king:

Thanks for the idea. I'm going to download his ModComp and have a look at his python files...
 
There is a python function in CvGameUtils.py called unitCannotMoveInto that will do what you want. Of course you will need to enable the function in PythonCallbackDefines.xml before it will start working.

Once this function is enabled it will kick off everytime the AI considers a plot for movement. So it is a relativly expensive function to use so use it sparingly.
 
There is a python function in CvGameUtils.py called unitCannotMoveInto that will do what you want. Of course you will need to enable the function in PythonCallbackDefines.xml before it will start working.

Once this function is enabled it will kick off everytime the AI considers a plot for movement. So it is a relativly expensive function to use so use it sparingly.

Yes, I've found the function in CvGameUtils.py
Thanks for the other infos. I'll try that it game. What do you think it could happen ? The game will go slowly ?
 
Back
Top Bottom