Making a scenario using "Regicide" type of victory

Modding, Map Editor, IES Scripting and Other Questions
User avatar
Loewenherz
Posts: 244
Joined: 23 Sep 2017, 17:26
Has thanked: 7 times
Been thanked: 21 times

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

Post by Loewenherz »

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

Add Pics to Map: viewtopic.php?f=54&p=25184#p25184

Loews Work: viewtopic.php?f=54&t=5160

User avatar
Bogdan
Posts: 149
Joined: 25 Feb 2017, 17:26
Location: Kyiv, Ukraine
Been thanked: 3 times

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

Post by Bogdan »

If set “script say so’, than scenario can’t be finished (AI players stay at the Diplomacy panel)
User avatar
Loewenherz
Posts: 244
Joined: 23 Sep 2017, 17:26
Has thanked: 7 times
Been thanked: 21 times

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

Post by Loewenherz »

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

Add Pics to Map: viewtopic.php?f=54&p=25184#p25184

Loews Work: viewtopic.php?f=54&t=5160
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

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

Post by Dr.MonaLisa »

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
User avatar
Bogdan
Posts: 149
Joined: 25 Feb 2017, 17:26
Location: Kyiv, Ukraine
Been thanked: 3 times

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

Post by Bogdan »

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: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

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

Post by Dr.MonaLisa »

Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
User avatar
Bogdan
Posts: 149
Joined: 25 Feb 2017, 17:26
Location: Kyiv, Ukraine
Been thanked: 3 times

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

Post by Bogdan »

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: 244
Joined: 23 Sep 2017, 17:26
Has thanked: 7 times
Been thanked: 21 times

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

Post by Loewenherz »

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

Add Pics to Map: viewtopic.php?f=54&p=25184#p25184

Loews Work: viewtopic.php?f=54&t=5160
User avatar
Bogdan
Posts: 149
Joined: 25 Feb 2017, 17:26
Location: Kyiv, Ukraine
Been thanked: 3 times

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

Post by Bogdan »

Did you finish playing the whole scenario? How lond did you play?
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

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

Post by Dr.MonaLisa »

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 “Questions”