AI can't build wonders

Oungawak

Chieftain
Joined
Oct 16, 2010
Messages
5
Hello !

I'm new in modding (I've read one tutorial only...) and I wanted to create a mod so AI players can't build any wonder. The only thing I found is the "WonderCompetitiveness" attribute for leaders so I made this :

AI.xml :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 12/10/2010 20:48:02 -->
<GameData>
    <Leaders>
        <Update>
            <Set WonderCompetitiveness="-200"/>
            <Where />
        </Update>
    </Leaders>
</GameData>

Project properties > Actions :
OnModActivated - UpdateDatabase - AI.xml

But no luck so far. :( Can you help me ?
 
How about putting a location for the Where tag?
 
You might need to put in all the leaders. Try:

Code:
<GameData>
    <Leaders>
        <Update>
            <Where Type="LEADER_ALEXANDER" Type="LEADER_ASKIA"/>
            <Set WonderCompetitiveness="-200"/>
        </Update>
    </Leaders>
</GameData>

Etc, That's only 2 leaders, just keep adding them all, then try.
 
Sorry LoneGamer but it don't works. I read in my tutorial that attributes in the "Where" tag form a AND condition. I thought that if I set nothing it will selects all leaders.

I used the SQL approach too with this SQL file :
Code:
UPDATE Leaders SET 'WonderCompetitiveness' = -200;

But it don't works neighter... :( Maybe "WonderCompetitiveness" isn't the right attribute ?

I'm doing some experiments.
 
Maybe "WonderCompetitiveness" isn't the right attribute ?

That's precisely the problem. WonderCompetitiveness only determines how much the AI hates you if you build wonders. If you want to modify how much they like to build wonders you instead need to change the value of FLAVOR_WONDER (found under leader's flavors).
 
Thank you Nunya ! I haven't found these values. Now my SQL query looks like this :
Code:
UPDATE Leader_Flavors SET Flavor = 0 WHERE FlavorType = "FLAVOR_WONDER";
Zero is the value for barbarians. But it still don't works. I'm thinking about delete these rows directly, but I don't know if it's a good idea, I don't want the game to crash because I removed some important data...

Edit: I used this :
Code:
DELETE FROM Leader_Flavors WHERE FlavorType = "FLAVOR_WONDER";
And AI still builds wonders... :cry:
 
Just update each leader individually with seperate update tags, and it should work. If not, post your code and I'll try to find the problem.
 
Setting flavor_wonder to 0 won't completly stop them from building wonders, but it should make them give it low priority.

Part of the issue is that the leader's traits are somewhat randomized each game. Based on some previous where they said Napoleon has normally an 8 for conquest but in some games it may only be 6 I think it varies by 2 points (up or down). So setting it to 0 might still produce leaders with a 1 or 2 when you actually play the game and they'll nab a few of the early wonders.
 
@Putmalk -> I used this file with "0" and "-10" without success :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 18/10/2010 22:54:51 -->
<GameData>
    <Leader_Flavors>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_HARUN_AL_RASHID" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_GANDHI" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_ELIZABETH" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_DARIUS" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_CATHERINE" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_BISMARCK" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_AUGUSTUS" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_ASKIA" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_ALEXANDER" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_WU_ZETIAN" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_WASHINGTON" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_SULEIMAN" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_RAMKHAMHAENG" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_RAMESSES" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_ODA_NOBUNAGA" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_NAPOLEON" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_MONTEZUMA" />
            <Set Flavor="-10"/>
        </Update>
        <Update>
            <Where FlavorType="FLAVOR_WONDER" LeaderType="LEADER_HIAWATHA" />
            <Set Flavor="-10"/>
        </Update>
    </Leader_Flavors>
    <!--
    LEADER_HARUN_AL_RASHID
    LEADER_GANDHI
    LEADER_ELIZABETH
    LEADER_DARIUS
    LEADER_CATHERINE
    LEADER_BISMARCK
    LEADER_AUGUSTUS
    LEADER_ASKIA
    LEADER_ALEXANDER
    LEADER_WU_ZETIAN
    LEADER_WASHINGTON
    LEADER_SULEIMAN
    LEADER_RAMKHAMHAENG
    LEADER_RAMESSES
    LEADER_ODA_NOBUNAGA
    LEADER_NAPOLEON
    LEADER_MONTEZUMA
    LEADER_HIAWATHA
    -->
</GameData>

@Nunya: In that case, is there a way to strictly forbid wonders to AI ?
 
Try editing CIV5CitySpecializations.xml in the AI folder.

Or GlobalAIDefines.xml, CiV5AIEconomicStrategies.xml

There are specific references to wonders in those files, you may be able to find something.
 
I give up... :( All my attempts haven't produced anything, I just can't figure out how this cursed AI works...

Thank you for your help. ;)
 
Those files didn't help?

Oh well...we all know the AI is psycho. xD
 
Oh my bad on the wonder thing. did you make sure your file is in the actions tab? The OnModActivated UpdateDatabase thing?
 
I think I saw some fragment of xml where the city states were prevented from doing this by manually disallowing them to build each wonder, in the fashion of replacing all the wonders with a blanc UB iirc (instead of adjusting the flavor or other global attribute). I've been looking for the exact file, but sadly I haven't been able to find it again.

Maybe someone else will remember.
 
CIV5Civilizations.xml

Under "CIVILIZATION_MINOR".

This probably won't help with AI, though, because if you disable wonders for all civs, then you disable wonders for yourself as well.
 
Sorry LoneGamer but it don't works. I read in my tutorial that attributes in the "Where" tag form a AND condition. I thought that if I set nothing it will selects all leaders.

I used the SQL approach too with this SQL file :
Code:
UPDATE Leaders SET 'WonderCompetitiveness' = -200;

But it don't works neighter... :( Maybe "WonderCompetitiveness" isn't the right attribute ?

I'm doing some experiments.

It doesn`t seem to work without WHERE (I was trying to use just SET for something else yesterday and got errors) if you want to change everything you could try WHERE ID>=0, assuming there is ID column in the table (there is in Leaders)

Also I think I`ve acctualy seen a file that seems to disable wonders for city states, it tells them that they get unique building instead and doesn`t define bulding

EDIT: It`s in CIV5Civilizations.xml for example:
Code:
		<Row>
			<CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
			<BuildingClassType>BUILDINGCLASS_PYRAMID</BuildingClassType>
			<BuildingType/>
		</Row>
The table you need to update is Civilization_BuildingClassOverrides.
 
This probably won't help with AI, though, because if you disable wonders for all civs, then you disable wonders for yourself as well.
It should as you wouldn`t be taking it away from everyone, but disabling it for certain leaders, one by one... Suggestion to OP - copy code used with BARBARIAN\MINOR and run a find and replace comand on it in notepad (but note that barbs also have palace and national wonders disabled)
 
It should as you wouldn`t be taking it away from everyone, but disabling it for certain leaders, one by one... Suggestion to OP - copy code used with BARBARIAN\MINOR and run a find and replace comand on it in notepad (but note that barbs also have palace and national wonders disabled)

Well unless you're locking yourself into playing one civilization, this will also disable it for yourself.
 
Well unless you're locking yourself into playing one civilization, this will also disable it for yourself.

Oh right *facepalm* but in that case there might be no way to make it absolutely certain that they won`t. I suppose there is no code to detect which civ you play ?
 
Back
Top Bottom