I never actually made the code. But I promise that the next new civ will be making use of that (it fits the leader so much better than Switzerland). However, you don't need to wait for me - you can just have a look at the TurnsRemaining.lua in the Scramble for Africa scenario (assuming you have it); where war is prohibited between civ groups (European, Sub-Saharan and Northern African)
EDIT: It's just a CanDeclareWar event - but I expect that it's only for BNW. An example from the Scramble for Africa scenario:
Code:
GameEvents.CanDeclareWar.Add(function(myTeam, theirTeam)
local myPlayer = -1;
local theirPlayer = -1;
for iLoopPlayer = 0, GameDefines.MAX_CIV_PLAYERS-1, 1 do
local pLoopPlayer = Players[iLoopPlayer];
if (pLoopPlayer:GetTeam() == myTeam) then
myPlayer = iLoopPlayer;
end
if (pLoopPlayer:GetTeam() == theirTeam) then
theirPlayer = iLoopPlayer;
end
if (myPlayer ~= -1 and theirPlayer ~= -1) then
break;
end
end
local bIAmEuropean = false;
local bTheyAreEuropean = false;
local bIAmNAfrican = false;
local bTheyAreNAfrican = false;
if (myPlayer == Belgium_PlayerID or myPlayer == France_PlayerID or myPlayer == England_PlayerID or
myPlayer == Germany_PlayerID or myPlayer == Italy_PlayerID or myPlayer == Portugal_PlayerID) then
bIAmEuropean = true;
end
if (theirPlayer == Belgium_PlayerID or theirPlayer == France_PlayerID or theirPlayer == England_PlayerID or
theirPlayer == Germany_PlayerID or theirPlayer == Italy_PlayerID or theirPlayer == Portugal_PlayerID) then
bTheyAreEuropean = true;
end
if (myPlayer == Egypt_PlayerID or myPlayer == Morocco_PlayerID or myPlayer == Ottoman_PlayerID) then
bIAmNAfrican = true;
end
if (theirPlayer == Egypt_PlayerID or theirPlayer == Morocco_PlayerID or theirPlayer == Ottoman_PlayerID) then
bTheyAreNAfrican = true;
end
-- N. African on N. African?
if (bIAmNAfrican and bTheyAreNAfrican) then
return false;
end
-- European on European?
if (bIAmEuropean and bTheyAreEuropean) then
return false;
end
return true;
end);