Page 2 of 10

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

Posted: 12 Jul 2018, 16:54
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:

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

Posted: 12 Jul 2018, 17:06
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.

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

Posted: 12 Jul 2018, 18:09
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

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

Posted: 12 Jul 2018, 23:42
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".

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

Posted: 13 Jul 2018, 12:58
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:

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

Posted: 13 Jul 2018, 13:04
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.

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

Posted: 13 Jul 2018, 18:00
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:

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

Posted: 13 Jul 2018, 20:48
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.

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

Posted: 14 Jul 2018, 09:21
by Loewenherz
You can see for examples here: viewtopic.php?f=54&t=1737&start=40#p23816

;)

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

Posted: 14 Jul 2018, 13:12
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?