How does the surrender mechanism work?
Posted: Sat Apr 09, 2016 10:37 pm
Hi, I've been messing around with the morale loss France gets when Paris falls as part of some modding I'm doing, but no matter how high I set it I can't trigger a surrender.
The parameter is in the game_events.lua, ChangeFactionMorale(france, -[positive integer]), and I've tired a range of numbers, including some very high ones. When Paris is captured, the event fires, but France is still in the game the next turn. Is there something I'm missing here, such as a delay or a RND?
-- Paris captured
function ParisCaptured(hex)
if GetEvent("ParisCaptured") == 0 then
if hex.x == 82 and hex.y == 30 then
if hex.faction.alliance.id == 2 then
SetEvent("ParisCaptured", game.turn)
local france = game:GetFactionById(0)
ChangeFactionMorale(france, -1500)
The parameter is in the game_events.lua, ChangeFactionMorale(france, -[positive integer]), and I've tired a range of numbers, including some very high ones. When Paris is captured, the event fires, but France is still in the game the next turn. Is there something I'm missing here, such as a delay or a RND?
-- Paris captured
function ParisCaptured(hex)
if GetEvent("ParisCaptured") == 0 then
if hex.x == 82 and hex.y == 30 then
if hex.faction.alliance.id == 2 then
SetEvent("ParisCaptured", game.turn)
local france = game:GetFactionById(0)
ChangeFactionMorale(france, -1500)