Empire Earth 2 Map making - MP - .ies Scripting

ImageImageTalking about Modding for EE2 and EE2 AOS. New maps, patches, programs and Multiplayer scenarios.
User avatar
Loewenherz
Posts: 70
Joined: 23 Sep 2017, 17:26

Re: Empire Earth 2 Map making - MP - .ies Scripting

Post by Loewenherz » 28 Apr 2018, 20:19

Its is possible to script a missile attack in a scenario?
Last edited by Loewenherz on 02 Aug 2018, 16:06, edited 1 time in total.
List of tutorials, useful threads and utilities (look here before posting): Here


User avatar
Leader
Dr.MonaLisa
Posts: 7120
Joined: 17 Jun 2010, 11:21
Location: Poland

Re: Empire Earth 2 Map making - MP - .ies Scripting

Post by Leader » 28 Apr 2018, 20:50

It is possible only if you manage to produce ICBMs in Missile Siloses.
I remember TheGrouchDE has done it by giving resources to AI player and used custom APIs scripts. So it's not that simple.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

User avatar
TheGrouchDE
Posts: 94
Joined: 26 Jul 2012, 11:22

Re: Empire Earth 2 Map making - MP - .ies Scripting

Post by TheGrouchDE » 29 Apr 2018, 07:49

Hey Loewenherz,

it indeed is possible to make a scripted nuke attack. The thing you have to do is, you create a .aip file in which you make the AI build the ICBM and/or MGMNukes. That looks around like this:

Code: Select all

// hopefully this is temporary, but you need more resources in the late epochs,
//		so you need more citizens
int maxAutobuildCitizens = 65;

// trying to build ALL units is not effective in the late epochs, there's just too many options
//	this AIP will focus on tanks, with a few infantry and airplanes thrown in


// Auto-outpost/fortressing params
//		we look for threatening areas this close to friendly bases (by friendly base
//		grassfire dist map scale) - set to -1 to not auto-outpost
float autoOutpostDistThreshold = 4.0f;


// cannot have more than 7 air defense per territory at the moment
// LightArtillery2 is a AA tank

BuildListElement baseList[] = 
{
// (name), (priority), (hints), (block?), (min desired count), (max desired count), (max build count)
//
};


BuildListElement troopList[] = 
{
// (name), (priority), (hints), (block?), (min desired count), (max desired count), (max build count)
//

//EmptyPlaceForUnit(scud)29.07.2014
//EmptyPlaceForUnit(v2)29.07.2014
//EmptyPlaceForUnit(mam)29.07.2014

"ICBM",		0.1,	DEFAULT,	YES,	8,	8,	60,
"MGMNuke",		0.11,	DEFAULT,	YES,	4,	4,	60,
};


BuildListElement newCityBaseList[] = 
{
// (name), (priority), (hints), (block?), (min desired count), (max desired count), (max build count)
//
};

BuildListElement newCityTroopList[] = 
{
// (name), (priority), (hints), (block?), (min desired count), (max desired count), (max build count)
//

}
The best is, you set an AI_Buildfactor with 0.01 for the AI so he can build them instantly. Or you Otherwise it might happen, that he tries to attack with a silo, that is not filled. Now i don't know exactly, either this will just cause to ignore these or in worst case - cause a debug screen. Additionally you need to set script names for the Missile Silo's and the ICBM you placed for the AI. Only thing left then is to make the Missile Silo's/ICBM's attack. If you want to attack a specific building you just select them with SelectUnit("Scriptname") and then AttackWithSelection("Scriptnameoftargetunit"). Now im not sure, but theoretically if you want them to attack just a area you might can make them attack these too. I think i did that with one of my scenario's too.

User avatar
Loewenherz
Posts: 70
Joined: 23 Sep 2017, 17:26

Re: Empire Earth 2 Map making - MP - .ies Scripting

Post by Loewenherz » 29 Apr 2018, 19:42

Hi TheGrouchDE and Dr. MonaLisa. Thanks for your helpfull answers. :D
I will test that for me in the boston mission. It seems that the aip file is a valuable addition for specific script situations. I will look precisely in this files.
What the Missile Silo's/ICBM's attack is concerned, i wanted it first, to script that with the "AddAirMissionWayPointArea" action.

The guys from Mad Doc have create for ervery Player in EE 2 Missions a own aip file. It seems for good reason. :?:
List of tutorials, useful threads and utilities (look here before posting): Here

User avatar
Loewenherz
Posts: 70
Joined: 23 Sep 2017, 17:26

Re: Empire Earth 2 Map making - MP - .ies Scripting

Post by Loewenherz » 01 Aug 2018, 14:32

Hi, here is a little gimmick from me. That function counts the time, and is in contrast to "PERIODICITY" variabele and can be changed.

Code: Select all

////////////////////////////////////////////////////////////
// INITIALIZATION 
////////////////////////////////////////////////////////////
INITIALIZATION
	iEveryMinute = 61;
	MISSIONTIMER_TEXT = "tx_enum_eTeam_0";

  bEveryMinute = false; //start this out false
  bDumpSemaphore2 = false;
  bDumpSemaphore3 = false;

END_INITIALIZATION



RULE ruleCountTime 
  if (true)
    then actionCountTime
END_RULE

ACTION actionCountTime
  SCRIPT WORLD

if (!bDumpSemaphore2)
	{
	tMissiontTimerCountTime = NewMissionTimer(MISSIONTIMER_TEXT ,Foo);
	SetMissionTimer(tMissiontimerCountTime, iEveryMinute); 
	StartMissionTimer(tMissiontimerCountTime); 
	bDumpSemaphore2 = true;
	bDumpSemaphore3 = true;
	}
	 if(bDumpSemaphore3){
  GetEveryMinute = GetMissionTimer(tMissiontimerCountTime);
	     if (IsMissionTimerExpired(tMissiontimerCountTime))
	{
	iEveryMinute = 60;
	SetMissionTimer(tMissiontimerCountTime, iEveryMinute);
	bEveryMinute = true;
	}
	}
	
  END_SCRIPT
END_ACTION
List of tutorials, useful threads and utilities (look here before posting): Here

Post Reply