Re: Empire Earth 2 Map making - MP - .ies Scripting
Posted: 28 Apr 2018, 20:19
Its is possible to script a missile attack in a scenario?
The only one active forum about Empire Earth II
https://forum.ee2.eu/
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)
//
}
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
Code: Select all
RULE testwidget ONESHOT
if ( GetWidgetSelectionCount("chat_input_textfield") >= 3
&& GetWidgetSelectionCount("chat_input_radio_allies") >= 1
&& IsUnitSelectedUI("CityCenterSelectet")
)
then actiontestwidget
END_RULE
ACTION actiontestwidget
SCRIPT WORLD
FlashWidgetForTime("chat_input_glass", 5);
DoDelay( 2.0 );
STEP
DebugOutputString( "Seems to Work!" ); //strictly for testing
PrintMessage( "Seems to Work and you win!" ); //this does work, even though these strings are normally localized in a .utf8 file in the db/ directory.
DoDelay( 10.0 );
STEP
WinScenario();
END_SCRIPT
END_ACTION
Code: Select all
RULE testGates ONESHOT
if ( GetWidgetSelectionCount("chat_input_textfield") >= 1
)
then actiontestGates
END_RULE
ACTION actiontestGates
SCRIPT WORLD
FlashWidgetForTime("chat_input", 5);
DoDelay( 1.0 );
STEP
DebugOutputString( "Seems to Work!" ); //strictly for testing
PrintMessage( "Seems to Work and you win!" ); //this does work, even though these strings are normally localized in a .utf8 file in the db/ directory.
DoDelay( 1.0 );
STEP
CreateNamedUnitInArea(HUMAN_PLAYER, "Wall_Gate", "Gate1", false, "Area1");
DoDelay (2.0);
STEP
SelectUnit("Gate1");
RemoveSelection();
SetUnitPlacementAngle(65.0); //Dont work
CreateNamedUnitInArea(LARRY_PLAYER, "Wall_Gate", "Gate1", false, "Area1");
END_SCRIPT
END_ACTION
Code: Select all
////////////////////////////////////////////////////////////
// TOBRUK.ies
//
// Author: Michael34
// Copy Right: 17 February 2012
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// All rules are for the WORLD entity.
////////////////////////////////////////////////////////////
RULES FOR WORLD
SCENARIO
name = "Tobruk"
brief = "Lead british forces through Sahara desert to take over the fortified German city of Tobruk."
//victory = "You are victorious!"
//loss = "You have lost."
hints = ""
historicalInfo = "In 1941, the German aided the Italian to keep their possessions in Lybia against the English. Marschall Erwin Rommel occupied Tobruk. A british army, under general Montgomery's command, will try to recover Tobruk."
//description = "DESCRIPTION(This is only for you to read)"
date = "23 Juny 2020"
END_SCENARIO
DEFINITIONS
END_DEFINITIONS
INITIALIZATION
PauseCalendar(false);
PauseWeatherSystem(false);
StartPlayingCinematic("Cinematic_1");
PrintSubtitle("Will you be able to lead British troops to victory?");
DoDelay(10.0);
StartPlayingCinematic("Cinematic");
PrintSubtitle("A powerful German army warded off the north African city of Tobruk...");
END_INITIALIZATION
// ////////////////////////////////////////////////////////////
// //RUNS AFTER CINEMATIC, BEFORE OBJECTIVES OPEN
// ////////////////////////////////////////////////////////////
ACTION PreScenInfoPanelHook
SCRIPT WORLD
//nothing here
END_SCRIPT
END_ACTION
////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////