Page 1 of 1

Event "Mutiny of french army" not working correctly?

Posted: Tue Aug 25, 2015 3:41 pm
by Robotron
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).

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
end
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.

Re: Event "Mutiny of french army" not working correctly?

Posted: Mon Sep 07, 2015 11:34 am
by Sabratha
Yeah, was wondering about taht as well. Certainly I've not observed any effects of this event on gameplay.

Re: Event "Mutiny of french army" not working correctly?

Posted: Mon Feb 22, 2016 1:35 am
by mpetri
I've never seen this event fire before? What does it do?

Re: Event "Mutiny of french army" not working correctly?

Posted: Mon Feb 22, 2016 8:30 am
by operating
It has no effect on game play as far as I can tell. However if you look in the lua files under Events there maybe a detailed description...

Re: Event "Mutiny of french army" not working correctly?

Posted: Mon Feb 22, 2016 2:44 pm
by operating
mpetri wrote:I've never seen this event fire before? What does it do?
Below is the lua script for French Mutiny:
-- 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
end
Near as I can tell; French NM (National Morale) takes a 50 point loss and I believe a 500 MP (Man Power) loss, which could represent desertions and those who refuse to join the French army, or something along those lines...

Re: Event "Mutiny of french army" not working correctly?

Posted: Mon Feb 22, 2016 4:28 pm
by Robotron
As I explained in the opening post, the event is supposed to deny any french unit the possibility to attack for one turn IF it's 1917 or later AND the french moral level drops below 50 AND the manpower reserve is down to 500.

But, for reasons yet unknown, this does not happen. Even with all the conditions met, the french can still attack. Setting "ap" (which is the stat normally used to see, if a unit has already attacked) to zero does exactly zilch.

Re: Event "Mutiny of french army" not working correctly?

Posted: Mon Feb 22, 2016 4:41 pm
by operating
Whoops! Did not see your opening post... :oops: