View Full Version : [Need Python/SDK Help] City Build list


GIR
Aug 26, 2007, 06:48 AM
I have a little problem with Mod:

I would like to prevent my City from the ability to build certain Buildings in certain circumstances (e.g. I want to create a new Wonder that gives you a chance to get a UB instead of the standard Building if you build a City Improvement in this City. This works with a python code that replaces the e.g. Walls with the Dun. Now I have the problem that after this replacement I’m able to build the Walls again. Is it possible to prevent my City from building the Walls again if it already has a foreign UB of the same kind?)

Thx for reading

frenchman
Aug 26, 2007, 12:17 PM
I have a little problem with Mod:

I would like to prevent my City from the ability to build certain Buildings in certain circumstances (e.g. I want to create a new Wonder that gives you a chance to get a UB instead of the standard Building if you build a City Improvement in this City. This works with a python code that replaces the e.g. Walls with the Dun. Now I have the problem that after this replacement I’m able to build the Walls again. Is it possible to prevent my City from building the Walls again if it already has a foreign UB of the same kind?)

Thx for reading

Hello,

Have you try to declare the UB in the civilization XML file?
I think it is perhaps a question of Building Class...

EmperorFool
Aug 27, 2007, 02:19 AM
Take a look at canConstruct and cannotConstruct inside CvGameUtils. They allow you to override the DLL logic. If you use them, make sure to enable whichever one you use in PythonCallbackDefines.xml.

GIR
Aug 27, 2007, 09:35 PM
Take a look at canConstruct and cannotConstruct inside CvGameUtils. They allow you to override the DLL logic. If you use them, make sure to enable whichever one you use in PythonCallbackDefines.xml.

oh thx a lot!!
i will try it tomorrow
maybe i will need some help, but we will see ;)

GIR
Aug 28, 2007, 10:29 PM
yes, now it works :)

mod can be found here:
http://forums.civfanatics.com/showthread.php?p=5883466#post5883466