What does this script mean?

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

Moderators: Slitherine Core, The Lordz

Post Reply
Kossatx
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 144
Joined: Wed Nov 27, 2013 3:27 pm

What does this script mean?

Post by Kossatx » Sat Nov 09, 2019 2:16 pm

Hi again! I'm not sure what this script from Potzblitz mod mean. I don't understand if Entente will deploy reinforcements every turn once "MacedoniaDonation" is triggered :?:

Code: Select all

  --Reinforcements through Saloniki port
  if GetEvent("MacedoniaDonation") ~= game.turn 
	and player.alliance.id == 2 and game.type == Game.TYPE_SINGLE then
		if salonikahex.unit == nil 
			and salonikahex.alliance.id == 1 
			and greece.alliance.id == 0 then
				if (math.random(1,2) == 2 or france.morale < 50)
					and britain.luaData.suezcanalblock == 0
					and (GetEvent("AnzacBeachCaptured") > 0 
						or	GetEvent("VenizelistTriumvirate") >0) then
					SpawnUnit(1, britain, 113, 46, 1, 100)
					britain:ConsumeManpower(15)
					ChangeFactionAlignment(game:GetFactionById(14), greece.alliance, 3)		

				else
						if GetEvent("VenizelistTriumvirate") >0 and france.alliance.id == 1 then
							SpawnUnit(1, france, 113, 46, 1, 100)
							france:ConsumeManpower(15)
							ChangeFactionAlignment(game:GetFactionById(14), greece.alliance, 3)		
							local hex = GetHex(113,46)
							UpdateUnit(hex.unit)
						elseif  france.alliance.id == 1 then
							SpawnUnit(0, france, 113, 46, 1, 100)
							france:ConsumeManpower(10)
							ChangeFactionAlignment(game:GetFactionById(14), greece.alliance, 1)		
									local hex = GetHex(113,46)
									UpdateUnit(hex.unit)
						end
				end
			
		elseif salonikahex.alliance.id == 1 and salonikahex.unit ~= nil and roupel.alliance.id == 2 and  romania.alliance.id == 1 then
			if math.random(1,3) >= 2 then
					  ChangeFactionAlignment(game:GetFactionById(14), greece.alliance, math.random(1,2))		
			end
		
		elseif salonikahex.alliance.id == 1 and salonikahex.unit ~= nil and roupel.alliance.id == 2 and bulgaria.alliance.id == 2 and italy.alliance.id == 1 and romania.alliance.id == 0 then
			if math.random(1,3) == 3 then
					  ChangeFactionAlignment(game:GetFactionById(14), greece.alliance, 1)		
			end
		
		elseif salonikahex.alliance.id == 2 and roupel.alliance.id == 2 and bulgaria.alliance.id == 2 and italy.alliance.id == 1 and romania.alliance.id == 1 then
			if math.random(1,6) == 6 then
					  ChangeFactionAlignment(game:GetFactionById(14), greece.alliance, 1)		
			end	

		
		end
  end
end

Robotron
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1247
Joined: Tue Nov 23, 2010 3:35 pm

Re: What does this script mean?

Post by Robotron » Sat Nov 09, 2019 2:55 pm

Each turn one Entente unit will spawn in Salonika as long as the city is controlled by Entente under the following conditions:

1."Macedonian Donation" event must have happened
2. there is no unit on the Salonika city hex
3. Greece is still neutral


a British Army Corps will spawn at Salonika with a 50% chance if

1. the Suez canal is not blocked by CP and
2. French morale is lower than 50 and
3. either the event "Venizelist Triumvirate" has happened or Anzac Beach was captured by CP

Greek alignment will then shift 3 points further to Entente.

if the conditions for a British unit are NOT fulfilled then instead a French Army Corps will be spawned at Salonika if

1. the event "Venizelist Triumvirate" has already happened

Greek alignment will then shift 3 points further to Entente.

if the event "Venizelist Triumvirate" has NOT happened before then only a French Reserve Corps will be spawned at Salonika

Greek alignment will then shift 1 point further to Entente.

---------------------------------------------------------------------------------------------------------------------------

If there is already an Entente unit at Salonika and

1. Fort Roupel was captured by CP and
2. Romania has joined Entente

then there's a 66% chance per turn for Greek alignment to shift 1 or 2 points toward Entente.

If there is already an Entente unit at Salonika and

1. Fort Roupel was captured by CP and
2. Bulgaria has joined CP and
3. Romania is neutral and
4. Italy has joined Entente

then there's a 33% chance per turn for Greek alignment to shift 1 point toward Entente.

If Salonika was captured by CP and

1. Fort Roupel was captured by CP and
2. Bulgaria has joined CP and
3. Romania has joined Entente and
4. Italy has joined Entente


then there's a 17% chance per turn for Greek alignment to shift 1 point toward Entente.
Slitherine's Commander the Great War on steroids: POTZBLITZ mod!
http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610

Kossatx
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 144
Joined: Wed Nov 27, 2013 3:27 pm

Re: What does this script mean?

Post by Kossatx » Sat Nov 09, 2019 5:27 pm

Thanks again, and again, and again, and again, and again... :D

Robotron
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1247
Joined: Tue Nov 23, 2010 3:35 pm

Re: What does this script mean?

Post by Robotron » Sat Nov 09, 2019 6:45 pm

You're welcome, I'm always happy to help.
Slitherine's Commander the Great War on steroids: POTZBLITZ mod!
http://www.slitherine.com/forum/viewtopic.php?f=218&t=77884&p=662610#p662610

Post Reply

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