PlayerShareFog
I have problems with the PlayerShareFog-command. In my example I do have 4 AI Players and a human one. All AI Players are allied. However, after defeating AI Player 1 and 2 I want to ally AI Player 4 to the human player (player 0). However, once I break alliance of Player 4 with Player 3 and ally Player 4 to the human player I can see everything Player 3 sees.
Any Ideas? Am I doing something wrong?
- Code:
var iDefeatCounter: Byte; var iGameTime: Integer; procedure OnMissionStart(); var i: Byte; begin //Do not share fog Actions.PlayerShareFog(4, 1, false); Actions.PlayerShareFog(4, 2, false); Actions.PlayerShareFog(4, 3, false); end; procedure OnPlayerDefeated(aIndex: Integer); begin if iDefeatCounter < 2 then begin if (aIndex = 1) or (aIndex = 2) then iDefeatCounter := iDefeatCounter + 1; end; end; On Tick(); begin //Change Alliances if iDefeatCounter = 2 then begin Actions.PlayerAllianceChange(1, 4, true, false); //Break alliance with remaining AI Player Actions.PlayerAllianceChange(2, 4, true, false); Actions.PlayerAllianceChange(3, 4, true, false); iGameTime := States.GameTime(); iDefeatCounter := 3; end; if ((iDefeatCounter = 3) and (States.GameTime() = iGameTime + 300)) then //30sec Delay begin Actions.ShowMsgGoto(0, 136, 57, 'The small village is joining our cause!'); Actions.PlayerAllianceChange(0, 4, true, true); //Ally to HumanPlayer Actions.AIDefencePositionRemoveAll(4); //Delete defence positions //Add new defence positions Actions.AIDefencePositionAdd(4, 125, 44, 0, 0, 15, 0); //Militia Actions.AIDefencePositionAdd(4, 123, 50, 0, 0, 15, 0); Actions.AIDefencePositionAdd(4, 129, 49, 0, 0, 15, 0); Actions.AIDefencePositionAdd(4, 125, 47, 0, 2, 15, 0); //Rogue Actions.AIDefencePositionAdd(4, 119, 44, 1, 2, 15, 0); Actions.AIDefencePositionAdd(4, 119, 48, 1, 2, 15, 0); Actions.AIDefencePositionAdd(4, 120, 54, 0, 1, 15, 0); //Rebel iDefeatCounter := 4; end; end;
Love the Bomb!
Campaign http://knightsandmerchants.net/forum/vi ... f=5&t=1749
MultiplayerMaps http://knightsandmerchants.net/forum/vi ... f=5&t=2302
AutoComplete http://knightsandmerchants.net/forum/vi ... =32&t=2722
Campaign http://knightsandmerchants.net/forum/vi ... f=5&t=1749
MultiplayerMaps http://knightsandmerchants.net/forum/vi ... f=5&t=2302
AutoComplete http://knightsandmerchants.net/forum/vi ... =32&t=2722