Making a scenario using "Regicide" type of victory
- Dr.MonaLisa
- High Representative
- Posts: 8713
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 109 times
Re: Making a scenario using "Regicide" type of victory
So enable it in script, and then disable.
SetAIDiplomacyEnabled(2,true);
ForceSurrenderOffer(2, 1);
SetAIDiplomacyEnabled(2,false);
SetAIDiplomacyEnabled(2,true);
ForceSurrenderOffer(2, 1);
SetAIDiplomacyEnabled(2,false);
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
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
- Dr.MonaLisa
- High Representative
- Posts: 8713
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 109 times
Re: Making a scenario using "Regicide" type of victory
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
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
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 (4.2 KiB) Viewed 1814 times
- Dr.MonaLisa
- High Representative
- Posts: 8713
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 109 times
Re: Making a scenario using "Regicide" type of victory
Seems like you really don't read the documentation.
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.
Code: Select all
if (PlayerInGame(7)){
//Do stuff
}
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
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?
Still, any ideas what can cause the issue with AI players recognition?
- Dr.MonaLisa
- High Representative
- Posts: 8713
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 109 times
Re: Making a scenario using "Regicide" type of victory
Maybe the player is not in game already? Surrendered?
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
- Dr.MonaLisa
- High Representative
- Posts: 8713
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 109 times
Re: Making a scenario using "Regicide" type of victory
Got killed / resigned / no units left.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Making a scenario using "Regicide" type of victory
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:(
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:(