Making a scenario using "Regicide" type of victory

ImageImageTalking about Modding for EE2 and EE2 AOS. New maps, patches, programs and Multiplayer scenarios.
Bogdan
Posts: 49
Joined: 25 Feb 2017, 17:26

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

Post by Bogdan » 12 Jul 2018, 16:54

Thank you Mona, your help is invaluable :)
I tried to make a script for this scenario, but failed. Here it is:
https://drive.google.com/open?id=18I_3P ... 5K8S8uK7gj

If you'll check it out, I will very appreciate it) This is my first script, though, so take it easy. May be you'll see some mistakes in it right away :cry:


User avatar
Leader
Dr.MonaLisa
Posts: 7069
Joined: 17 Jun 2010, 11:21
Location: Poland

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

Post by Leader » 12 Jul 2018, 17:06

I'm on the phone now so can't check what exactly fails. Do you get any errors?
From what I noticed in file, there is "if (!DoesUnitExist( "tx_King_Korean_1" )". Did you give the unit scrip name with tx_ prefix? Or you use the txt entry from the text database? In map editor double click on an unit and give the script name here. Also use messages (printmessage function probably) to detect if its executed, etc.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

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

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

Post by Bogdan » 12 Jul 2018, 18:05

Yes, I gave tx names to all units I want were "Kings":
https://drive.google.com/open?id=1khlcv ... xQTENNKoZu

Added after 4 minutes 18 seconds:
That's what Editor says:
https://drive.google.com/open?id=17Qhux ... n1edzFoJKV

User avatar
Leader
Dr.MonaLisa
Posts: 7069
Joined: 17 Jun 2010, 11:21
Location: Poland

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

Post by Leader » 12 Jul 2018, 23:42

Use the Notepad++ to script, and convert the file to UTF8 without BOM (Format tab in Notepad++ -> Convert to UTF8 without BOM).

The problem is at line 9, character 7, so:

Code: Select all

   desń  = "You win once you terminate all Korean and Chinese leaders"
Seems like you accidentally replaced "c" from "desc" with "ń".

By the way, to upload pictures or files, you can use the "Attachments" button in the "Full Editor & Preview".
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

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

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

Post by Bogdan » 13 Jul 2018, 12:58

I tried to delete all conflict strings from script:
https://drive.google.com/open?id=18I_3P ... 5K8S8uK7gj

Here's what I get now:
Attachments
EE2_ScreenShot2.jpg
EE2_ScreenShot2.jpg (502.24 KiB) Viewed 44 times

User avatar
Leader
Dr.MonaLisa
Posts: 7069
Joined: 17 Jun 2010, 11:21
Location: Poland

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

Post by Leader » 13 Jul 2018, 13:04

Please use forum attachments to host .ies scripts.

The error says that the action named "KingDeadAction" is duplicated.
Actions and Rules should have unique names, for example: ruleObj_Korean_Peninsula1, KingDeadAction1, ruleObj_Korean_Peninsula2, KingDeadAction2, etc.
Under "SCRIPT WORLD" multiple functions can be used, so you could force surrender of player X to all players who are currently in game:

Code: Select all

ForceSurrenderOffer(NORTH_KOREA_1, US_ARMY);
ForceSurrenderOffer(NORTH_KOREA_1, NORTH_KOREA_2);
ForceSurrenderOffer(NORTH_KOREA_1, NORTH_KOREA_3);
...
It will multiply probability of removing player from the game.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

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

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

Post by Bogdan » 13 Jul 2018, 18:00

OMG, it's working! Thank you very much!

The last thing I want to add - Diplomacy conditions. Unfortunately, I don't know what do I miss here:

Code: Select all

   GetDiplomaticState(1, 2) == kDiplomaticState_Hostile
   SetDiplomaticState(2, 1, kDiplomaticState_Hostile)
   LockDiplomaticState(1, 2);
   GetDiplomaticState(1, 3) == kDiplomaticState_Hostile
   SetDiplomaticState(3, 1, kDiplomaticState_Hostile)
   LockDiplomaticState(1, 3);
   GetDiplomaticState(1, 4) == kDiplomaticState_Hostile
   SetDiplomaticState(4, 1, kDiplomaticState_Hostile)
   LockDiplomaticState(1, 4);
   GetDiplomaticState(1, 5) == kDiplomaticState_Hostile
   SetDiplomaticState(5, 1, kDiplomaticState_Hostile)
   LockDiplomaticState(1, 5);
   GetDiplomaticState(1, 6) == kDiplomaticState_Allied
   SetDiplomaticState(6, 1, kDiplomaticState_Allied)
   LockDiplomaticState(1, 6);
   GetDiplomaticState(1, 7) == kDiplomaticState_Allied
   SetDiplomaticState(7, 1, kDiplomaticState_Allied)
   LockDiplomaticState(1, 7);
   GetDiplomaticState(1, 8) == kDiplomaticState_Hostile
   SetDiplomaticState(8, 1, kDiplomaticState_Hostile)
   LockDiplomaticState(1, 8);
   
   EnterAllianceProposal (4, 8, kAllianceDuration_Timed, 1800,
 kAllianceLOSState_Full, kAllianceBorderPerm_None,
 kAllianceResRight_Full);

END_INITIALIZATION
Map Editor says:
Attachments
EE2_ScreenShot7.jpg
EE2_ScreenShot7.jpg (471.96 KiB) Viewed 40 times

User avatar
Leader
Dr.MonaLisa
Posts: 7069
Joined: 17 Jun 2010, 11:21
Location: Poland

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

Post by Leader » 13 Jul 2018, 20:48

This Syntax doesn't look correct:

Code: Select all

GetDiplomaticState(1, 2) == kDiplomaticState_Hostile
It should be something like:

Code: Select all

RULE FeedMonaLisa1 ONESHOT
if(GetDiplomaticState(1, 2) == kDiplomaticState_Hostile)
then ActionFeedMonaLisa1
END_RULE
ACTION ActionFeedMonaLisa1
	SCRIPT WORLD
		SetDiplomaticState(2, 1, kDiplomaticState_Hostile);
   		LockDiplomaticState(1, 2);
	END_SCRIPT
END_ACTION
Please remember there is a topic: "Empire Earth 2 Map making - MP - .ies Scripting" viewtopic.php?f=54&t=1737
Where you can download sample .ies scripts, for example created by me: viewtopic.php?p=23673#p23673

You can open them with Notepad and see how the synataxes for functions look in general, don't need to understand the whole scripts, just check and maybe copy stuff from it.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

User avatar
Loewenherz
Posts: 54
Joined: 23 Sep 2017, 17:26
Location: Germany

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

Post by Loewenherz » 14 Jul 2018, 09:21

You can see for examples here: viewtopic.php?f=54&t=1737&start=40#p23816

;)
My EE2 Work:
EE2 Scripts - Notepad ++ User Defined Language make the scripting clearly and easy.
Grid Utility for EE2 and EE2X to create accurate maps.
IES Script Collection with all scenario scripts from EE2 1.5

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

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

Post by Bogdan » 14 Jul 2018, 13:12

Leader wrote:
13 Jul 2018, 20:48
You can open them with Notepad and see how the synataxes for functions look in general, don't need to understand the whole scripts, just check and maybe copy stuff from it.
Thank you Mona, my script is almost ready. There's an issue with KingDeadAction command, though. Some of the players in my scenario set as "human" in order to turn off AI for them. Well, if their Kings are killed, this command is not working (see screenshot). I need to replace this command for something else, but I don't know exactly which command to use instead. As far as I understand, if I'll use LoseScenario(); command for "human" players Kings, than it will affect the real human player. How it can be fixed?
Attachments
Screenshot.PNG
Screenshot.PNG (4.48 KiB) Viewed 24 times

Post Reply