AI only buildings ??

DivineWind

Chieftain
Joined
Mar 12, 2011
Messages
10
I've searched everywhere with no luck, so….

1) Is there a way to make a building for the AI only?

2) Is there a way to give the AI a regular building for free, but the human player still has to build it at full price?

Trying to make the AI more challenging. Answers greatly appreciated :)
 
Sure, using LUA.

This will go through every city for every player EXCEPT player 0 (the human player) and add a free monument:
Code:
	for iPlayerLoop = 1, GameDefines.MAX_MAJOR_CIVS-1, 1 do
		local pPlayer = Players[iPlayerLoop];
		if (pPlayer:IsAlive()) then
			for pCity in pPlayer:Cities() do
				City:SetNumRealBuilding(GameInfoTypes["BUILDING_MONUMENT"], 1);
			end		
		end
	end

The question is when to run it. I guess it could run every turn without ill effect, but that's not good practice, and the game is slow enough in the late game as it is. There's some discussion of detecting city founding here.
 
The question is when to run it.


Thanks Nutty!

I know Sql/Xml well, but I am a Lua noob.
I have copied Lua files into my mod but have never written one. Since I cannot get this to run even on the first few turns of the game, I guess I need to do something within the file to activate it ???
 
Back
Top Bottom