How does the surrender mechanism work?

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
Solaristics
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 109
Joined: Sun Nov 15, 2009 10:17 am

How does the surrender mechanism work?

Post by Solaristics » 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)

Solaristics
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 109
Joined: Sun Nov 15, 2009 10:17 am

Re: How does the surrender mechanism work?

Post by Solaristics » Sat Apr 09, 2016 10:52 pm

Well, answered my own question: capture Paris, hit next turn, then run another turn and the surrender offer is made.

Post Reply

Return to “Commander the Great War : Mods & Scenario Design”