Setting Map Editor Objectives

Modding, Map Editor, IES Scripting and Other Questions
User avatar
Dr.MonaLisa
High Representative
Posts: 8873
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 55 times
Been thanked: 135 times

Re: Setting Map Editor Objectives

Post by Dr.MonaLisa »

Code: Select all

//DEFINITIONS
int HarderLvl
bool PiratesDead
bool NotMore

//INITIALIZATION
HarderLvl = 10;
PiratesDead = true;
NotMore = true;

//END_INITIALIZATION

RULE NewShips PERIODICITY 5
if ((NumUnitsInGroup("Pirates") < HarderLvl) && PiratesDead && NotMore)
  then NewShips
END_RULE
ACTION NewShips
SCRIPT WORLD
PiratesDead = false;
HarderLvl = HarderLvl + 7;
PlayVoiceOver("Fx_Bld_Coastal_Defense.mp3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "FightingSail",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Galleon",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates1");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates2");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
CreateGroupedUnitInArea(1, "Frigate",
"Pirates", false, "NewPirates3");
DoDelay(1);
STEP
SelectGroup("Pirates");
SetSelectionStance(kStanceType_Aggressive);
SetSelectionFormation("StaggeredLine");
SearchAndDestroyWithSelection();
PiratesDead = true;
END_SCRIPT
END_ACTION
This function creates more and more pirates ships when they die.
"NewPirates3" as such are area names, so would need to be added in map editor first.

It's not very complicated once you understand how functions are executed.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Seven243
Posts: 31
Joined: 02 Nov 2022, 21:41
Has thanked: 4 times

Re: Setting Map Editor Objectives

Post by Seven243 »

I'm posting what I've made so far for whoever wants to check it out, and I'll post it again when I'm done with it.
Attachments
C USA Script.ies
(6.57 KiB) Downloaded 132 times
China USA.scn
(2.49 MiB) Downloaded 124 times
Seven243
Posts: 31
Joined: 02 Nov 2022, 21:41
Has thanked: 4 times

Re: Setting Map Editor Objectives

Post by Seven243 »

I haven't made any progress, adding to the endless list of problems it won't recognize the terms SetMissionTimer or StartMissionTimer and I made the script cause an access violation now.
User avatar
Dr.MonaLisa
High Representative
Posts: 8873
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 55 times
Been thanked: 135 times

Re: Setting Map Editor Objectives

Post by Dr.MonaLisa »

The Mission Timer was tricky. I think I figured out how to use it, and done that in the Pirates / Planes scenarios. It had some functions which were undocumented in the scripting "bible".
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Seven243
Posts: 31
Joined: 02 Nov 2022, 21:41
Has thanked: 4 times

Re: Setting Map Editor Objectives

Post by Seven243 »

This scenario started to get very laggy because I changed it so many times and it was crashing when the briefing window was closed, then I just lost interest in it.
User avatar
Dr.MonaLisa
High Representative
Posts: 8873
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 55 times
Been thanked: 135 times

Re: Setting Map Editor Objectives

Post by Dr.MonaLisa »

Awww, that's sad. But yeah, I decided to myself that I will never try creating scenarios again. This was too painful for the Planes scenario and I had so many headaches that it's just not worth it.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Seven243
Posts: 31
Joined: 02 Nov 2022, 21:41
Has thanked: 4 times

Re: Setting Map Editor Objectives

Post by Seven243 »

I'm planning to work on some other scenarios because I like the base game's campaigns so much, but I'm not expecting much success.
Post Reply

Return to “Questions”