Page 7 of 10

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

Posted: 16 Jul 2018, 11:24
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:

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

Posted: 16 Jul 2018, 11:25
by Dr.MonaLisa
Invert

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

Posted: 16 Jul 2018, 11:29
by Bogdan
What exactly?

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

Posted: 16 Jul 2018, 11:59
by Dr.MonaLisa
Functions with arguments.
This is in the documentation, just read. I can't check it now (phone).

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

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

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

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

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

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

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

Posted: 16 Jul 2018, 14:35
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."

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

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

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

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