Page 6 of 10

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

Posted: 15 Jul 2018, 21:45
by Loewenherz
Simply set as victory condition "Script say it so". Then it work.

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

Posted: 15 Jul 2018, 21:49
by Bogdan
If set “script say so’, than scenario can’t be finished (AI players stay at the Diplomacy panel)

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

Posted: 15 Jul 2018, 21:57
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.

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

Posted: 15 Jul 2018, 22:02
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()?

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

Posted: 15 Jul 2018, 22:06
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?

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

Posted: 15 Jul 2018, 22:07
by Dr.MonaLisa

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

Posted: 15 Jul 2018, 22:16
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 {
...

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

Posted: 15 Jul 2018, 22:18
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. :)

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

Posted: 15 Jul 2018, 22:26
by Bogdan
Did you finish playing the whole scenario? How lond did you play?

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

Posted: 15 Jul 2018, 22:29
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.