Yeah, that worked like a charm, thanks a bunch.
My next problem: I want to set up an event that drops german morale by ten points if Paris isn't conquered by turn 13 (called the "Moltke"-event, because Chief of Staff General Moltke got sacked after being unable to conquer Paris in time).
This event should be triggered if the Paris-Hex (x82,y30) does NOT belong to germany at the start of turn #13 (the first turn of winter in 1914).
However, this code which I thought should be doing the trick only leads to a crash to desktop...I wonder why?
Code: Select all
function Moltke(hex)
if GetEvent("Moltke") == 0 then
if hex.x == 82 and hex.y == 30 and hex.faction.alliance.id ~= 2 then
if game.turn == 13 then
SetEvent("Moltke", game.turn)
local germany = game:GetFactionById(2)
ChangeFactionMorale(germany, -10)
end
end
end
end