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 »



Added after 27 minutes 55 seconds:
Here's the whole script:

Code: Select all

ACTION KingDeadAction5
SCRIPT WORLD
if ((PlayerInGame(5)) &&(!IsPlayerHumanControlled(5))){
  SetAIDiplomacyEnabled(5,true);
  ForceSurrenderOffer(5, 1);
  SetAIDiplomacyEnabled(5,false);
}
else {
CreateNamedGroup("Group_Korea_4");
AddUnitsByTypeToGroup("Group_Korea_4", "MobileUnits", 5, kPlayerMode_Self, NULL);
AddUnitsByAttributeToGroup("Group_Korea_4", "BareBoneBuilding", 5, kPlayerMode_Self, NULL);
if(NumUnitsInGroup("Group_Korea_4") > 0){
SelectGroupForPlayer("Group_Korea_4", 5);
KillSelection();
ClearSelection();
}
}
END_SCRIPT
END_ACTION
Still issues :roll:
Attachments
Снимок.PNG
Снимок.PNG (4.32 KiB) Viewed 2027 times
Снимок 2.PNG
Снимок 2.PNG (3.94 KiB) Viewed 2027 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 »

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

What exactly?
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 »

Functions with arguments.
This is in the documentation, just read. I can't check it now (phone).
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 »

Hm, everything seems to be repaired by changing

Code: Select all

AddUnitsByAttributeToGroup("Group_Korea_1", "MobileUnits", 2, kPlayerMode_Self, NULL); 
AddUnitsByTypeToGroup("Group_Korea_1", "BareBoneBuilding", 2, kPlayerMode_Self, NULL);
to

Code: Select all

AddUnitsByTypeToGroup("Group_Korea_1", "BareBoneBuilding", 2, kPlayerMode_Self, NULL);
AddUnitsByAttributeToGroup("Group_Korea_1", "MobileUnits", 2, kPlayerMode_Self, NULL); 
At least, I was able to finish scenario for the first time :lol:
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 really don't think it's a temporary state of things, since if script had any issues, scenario had never finished good. So it must be over. Hooray!
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 »

Depends, my World Simulator scenario still uses to crash at unexpected moments, after 2-3 hours in game. Script errors are sometimes hard to detect.

For AddUnitsByAttributeToGroup - they're in zips\dbunittypeattributes.ddf
For AddUnitsByTypeToGroup - they're Unit Types from .ddf files in zips\db.zip\Units.
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 »



Added after 11 minutes 34 seconds:

Code: Select all

historicalInfo = "At dawn on Sunday, 25 June 1950, Kim Il-sung ordered the communist Korean armies to cross the 38th parallel. The North Koreans had a combined arms force including tanks supported by heavy artillery. On 28 June, Seoul fell.\n\nIn early July, U.S. forces arrived; in the Battle of Pusan Perimeter (August–September 1950), the U.S. Army withstood North Korean Army attacks meant to capture the city. Meanwhile, General MacArthur began planning a landing at Incheon; by 15 September, the amphibious assault forces were delivered.\n\nBy 1 October 1950, the UN Command repelled the North Korean Army northwards past the 38th parallel. The UN Command were unconvinced that the Chinese will openly intervene and that caused a fatal mistake - mistaken belief that the Chinese would not enter the war, leading to major allied losses because of Chinese "People's Volunteer Army".\n\nFor the remainder of the Korean War the UN Command and the PVA fought, but exchanged little territory; the stalemate held."
Attachments
EE2_ScreenShot6.jpg
EE2_ScreenShot6.jpg (532 KiB) Viewed 2024 times
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 »

It looks like historicalInfo is limited to only 321 characters :( Do you know the max size of it in symbols?

Added after 1 hour 39 minutes 33 seconds:
Also, I see other scenarios have description more than 321 characters. How it could be?
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 »

You didn't escape the quote character.

Code: Select all

"
It should be

Code: Select all

\"
Everywhere in text within main quotes.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Post Reply

Return to “Questions”