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
Loewenherz
Posts: 134
Joined: 23 Sep 2017, 17:26

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

Post by Loewenherz » 15 Jul 2018, 21:45

Simply set as victory condition "Script say it so". Then it work.
List of tutorials, useful threads and utilities (look here before posting): Here

The annoying memory for Mona: viewtopic.php?f=54&t=5089 :mrgreen:


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

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

Post by Bogdan » 15 Jul 2018, 21:49

If set “script say so’, than scenario can’t be finished (AI players stay at the Diplomacy panel)

User avatar
Loewenherz
Posts: 134
Joined: 23 Sep 2017, 17:26

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

Post by Loewenherz » 15 Jul 2018, 21:57

That is normal. You must script it, what the AI doit. In all EE2 scenarios the ai are on "off" and are completely scripted.
Last edited by Loewenherz on 15 Jul 2018, 22:05, edited 1 time in total.
List of tutorials, useful threads and utilities (look here before posting): Here

The annoying memory for Mona: viewtopic.php?f=54&t=5089 :mrgreen:

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

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

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

Bogdan wrote:
15 Jul 2018, 20:58
P.S. Can't attach .scn file here, so share it via cloud
Fixed, thanks.
Bogdan wrote:
15 Jul 2018, 20:58
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.
Are you sure it happens after the double check? PlayerInGame() and !IsPlayerHumanControlled()?
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

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

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

Post by Bogdan » 15 Jul 2018, 22:02

Even if I code victory conditions, how the “script say so” setting will prevent “not AI” errors?

Added after 4 minutes 2 seconds:
Hm, didn’t know about PlayerInGame. How can it help and where to isert it?

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

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

Post by Dr.MonaLisa » 15 Jul 2018, 22:07

Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

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

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

Post by Bogdan » 15 Jul 2018, 22:09

Yep)

Added after 7 minutes 43 seconds:
So it’s like

Code: Select all

ACTION KingDeadAction2
SCRIPT WORLD
if (PlayerInGame(2)){
if(!IsPlayerHumanControlled(2)){
  SetAIDiplomacyEnabled(2,true);
  ForceSurrenderOffer(2, 1);
  SetAIDiplomacyEnabled(2,false);
}
else {
...

User avatar
Loewenherz
Posts: 134
Joined: 23 Sep 2017, 17:26

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

Post by Loewenherz » 15 Jul 2018, 22:18

On my pc that scenario work on "Script say it so". I would say, that you finish it on this victory condition.

My advice new rules or actions you can test wonderful in the Boston mission from Mad doc. :)
List of tutorials, useful threads and utilities (look here before posting): Here

The annoying memory for Mona: viewtopic.php?f=54&t=5089 :mrgreen:

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

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

Post by Bogdan » 15 Jul 2018, 22:26

Did you finish playing the whole scenario? How lond did you play?

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

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

Post by Dr.MonaLisa » 15 Jul 2018, 22:29

Bogdan wrote:
15 Jul 2018, 22:16
Yep)

Added after 7 minutes 43 seconds:
So it’s like

Code: Select all

ACTION KingDeadAction2
SCRIPT WORLD
if (PlayerInGame(2)){
if(!IsPlayerHumanControlled(2)){
  SetAIDiplomacyEnabled(2,true);
  ForceSurrenderOffer(2, 1);
  SetAIDiplomacyEnabled(2,false);
}
else {
...
Could be something like:

Code: Select all

if ((PlayerInGame(2)) && (!IsPlayerHumanControlled(2))){
  SetAIDiplomacyEnabled(2,true);
  ForceSurrenderOffer(2, 1);
  SetAIDiplomacyEnabled(2,false);
}
or:

Code: Select all

if (PlayerInGame(2){
  if (!IsPlayerHumanControlled(2)){
  SetAIDiplomacyEnabled(2,true);
  ForceSurrenderOffer(2, 1);
  SetAIDiplomacyEnabled(2,false);
  }
}
Changing && to || would mean "or".
Those are pretty common operations, used in almost every programming language. So it's worth to learn it 1 time, and will be used everywhere else.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Post Reply

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