Not really true. Also any effects of social policies, or leader traits, or anything else that the game currently does, which covers a lot of stuff really. If you go digging far enough you can find ways to implement a lot of stuff.
For e.g. our religion mod, or a revolutions mod. They are all, perhaps a few concessions aside, possible with lua. Not saying it's ideal, it's certainly more limited than the SDK in a multitude of ways, but if you go digging it's surprising what's possible. The limitations are mainly things that don't ever happen in the game in any form currently (for e.g. changing the cost of a tech mid-game)
I cant change some basic things with lua like changing food yield from granary for example when you discover a tech, I cant manipulate city output (food, commerce) while the game is running I can only do that in database before the game starts which is very static and limited.
I dont know if someone was able to do that.
if pCity:CountNumBuilding(granaryID) > 0 and lastTimeDidnt and pTeam:HasTech(tech) then
pCity:ChangeBaseYieldRateFromMisc(YieldTypes.FOOD, iAmountToGive)
end
if pCity:CountNumBuilding(granaryID) == 0 and lastTimeDid and pTeam:HasTech(tech) then
pCity:ChangeBaseYieldRateFromMisc(YieldTypes.FOOD, -iAmountToGive)
end
<Technology_BuildingYieldChangeOnTech>
<Row>
<TechType>TECH_FERTILIZER</TechType>
<YieldType>YIELD_FOOD</YieldType>
<Yield>1</Yield>
</Row>
</Technology_BuildingYieldChangeOnTech>
for yieldChanges in GameInfo.Technology_BuildingYieldChangeOnTech("TechType = '"..TestTech.."'") do
end
iYieldType = YieldTypes.YIELD_GOLD;
for pBuilding in GameInfo.Buildings() do
if pBuilding.BuildingClass == "BUILDINGCLASS_MARKET" then
thisBuildingClass = GameInfo.BuildingClasses[pBuilding.BuildingClass];
end
pCity:SetBuildingYieldChange(thisBuildingClass, iYieldType, 1)
end
Man, too complicated for the average player.
I would like to learn how to do an event which triggers on a certain turn#. Like making a carthaginian army appear out of the Alps on turn 30
local barcaplayerid = 63;
local barcacheck = 0;
local MECH = 23;
local ALPSCOORDS = {
somespot = { x = 1, y = 1 },
thisspot = { x = 2, y = 2 },
thatspot = { x = 3, y = 3 },
};
function HANNIBAL ()
if ( barcacheck == 1 ) then return; end
if ( Game.GetGameTurn() == 30 ) then
for k,v in pairs( ALPSCOORDS ) do
Players[ barcaplayerid ] :InitUnit( MECH, ALPSCOORDS[k].x, ALPSCOORDS[k].y );
end
barcacheck = 1;
else
return;
end
end
Events.SpecificCityInfoDirty.Add ( HANNIBAL );
Hmm this is interesting to know. I started adding the events page to the Civ5 wiki, maybe if you have time you can add some stuff to it? Would be useful to have a collection of information about this kind of thing.
http://wiki.2kgames.com/civ5/index.php/Lua_Game_Objects/Events
Does SerialEventEndTurnDirty work as I'd expect it to?
Edit: What does "dirty" mean, anyways? Nvm about the SerialEvent, they are UI, yes?
So it's best to check the turn number etc and keep track of if the function's been called this turn for this city or not, otherwise you could end up with mods calling that event and ending up with twice as many unit spawns or more.
Thanks. So using dirty things is not a good idea... just like IRL
documenting the events on the official wiki?