Turn off the AI building wonders?

StMikael

Warlord
Joined
Oct 9, 2005
Messages
137
Location
Prussia
I may have mentioned this before, but here goes:

In the CIV4LeaderHeadInfos.xml file there is, for every leader, a tag <iWonderConstructRand> followed by a number. The number is 0 for the Barbarian leader and greater than zero for everyone else. Does anyone know what it means?

I thought that this number indicated the particular leader's penchant for constructing wonders, but even though I set the number to 0 for all the other leaders, they still construct wonders.

On a sidenote: Is there any other way to turn off the AI building wonders?

Ah, the days of the Civ III Editor ...
 
Yes, I would like this too, please. That would be perfect for wonder-addict[ion game]s.

So, how's it done? How does one prevent the AI from building any wonders (without building them yourself)? And no, setting max_wonders_per_city (or w/e it's called) to 0 isn't good enough!

That would be most appreciated!

~ Kris
 
Well, it is possible to make a civ unable to build a specific building. If you look at the barbarian civ in civ4civilizationinfos, you will see a list of building classes with type defined as "NONE". This part ensures that the barbarians don't build a palace or temples or various wonders. You can set the same thing for any civ. In the barbarian civ is a complete list of all the wonders, so you can copy and paste it (making sure to add the opening and closing tags, <buildings> and </buildings>) and add that to any of the civs.

Ah, the days of the Civ III Editor ...

Yeah, well, a while back I used to say the same thing about the CivII Editor. See:

http://forums.civfanatics.com/showthread.php?t=94155

When Civ3 came out, at first I was saying how frustrating it was to have to mess around with all the folders and text files (in civ2 you could do everthing from within the editor).

Once you get used to civ4 modding, it is just as easy, and far more flexible.
 
That isn't really a proper solution, now is it?

We need to prevent the AI from building any wonders - not disable a certain civilization from wonder building. That's a 'fulhack' and it's incredibly bothersome.
 
For that, you'd need a python mod at the least. I don't imagine there's a huge demand for this sort of thing, because it's not really a proper mod; it's more like just a cheat, with the AI crippled.
 
you can do like this with python . Create your own MOD with these two files modifed , or copy them in the custom assets folder (my documents . In this case be careful when you play with a mod . It's better to create your own mod)

if you play with BtS , change that in 'PythonCallbackDefines.xml' :

Code:
		<DefineName>USE_CANNOT_CONSTRUCT_CALLBACK</DefineName>
		<iDefineIntVal>1</iDefineIntVal>

and add this code to 'CvGameUtils.py' in 'def cannotConstruct' (not tested):

Code:
        def cannotConstruct(self,argsList):
                pCity = argsList[0]
                eBuilding = argsList[1]
                bContinue = argsList[2]
                bTestVisible = argsList[3]
                bIgnoreCost = argsList[4]

                if gc.getBuildingClassInfo(gc.getBuildingInfo(eBuilding).getBuildingClassType()).getMaxGlobalInstances() != -1 :
                        if not pCity.isNone() :
                                if not gc.getPlayer(pCity.getOwner()).isHuman() :
                                        return True
                return False

Tcho !
 
Wonderful. Let's try this. Next game.
 
I've been trying to do this myself recently.

My only attempt so far was to copy the bits from the Barbarian section to all of the playable civs. It stopped them from building wonders, but it also caused some loading issues which required a system restart from time to time.

Could altering the Industrious trait possibly prevent the AI from building World Wonders? The Industrious trait gives a 50% increase in production of wonders, so would changing those "50"s into "-1"s mean the AI can't build World Wonders? I don't want to stop them building National Wonders though.

If this could work, maybe a new trait could be created and added to all of the AI leaders, then the now defunct Industrious trait could be replaced with another already existing trait.

Just a thought. :)

EDIT

Never mind. It didn't work. :(
 
I can't find where the leader traits are located but I think I know why it did not work for you.
If the Industrious trait gives a +50% for wonders, and is defined in the XML as simply "50", than entering "-1" will only give the leader -1% for wonder production. Try something like "-100000000".
That should put it at 10^6 times slower, they should still build wonders but newer have a chance of finishing them.
 
Oh yeah. I didn't think of it like that.

I'll give that a go when I get chance. Thanks. :)
 
Just make sure to post back here with the results.
 
I've tried this now. Sorry I've been so long. I took a short break from the game to concentrate on my studies.

Negative numbers don't seem to affect the build rates of the wonders, so I've put two 0s on the end of each wonder's iCost and changed the Industrious trait to give a bigger bonus. I've also changed the traits of any leaders that have Industrious as standard.

This does work. :)
 
Back
Top Bottom