Making a scenario using "Regicide" type of victory

ImageImageTalking about Modding for EE2 and EE2 AOS. New maps, patches, programs and Multiplayer scenarios.
User avatar
Dr.MonaLisa
High Representative
Posts: 7160
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Making a scenario using "Regicide" type of victory

Post by Dr.MonaLisa » 15 Jul 2018, 16:48

So enable it in script, and then disable.

SetAIDiplomacyEnabled(2,true);
ForceSurrenderOffer(2, 1);
SetAIDiplomacyEnabled(2,false);
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains


Bogdan
Posts: 51
Joined: 25 Feb 2017, 17:26

Re: Making a scenario using "Regicide" type of victory

Post by Bogdan » 15 Jul 2018, 16:53

Like this?

Code: Select all

RULE ruleObj_Korean_Peninsula2 ONESHOT
 if (!DoesUnitExist( "tx_King_Korean_1" )
   )
  then KingDeadAction2
END_RULE


ACTION KingDeadAction2
SCRIPT WORLD
SetAIDiplomacyEnabled(2,true);
if(!IsPlayerHumanControlled(2)){
  ForceSurrenderOffer(2, 1);
SetAIDiplomacyEnabled(2,false);
}
else {
CreateNamedGroup("Group_Korea_1");
AddUnitsByTypeToGroup("Group_Korea_1", "Everything", 2, kPlayerMode_Self, NULL);
AddUnitsByAttributeToGroup("Group_Korea_1", "Everything", 2, kPlayerMode_Self, NULL);
if(NumUnitsInGroup("Group_Korea_1") > 0){
SelectGroupForPlayer("Group_Korea_1", 2);
KillSelection();
ClearSelection();
}
}
END_SCRIPT
END_ACTION

User avatar
Dr.MonaLisa
High Representative
Posts: 7160
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Making a scenario using "Regicide" type of victory

Post by Dr.MonaLisa » 15 Jul 2018, 16:54

Code: Select all

RULE ruleObj_Korean_Peninsula2 ONESHOT
 if (!DoesUnitExist( "tx_King_Korean_1" )
   )
  then KingDeadAction2
END_RULE


ACTION KingDeadAction2
SCRIPT WORLD
if(!IsPlayerHumanControlled(2)){
  SetAIDiplomacyEnabled(2,true);
  ForceSurrenderOffer(2, 1);
  SetAIDiplomacyEnabled(2,false);
}
else {
CreateNamedGroup("Group_Korea_1");
AddUnitsByTypeToGroup("Group_Korea_1", "Everything", 2, kPlayerMode_Self, NULL);
AddUnitsByAttributeToGroup("Group_Korea_1", "Everything", 2, kPlayerMode_Self, NULL);
if(NumUnitsInGroup("Group_Korea_1") > 0){
SelectGroupForPlayer("Group_Korea_1", 2);
KillSelection();
ClearSelection();
}
}
END_SCRIPT
END_ACTION
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Bogdan
Posts: 51
Joined: 25 Feb 2017, 17:26

Re: Making a scenario using "Regicide" type of victory

Post by Bogdan » 15 Jul 2018, 17:02



Added after 1 hour 39 minutes 27 seconds:
Haha

Added after 21 minutes 11 seconds:
Also, one of the players is now surrendering before its King is actually eliminated.
Attachments
Снимок.PNG
Снимок.PNG (4.2 KiB) Viewed 268 times

User avatar
Dr.MonaLisa
High Representative
Posts: 7160
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Making a scenario using "Regicide" type of victory

Post by Dr.MonaLisa » 15 Jul 2018, 20:02

Seems like you really don't read the documentation.

Code: Select all

if (PlayerInGame(7)){
//Do stuff
}
In my opinion it would be simpler to create city centers for all players and delete them with a script on game start. So the normal kings would be present in game.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Bogdan
Posts: 51
Joined: 25 Feb 2017, 17:26

Re: Making a scenario using "Regicide" type of victory

Post by Bogdan » 15 Jul 2018, 20:17

Yeah, but in that case I will need to fixate them with something different than barbed wire. And also I will need a new map, cause everything here is really compact.
Still, any ideas what can cause the issue with AI players recognition?

User avatar
Dr.MonaLisa
High Representative
Posts: 7160
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Making a scenario using "Regicide" type of victory

Post by Dr.MonaLisa » 15 Jul 2018, 20:21

Maybe the player is not in game already? Surrendered?
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Bogdan
Posts: 51
Joined: 25 Feb 2017, 17:26

Re: Making a scenario using "Regicide" type of victory

Post by Bogdan » 15 Jul 2018, 20:27

What do you mean "not in the game"?

User avatar
Dr.MonaLisa
High Representative
Posts: 7160
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Making a scenario using "Regicide" type of victory

Post by Dr.MonaLisa » 15 Jul 2018, 20:27

Got killed / resigned / no units left.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Bogdan
Posts: 51
Joined: 25 Feb 2017, 17:26

Re: Making a scenario using "Regicide" type of victory

Post by Bogdan » 15 Jul 2018, 20:28

I'll check it again now

Added after 27 minutes 59 seconds:
May be no units left. Anyway, it's not a problem; the real problem is quitting "not AI player" error.
As far as I will hardly continue testing in the near future (unfortunately), I'll just leave scenario here, in case you'll have some spare time to see it and may be rate my scripting fail)

https://drive.google.com/open?id=1lPXzz ... v5fbFgDseN

P.S. Can't attach .scn file here, so share it via cloud

Added after 1 minute 28 seconds:
I don't know, may be today I was close to get everything work:(

Post Reply

Return to “EE2 files, modding, maps, testing, etc.”