How to bring the AI to build specific unit? (BtS)

[WTN]Manhattan

Chieftain
Joined
May 13, 2004
Messages
83
Location
Munich, Germany
I'm trying to focus the AI to build more units of a specific type (using BtS), depending on the Leader/Civ. For example, the AI of Leader A builds more air units, while the AI of Leader B prefers to build nukes. This should not mean the AI exclusively build that type of unit, just more than other types.

Can this be done with xml or is SDK/Phyton needed? It whould help already to know how to modify the AI preference of building units in general, not for each leader. For example to focus the AI in general on building ships etc.
 
I know that this can be done with flavors.

For example: Leader A is flavor 1
Leader B is flavor 2

Then you can set flavor 1 for all air units and flavor 2 for nukes.

Sort of. Its difficult, because the flavors are'nt numbers, they are FLAVOR_SCIENCE, FLAVOR_ESPIONAGE, FLAVOR_MILITARY, etc; so youll need to do some shoehorning.

This can be done, just go to the civ4LeaderHeadInfo and Civ4UnitsInfo and Cntrl-F Flavor.
 
You can always make new flavors. For example in my mod I added a Flavor Government. It's not that hard and only needs you to define it in the GlobalDefines XML.

If you are ambitious enough make a flavor for each leader and then define their own build patterns based on it.
 
Shouldn't it be the GlobalTypes.xml? In the GlobalDefines.xml I can't find any entries about flavors. So adding the flavor in the Global...xml and in the UnitInfos.xml and CIV4LeaderHeadInfo.xml is enough and the AI recognizes the flavors?
 
[WTN]Manhattan;7701334 said:
Shouldn't it be the GlobalTypes.xml? In the GlobalDefines.xml I can't find any entries about flavors. So adding the flavor in the Global...xml and in the UnitInfos.xml and CIV4LeaderHeadInfo.xml is enough and the AI recognizes the flavors?

You're right it's GlobalTypes (was commenting from memory and knew it was one of the files in that location, sorry for the miscommunication). And yes, as long as you add it to that file, adding it anywhere else (units, technologies, buildings, leaders, etc) the game will associate it.
 
Top Bottom