List of Events

PC/MAC : Commander the Great War is the latest release in the popular Commander series to bring the thrill, excitement and mind-breaking decision making of these difficult times to life.

Moderators: Slitherine Core, The Lordz

Robotron
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2151
Joined: Tue Nov 23, 2010 3:35 pm

Re: List of Events

Post by Robotron »

operating wrote:Hello Robotron,

Question: Can the February Revolution happen before Feb. 1917? Also, if Russia's NM is below 50 NM, what happens then, if anything? I'm not sure if a minimum of 50 NM is required for this to kick in. What if it is 60 NM?

February revolution
function FebruaryRevolution()
if GetEvent("FebruaryRevolution") == 0 and GetEvent("OctoberRevolution") ~= 0 then
if game.date.year >= 1917 then
local russia = game:GetFactionById(4)
if russia.morale < 50 then
SetEvent("FebruaryRevolution", game.turn)
ChangeFactionMorale(russia, 20)
end
end
end
end
Hi operating. I'll give you a detailed line by line description of this event:

Code: Select all

function FebruaryRevolution()
The name of the function which triggers the "February Revolution" event.

Code: Select all

  if GetEvent("FebruaryRevolution") == 0 and GetEvent("OctoberRevolution") ~= 0 then
This event will trigger if the event "February Revolution" has not been triggered before and the event "October Revolution" has either already happened or has been canceled before. Note that this of course unhistorical as the February Revolution has of course happended BEFORE the October Revolution and not vice versa. This is a bug and was changed in PotzBlitz. You can change it yourself easily by changing the "~= 0" to "== 0".

Code: Select all

    if game.date.year >= 1917 then
The earliest date possible for this event to trigger: 1917, so this theoretically could be as soon as the first half of January 1917

Code: Select all

      local russia = game:GetFactionById(4)
tell the game who "russia" actually is: namely the faction with the index number 4 (France is 0, Britain is 1, Germany is 2, Austria is 3, Turkey is 5, Belgium is 6 etc., also see: "factions.lua")

Code: Select all

      if russia.morale < 50 then
The second prerequisite: as soon as Russia's morale is below 50, THEN:

Code: Select all

        SetEvent("FebruaryRevolution", game.turn)
trigger the "February Revolution" event and assign the number of the current gameturn to the event for later reference

Code: Select all

        ChangeFactionMorale(russia, 20)
raise Russian morale by 20

Code: Select all

      end
    end
  end
end
These "ends" just close the preceding "if" statements.

Hope this helps.

P.S: the game never shows the correct "internal" morale level of the factions in your alliance, the values are the ones from the LAST turn, not the current turn. This was changed in PotzBlitz. ;)
nehi
1st Lieutenant - Grenadier
1st Lieutenant - Grenadier
Posts: 794
Joined: Sat Oct 17, 2015 1:51 pm

Re: List of Events

Post by nehi »

so only way to trigger february revolution is to avoid october one? because i never saw february, if some then just october and russian surrender
Robotron
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2151
Joined: Tue Nov 23, 2010 3:35 pm

Re: List of Events

Post by Robotron »

The bug will prevent the February Revolution from ever happening at all since the October Revolution will always trigger before, thus reducing Russian morale enough to kick out Russia before the February Revolution has had a chance to happen.

Change the "~= 0" to "== 0" in this line :

Code: Select all

if GetEvent("FebruaryRevolution") == 0 and GetEvent("OctoberRevolution") ~= 0 then
so it reads:

Code: Select all

if GetEvent("FebruaryRevolution") == 0 and GetEvent("OctoberRevolution") == 0 then
to fix the bug.
operating
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 511
Joined: Tue Nov 25, 2008 5:36 pm

Re: List of Events

Post by operating »

nehi wrote:so only way to trigger february revolution is to avoid october one? because i never saw february, if some then just october and russian surrender
I can see now what Robotron is talking about, although he does a magnificent job explaining this stuff to us.
-- October revolution
function OctoberRevolution()
if GetEvent("OctoberRevolution") == 0 then
if game.date.year >= 1917 then
local russia = game:GetFactionById(4)
if russia.morale <= 40 then
SetEvent("OctoberRevolution", game.turn)
ChangeFactionMorale(russia, -40)
end
end
end
end
nehi
1st Lieutenant - Grenadier
1st Lieutenant - Grenadier
Posts: 794
Joined: Sat Oct 17, 2015 1:51 pm

Re: List of Events

Post by nehi »

unfortunately october revolution is the greatest part of my magnificent mp cp turnabout in 1917 scenario :lol:
operating
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 511
Joined: Tue Nov 25, 2008 5:36 pm

Re: List of Events

Post by operating »

Like you, I get these sudden Russian surrender offers that did not make a hell of a lot of sense to me till reading Robotron's explanation, before that, I was scratching my head as to the reason why? For it seemed the reason why opnn had lost in our previous match. :|
nehi
1st Lieutenant - Grenadier
1st Lieutenant - Grenadier
Posts: 794
Joined: Sat Oct 17, 2015 1:51 pm

Re: List of Events

Post by nehi »

operating wrote:Like you, I get these sudden Russian surrender offers that did not make a hell of a lot of sense to me till reading Robotron's explanation, before that, I was scratching my head as to the reason why? For it seemed the reason why opnn had lost in our previous match. :|
but he left in 1916... it wasnt such case
Robotron
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2151
Joined: Tue Nov 23, 2010 3:35 pm

Re: List of Events

Post by Robotron »

One more thing:

It is theoretically possible that after a catastrophic Russian morale loss (for example by losing Petersburg or Moscow while an Entente ally is knocked out the same turn etc.) the morale gain by the February Revolution might be insufficient to prevent the October Revolution from getting triggered the very same turn.

In case you want to prevent such a "domino" effect, change the OctoberRevolution event in the following way.

Code: Select all

function OctoberRevolution()
if GetEvent("OctoberRevolution") == 0 and GetEvent("FebruaryRevolution")>0 and GetEvent("FebruaryRevolution") ~= game.turn then
if game.date.year >= 1917 then
local russia = game:GetFactionById(4)
if russia.morale <= 40 then
SetEvent("OctoberRevolution", game.turn)
ChangeFactionMorale(russia, -40)
end
end
end
end
This will ensure the October Revolution will at least not happen the very same turn (but likely the turn after that). To give the Russians a breather before the October Revolution deals the final k.o., change the second line:

Code: Select all

if GetEvent("OctoberRevolution") == 0 and GetEvent("FebruaryRevolution")>0 and GetEvent("FebruaryRevolution") + X <= game.turn then
where +X represents the number of turns you deem appropriate to pass before the OctoberRevolution kicks in, for example:

Code: Select all

if GetEvent("OctoberRevolution") == 0 and GetEvent("FebruaryRevolution")>0 and GetEvent("FebruaryRevolution") + 16 <= game.turn then
will require 16 turns (8 months) to pass after the February Revolution has happened before the October Revolution will be checked.

You can also randomize the number of turns by using the random-function. For example:

Code: Select all

if GetEvent("OctoberRevolution") == 0 and GetEvent("FebruaryRevolution")>0 and GetEvent("FebruaryRevolution") + math.random(x,y) <= game.turn then
where math.random(x,y) stands for the minimum(x) and maximum(y) amount of turns that must have passed. For example:

Code: Select all

if GetEvent("OctoberRevolution") == 0 and GetEvent("FebruaryRevolution")>0 and GetEvent("FebruaryRevolution") + math.random(2,20) <= game.turn then
will ensure the October Revolution will be randomly checked each turn as soon as 2 or as late as 20 turns have passed.

Have fun experimenting. ^^
Post Reply

Return to “Commander - The Great War”