For great people the AI only ever considers what the great people can do, like create a great work, and if they can't do that at that moment then as I recall they will only ever consider whether they can use them to create a Holy Site, or an Academy, or what-have-you.
See, this is half the battle... trying to figure out whether the AI will actually take advantage of your abilities. Do you think it's possible (or worth it) to write lua to force the non-human players to garrison the Griot?
And no there aren't any flavors to assign to a unit to make the AI want to use them as a garrison more than they would otherwise except for the basic Defense flavoring.
Is it possible to flavour the Griot in 100 defense that way like a combat unit? So long as the AI at least considers garrisoning a Griot - I'm not expecting them to garrison it throughout the whole game, just when it seems appropriate.
Also, what are using to make the building bump the city's tourism by 10% ?
Not sure if it would work, but I added a "<GreatWorksTourismModifier>10</GreatWorksTourismModifier>" row that I pilfered from the Hotel.xml (which is 50 instead) to the Griot Dummy Building. Given that tourism seems to only be displayed as full integers, rather than decimals, I wasn't sure if 10% was appropriate.
Also, was this what you were thinking when discussing a condensed 'PlayerDoTurn' function?:
Code:
function UUBoosts(iPlayer)
local pPlayer = Players[iPlayer]
if pPlayer:GetCivilizationType() == senegal ID then
for pCity in pPlayer:Cities() do pCity:GetGarrisonedUnit() then
for pUnits in pPlayer:Units() do
if pUnit:GetUnitType() == griotID then
pCity:SetNumRealBuilding(griDummyBID, 1)
else
pCity:SetNumRealBuilding(griDummyBID, 0)
if pUnit:GetUnitType() == gendarmerieID then
pCity:SetNumRealBuilding(genDummyBID, 1)
else
pCity:SetNumRealBuilding(genDummyBID, 0)
end
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(UUBoosts)
Alternatively, I have also written this as well to satisfy not using GetGarrisonedUnit() instead:
Code:
function UUBoosts(iPlayer)
local pPlayer = Players[iPlayer]
if pPlayer:GetCivilizationType() == senegal ID then
for pCity in pPlayer:Cities() do
for pUnit in pPlayer:Units() do
if pUnit:GetX() == pCity:GetX() and pUnit:GetY() == pCity:GetY() then
if pUnit:GetUnitType() == griotID then
pCity:SetNumRealBuilding(griDummyBID, 1)
else
pCity:SetNumRealBuilding(griDummyBID, 0)
if pUnit:GetUnitType() == gendarmerieID then
pCity:SetNumRealBuilding(genDummyBID, 1)
else
pCity:SetNumRealBuilding(genDummyBID, 0)
end
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(UUBoosts)