Event "Mutiny of french army" not working correctly?
Posted: Tue Aug 25, 2015 3:41 pm
From what I learned so far by looking at the "game_events.lua" file this event is supposed to trigger as early as 1917 while french morale has sunk below 50 and manpower being lower than 500.
The result of this event is supposed to disallow all french units to perform an attack during that turn (unit.ap = 0).
When I tested this by playing the Entente and changing the required year to 1914 and commenting out the other two checks for morale and manpower all french units still could attack without problems.
So I suspect that either
a) my understanding of unit.ap = 0 is not what I suspected it to be, namely disallowing to execute an attack.
or
b) calls to functions in other scripts have been changed since the french Mutiny event was included, thus unit.ap = 0 isn't working anymore like it was originally intended.
or
c) it is just not sufficient to set unit.ap to 0 to prevent a unit from attacking, so the event has never been working correctly in the first place.
Any thoughts on this?
By the way: I also expected setting unit.mp ("movement points", which is not used in this example but in the "Kiel" and "Wilhelmshafen"-Mutiny Events) to "= 0" should(?) prevent a unit from moving by reducing it's movemt-allowance to zero. So I tried to apply "unit.mp = 0" in this event too but here I seemed to be wrong again, because all french units got to move their normal allowance.
The result of this event is supposed to disallow all french units to perform an attack during that turn (unit.ap = 0).
Code: Select all
-- Mutiny of french army
function FrenchMutiny()
if GetEvent("FrenchMutiny") == 0 then
local france = game:GetFactionById(0)
if game.date.year >= 1917 and france.morale < 50 and france.mp < 500 then
SetEvent("FrenchMutiny", game.turn)
for unit in france.units do
unit.ap = 0
end
end
end
endSo I suspect that either
a) my understanding of unit.ap = 0 is not what I suspected it to be, namely disallowing to execute an attack.
or
b) calls to functions in other scripts have been changed since the french Mutiny event was included, thus unit.ap = 0 isn't working anymore like it was originally intended.
or
c) it is just not sufficient to set unit.ap to 0 to prevent a unit from attacking, so the event has never been working correctly in the first place.
Any thoughts on this?
By the way: I also expected setting unit.mp ("movement points", which is not used in this example but in the "Kiel" and "Wilhelmshafen"-Mutiny Events) to "= 0" should(?) prevent a unit from moving by reducing it's movemt-allowance to zero. So I tried to apply "unit.mp = 0" in this event too but here I seemed to be wrong again, because all french units got to move their normal allowance.