Making a scenario using "Regicide" type of victory

Modding, Map Editor, IES Scripting and Other Questions
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 »

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
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 »

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
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 »

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
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 »

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
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 »

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 1807 times
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 »

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
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 »

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 1803 times
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 »

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: 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 »

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

;)
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 »

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 1787 times
Post Reply

Return to “Questions”