sampedestal
Warlord
Is this possible? DeclareWar() doesn't seem to work for Minor Civs.
Is this possible? DeclareWar() doesn't seem to work for Minor Civs.
[C]: ?Runtime Error: [string "Assets\Maps\NOVAL_LIGA_v4_3.lua"]:2179: attempt to call method 'declareWar' (a nil value)
stack traceback:
[string "Assets\Maps\NOVAL_LIGA_v4_3.lua"]:2179: in function 'StartPlotSystem'
[string "Assets\Gameplay\Lua\MapGenerator.lua"]:811: in function <[string "Assets\Gameplay\Lua\MapGenerator.lua"]:775>
Is this possible? DeclareWar() doesn't seem to work for Minor Civs.
playerteam:DeclareWar( otherplayerteam, true )
local player1 = Players[player1_ID];
local playerteam = player1:GetTeam();
local player2 = Players[player2_ID];
local otherplayerteam = player2:GetTeam();
playerteam:Meet( otherplayerteam, true );
playerteam:DeclareWar( otherplayerteam, true );
print(">>>> DeclareWar");
local player1 = Players[0];
local playerteam_ID = player1:GetTeam();
local playerteam = Teams[playerteam_ID];
local playerAI = Players[1];
local otherplayerteam_ID = playerAI:GetTeam();
local otherplayerteam = Teams[otherplayerteam_ID];
otherplayerteam:Meet( playerteam, true );
playerteam:Meet( otherplayerteam, true );
otherplayerteam:DeclareWar( playerteam, true );
otherplayerteam:SetPermanentWarPeace(playerteam, true);
btw, does the SetPermanentWarPeace function works now ?
-----------------------------------------------------------------------------------
------------------------------PermanentWarPeace------------------------------------
-----------------------------------------------------------------------------------
local PermanentWar_useroption = Map.GetCustomOption(8);
if PermanentWar_useroption == 1 then
ScripSetText = ScripSetText .. " PermanentWar=ON" ;
local player1 = Players[0];
local playerAI = Players[1];
if ( playerAI:IsHuman() == false ) then
local playerteam_ID = player1:GetTeam();
local playerteam = Teams[playerteam_ID];
local otherplayerteam_ID = playerAI:GetTeam();
local otherplayerteam = Teams[otherplayerteam_ID];
if playerteam_ID ~= otherplayerteam_ID then
otherplayerteam:Meet( playerteam, true );
playerteam:Meet( otherplayerteam, true );
otherplayerteam:DeclareWar( playerteam, true );
playerteam:DeclareWar( otherplayerteam, true );
[B] otherplayerteam:SetPermanentWarPeace(playerteam, true);
playerteam:SetPermanentWarPeace(otherplayerteam, true);[/B]
Game.SetOption(GameOptionTypes.GAMEOPTION_QUICK_COMBAT, true);
Game.SetOption(GameOptionTypes.GAMEOPTION_RANDOM_PERSONALITIES, true);
Game.SetOption(GameOptionTypes.GAMEOPTION_PROMOTION_SAVING, true);
Game.SetOption(GameOptionTypes.GAMEOPTION_POLICY_SAVING, true);
end
end
end --end PermanentWarPeace----------------------------------------------------------
not exactly, result is that human can't propose peace but AI sometime sends some peace tender. With only Domination Victory set it works fine, AI don't sent peace tenders. I try to use PreGame methods to set only Domination Victory automatically but it doesn't works in map script. You can set in manually in Advance Setting Menu so it is not a problem.
EDIT:
With this correction it works (AI dont propose peace):
Code:----------------------------------------------------------------------------------- ------------------------------PermanentWarPeace------------------------------------ ----------------------------------------------------------------------------------- local PermanentWar_useroption = Map.GetCustomOption(8); if PermanentWar_useroption == 1 then ScripSetText = ScripSetText .. " PermanentWar=ON" ; local player1 = Players[0]; local playerAI = Players[1]; if ( playerAI:IsHuman() == false ) then local playerteam_ID = player1:GetTeam(); local playerteam = Teams[playerteam_ID]; local otherplayerteam_ID = playerAI:GetTeam(); local otherplayerteam = Teams[otherplayerteam_ID]; if playerteam_ID ~= otherplayerteam_ID then otherplayerteam:Meet( playerteam, true ); playerteam:Meet( otherplayerteam, true ); otherplayerteam:DeclareWar( playerteam, true ); playerteam:DeclareWar( otherplayerteam, true ); [B] otherplayerteam:SetPermanentWarPeace(playerteam, true); playerteam:SetPermanentWarPeace(otherplayerteam, true);[/B] Game.SetOption(GameOptionTypes.GAMEOPTION_QUICK_COMBAT, true); Game.SetOption(GameOptionTypes.GAMEOPTION_RANDOM_PERSONALITIES, true); Game.SetOption(GameOptionTypes.GAMEOPTION_PROMOTION_SAVING, true); Game.SetOption(GameOptionTypes.GAMEOPTION_POLICY_SAVING, true); end end end --end PermanentWarPeace----------------------------------------------------------