scenario
{labels {
//Add any constant labels here in a comma separated list.
}
run_once {
//Insert commands that should be executed only once when the script is loaded here.
set_nation_name("French","France");
set_nation_name("Germans","Austria");
set_nation_name("Russians","Russia");
set_nation_name("Dutch","Austria (non-combatant)");
jump_camera(168,124);
play_sound("Austerlitz.wav");
popup_dialog("On the first anniversary of his coronation
as Emperor, Napoleon confronts the Austrian army near the
town of Austerlitz.");
jump_camera(127,31);
popup_dialog("The Austrians, led by Emperor Francis II,
have been joined by a Russian army sent by Tsar Alexander,
which includes the Russian Imperial Guard.");
jump_camera(92,217);
popup_dialog("Napoleon has left his right flank weak,
drawing the Austrians into an attack there. The Allies do
not know that Davout is racing to the battlefield from
Vienna with his III Corps. Napoleon's plan is to lure them
in, then split their army by attacking the Austrian
center.");
jump_camera(73,128);
popup_dialog("Napoleon is gambling his Empire on a single
sharp blow that will end the war, dissolve the Alliance,
and establish himself as master of Europe.");
jump_camera(65,142);
rename_type("Junkers","Grenadiers");
rename_type("Senate","Austerlitz City Hall");
rename_type("Temple","Church");
rename_type("Lenin Statue","Statue");
rename_type("Siege Factory","Linen Factory");
rename_type("Library","Customs House");
rename_type("Don Cossack","Lancers");
rename_type("Continental Marines","Infantry");
rename_type("Janissaries","V Corps");
rename_type("Fusiliers","Bagration's Corps");
rename_type("Red Coats","III Corps");
rename_type("Commander Paoli","Soult");
rename_type("Elite Conquistador","Davout");
rename_type("Commander Schwarzenberg","Murat");
rename_type("Wellington","Emperor Francis II");
add_objective("1 - Attack left","advance_1","nosound.wav");
add_objective("3 - Attack center","advance_2","nosound.wav");
add_objective("5 - Attack right","advance_3","nosound.wav");
add_objective("7 - Attack cavalry","advance_4","nosound.wav");
add_objective("9 - Commit Imperial Guard","advance_5","nosound.wav");
set_defeat_message("You have lost! All of Europe is now rising up against you!");
set_victory_message("You have won the field and made yourself master of Europe!");
for (aa=num_type(2,"Red Coats"); aa>0; aa--) {
reinforcements1=find_unit(2,"Red Coats");
unit_stance_order(2,reinforcements1,"Aggressive");
x=object_position_x(2,reinforcements1);
y=object_position_y(2,reinforcements1);
unit_attack_to_order(2,reinforcements1,x+75,y-75);
}
davout=find_unit(2,"Elite Conquistador");
x=object_position_x(2,davout);
y=object_position_y(2,davout);
unit_move_order(2,davout,x+75,y-75); for (f1=num_type(2,"Hussar"); f1>0; f1--) {
ag1=find_unit(2,"Hussar");
unit_stance_order(2,ag1,"Defensive");
}
for (f2=num_type(2,"Imperial Guard"); f2>0; f2--) {
ag2=find_unit(2,"Imperial Guard");
unit_stance_order(2,ag2,"Stand Ground");
}
for (f3=num_type(2,"Junkers"); f3>0; f3--) {
ag3=find_unit(2,"Junkers");
unit_stance_order(2,ag3,"Stand Ground");
}
for (f4=num_type(2,"Continental Marines"); f4>0; f4--) {
ag4=find_unit(2,"Continental Marines");
unit_stance_order(2,ag4,"Stand Ground");
}
for (f5=num_type(2,"Cuirassier"); f5>0; f5--) {
ag5=find_unit(2,"Cuirassier");
unit_stance_order(2,ag5,"Defensive");
}
for (f6=num_type(2,"Horse Grenadier"); f6>0; f6--) {
ag6=find_unit(2,"Horse Grenadier");
unit_stance_order(2,ag6,"Defensive");
}
for (f7=num_type(3,"Imperial Guard"); f7>0; f7--) {
ag7=find_unit(3,"Imperial Guard");
unit_stance_order(3,ag7,"Aggressive");
}
for (f8=num_type(3,"Fusiliers"); f8>0; f8--) {
ag8=find_unit(3,"Fusiliers");
unit_stance_order(3,ag8,"Aggressive");
}
for (f9=num_type(1,"Junkers"); f9>0; f9--) {
ag9=find_unit(1,"Junkers");
unit_stance_order(1,ag9,"Stand Ground");
}
for (f10=num_type(1,"Continental Marines"); f10>0; f10--) {
ag10=find_unit(1,"Continental Marines");
unit_stance_order(1,ag10,"Stand Ground");
} set_timer("austrian_attack",20);
set_timer("russian_attack",90);
set_timer("austrian_cavalry_attack",75);
set_timer("russian_guard_attack",360);
}
//Main script body.
if (key_down("1")) {
play_sound ("Victory.wav");
set_timer("enemy_response_left",10);
for (a2=num_type(2,"Janissaries"); a2>0; a2--) {
left2=find_unit(2,"Janissaries");
x=object_position_x(2,left2);
y=object_position_y(2,left2);
unit_stance_order(2,left2,"Aggressive");
unit_attack_to_order(2,left2,x+75,y-75);
}
}if (key_down("3")) {
play_sound ("Victory.wav");
set_timer("enemy_response_center",10);
for (a6=num_type(2,"Junkers"); a6>0; a6--) {
center1=find_unit(2,"Junkers");
x=object_position_x(2,center1);
y=object_position_y(2,center1);
unit_stance_order(2,center1,"Aggressive");
unit_attack_to_order(2,center1,x+100,y-10);
} soult=find_unit(2,"Commander Paoli");
x=object_position_x(2,soult);
y=object_position_y(2,soult);
unit_attack_to_order(2,soult,x+20,y-5);
}if (key_down("5")) {
play_sound ("Victory.wav");
for (a8=num_type(2,"Continental Marines"); a8>0; a8--) {
right1=find_unit(2,"Continental Marines");
x=object_position_x(2,right1);
y=object_position_y(2,right1);
unit_stance_order(2,right1,"Aggressive");
unit_attack_to_order(2,right1,x+75,y-75);
}
}if (key_down("7")) {
play_sound ("Victory.wav");
set_timer("enemy_response_cav",10);
for (a3=num_type(2,"Hussar"); a3>0; a3--) {
cav1=find_unit(2,"Hussar");
x=object_position_x(2,cav1);
y=object_position_y(2,cav1);
unit_stance_order(2,cav1,"Aggressive");
unit_attack_to_order(2,cav1,x+100,y-100);
}
for (a4=num_type(2,"Cuirassier"); a4>0; a4--) {
cav2=find_unit(2,"Cuirassier");
x=object_position_x(2,cav2);
y=object_position_y(2,cav2);
unit_stance_order(2,cav2,"Aggressive");
unit_attack_to_order(2,cav2,x+100,y-100);
}
for (a5=num_type(2,"Horse Grenadier"); a5>0; a5--) {
cav3=find_unit(2,"Horse Grenadier");
x=object_position_x(2,cav3);
y=object_position_y(2,cav3);
unit_stance_order(2,cav3,"Aggressive");
unit_attack_to_order(2,cav3,x+100,y-100);
} murat=find_unit(2,"Commander Schwarzenberg");
x=object_position_x(2,murat);
y=object_position_y(2,murat);
unit_attack_to_order(2,murat,x+40,y-40);
}if (key_down("9")) {
play_sound ("Victory.wav");
set_timer("enemy_response_center",10);
for (a7=num_type(2,"Imperial Guard"); a7>0; a7--) {
reserves1=find_unit(2,"Imperial Guard");
x=object_position_x(2,reserves1);
y=object_position_y(2,reserves1);
unit_stance_order(2,reserves1,"Aggressive");
unit_attack_to_order(2,reserves1,x+100,y-5);
}
}if (timer_expired("austrian_attack")) {
jump_camera(161,144);
popup_dialog("Sire! The Austrians are moving in force against our right flank!");
play_sound("Advance.wav");
for (b1=num_type(1,"Continental Marines"); b1>0; b1--) {
aus1=find_unit(1,"Continental Marines");
x=object_position_x(1,aus1);
y=object_position_y(1,aus1);
unit_stance_order(1,aus1,"Aggressive");
unit_attack_to_order(1,aus1,x-50,y+75);
}
for (b2=num_type(1,"Junkers"); b2>0; b2--) {
aus2=find_unit(1,"Junkers");
x=object_position_x(1,aus2);
y=object_position_y(1,aus2);
unit_stance_order(1,aus2,"Aggressive");
unit_attack_to_order(1,aus2,x-50,y+75);
}
}if (timer_expired("austrian_cavalry_attack")) {
jump_camera(144,66);
popup_dialog("Sire! Lichtenstein is moving his cavalry against our lines!");
play_sound("Advance.wav");
for (b3=num_type(1,"Don Cossack"); b3>0; b3--) {
aus3=find_unit(1,"Don Cossack");
x=object_position_x(1,aus3);
y=object_position_y(1,aus3);
unit_stance_order(1,aus3,"Aggressive");
unit_attack_to_order(1,aus3,x-75,y+75);
}
for (b4=num_type(1,"Horse Guard Grenadier"); b4>0; b4--) {
aus4=find_unit(1,"Horse Guard Grenadier");
x=object_position_x(1,aus4);
y=object_position_y(1,aus4);
unit_stance_order(1,aus4,"Aggressive");
unit_attack_to_order(1,aus4,x-75,y+75);
}
for (b5=num_type(1,"Hussar"); b5>0; b5--) {
aus5=find_unit(1,"Hussar");
x=object_position_x(1,aus5);
y=object_position_y(1,aus5);
unit_stance_order(1,aus5,"Aggressive");
unit_attack_to_order(1,aus5,x-75,y+75);
}
}if (timer_expired("russian_attack")) {
jump_camera(123,35);
popup_dialog ("Sire! Bagratian is moving his Corps forward. The Russians are attacking our left flank!");
play_sound("Advance.wav");
for (c1=num_type(3,"Fusiliers"); c1>0; c1--) {
rus1=find_unit(3,"Fusiliers");
x=object_position_x(3,rus1);
y=object_position_y(3,rus1);
unit_stance_order(3,rus1,"Aggressive");
unit_attack_to_order(3,rus1,x-75,y+75);
}
for (c2=num_type(1,"Bombard"); c2>0; c2--) {
rus2=find_unit(1,"Bombard");
x=object_position_x(1,rus2);
y=object_position_y(1,rus2);
unit_move_order(1,rus2,x-30,y+30);
}
}if (timer_expired("russian_guard_attack")) {
jump_camera(195,82);
popup_dialog ("Sire! The Russian Imperial Guard is moving against our center!");
play_sound("Advance.wav");
for (cc=num_type(3,"Imperial Guard"); cc>0; cc--) {
rus3=find_unit(3,"Imperial Guard");
x=object_position_x(3,rus3);
y=object_position_y(3,rus3);
unit_stance_order(3,rus3,"Aggressive");
unit_attack_to_order(3,rus3,x-90,y+90);
} kutosov=find_unit(2,"General Kutosov");
x=object_position_x(2,kutosov);
y=object_position_y(2,kutosov);
unit_attack_to_order(2,kutosov,x-50,y+50);
}if (population(2)<200) {
play_sound("Austerlitz.wav");
popup_dialog("Our army is routing! The enemy has won the field!");
defeat(2);
}if (population(3)<70 && population(1)< 150) {
play_sound("Austerlitz.wav");
popup_dialog("The Allies have broken! We are triumphant!");
victory (2);
}if (num_type(2,"Napoleon")<1 && num_type(2,"Atl-Atls")<1) {
create_unit(2,8,231,"Atl-Atls",1);
popup_dialog("Napoleon has been wounded and is being carried off the battlefield! The Army is shaken!");
remove_objective("advance_1");
remove_objective("advance_2");
remove_objective("advance_3");
remove_objective("advance_4");
remove_objective("advance_5");
}
if (num_type(2, "Continental Marines")<30 && num_type(2,"Scholar")<1) {
create_unit(2,6,231,"Scholar",1);
remove_objective("advance_3");
popup_dialog("Our right flank is falling back, Sire!");
play_sound("fallback.wav");
for (e1=num_type(2,"Continental Marines"); e1>0; e1--) {
retreat1=find_unit(2,"Continental Marines");
x=object_position_x(2,retreat1);
y=object_position_y(2,retreat1);
unit_stance_order(2,retreat1,"Stand Ground");
unit_move_order(2,retreat1,x-20,y+20);
}
}if (num_type(2, "Continental Marines")<20 && num_type(4,"Scholar")<1) {
create_unit(4,237,58,"Scholar",1);
popup_dialog("Our right flank is retreating! IV Corps has been broken!");
for (e2=num_type(2,"Continental Marines"); e2>0; e2--) {
retreat2=find_unit(2,"Continental Marines");
unit_stance_order(2,retreat2,"Stand Ground");
unit_move_order(2,retreat2,37,216);
}
}if (num_type(2, "Junkers")<30 && num_type(2,"Caravan")<1) {
create_unit(2,6,230,"Caravan",1);
remove_objective("advance_2");
popup_dialog("Our center is falling back!");
play_sound("fallback.wav");
for (e3=num_type(2,"Junkers"); e3>0; e3--) {
retreat3=find_unit(2,"Junkers");
x=object_position_x(2,retreat3);
y=object_position_y(2,retreat3);
unit_stance_order(2,retreat3,"Stand Ground");
unit_move_order(2,retreat3,x-20,y+20);
}
}if (num_type(2, "Junkers")<20 && num_type(4,"Solduri")<1) {
create_unit(4,229,59,"Solduri",1);
popup_dialog("Our center is retreating, Sire! I Corps has been broken!");
for (e4=num_type(2,"Junkers"); e4>0; e4--) {
retreat4=find_unit(2,"Junkers");
unit_stance_order(2,retreat4,"Stand Ground");
unit_move_order(2,retreat4,11,87);
}
}if (num_type(2, "Red Coats")<30 && num_type(2,"Merchant")<1) {
create_unit(2,6,229,"Merchant",1);
popup_dialog("Davout's III Corps is falling back!");
play_sound("fallback.wav");
for (e5=num_type(2,"Red Coats"); e5>0; e5--) {
retreat5=find_unit(2,"Red Coats");
x=object_position_x(2,retreat5);
y=object_position_y(2,retreat5);
unit_stance_order(2,retreat5,"Stand Ground");
unit_move_order(2,retreat5,x-20,y+20);
}
for (ef=num_type(2,"Junkers"); ef>0; ef--) {
retreatf=find_unit(2,"Junkers");
x=object_position_x(2,retreatf);
y=object_position_y(2,retreatf);
unit_attack_to_order(2,retreatf,x+5,y-5);
}
}if (num_type(2, "Red Coats")<20 && num_type(4,"Slingers")<1) {
create_unit(4,235,55,"Slingers",1);
popup_dialog("Sire! III Corps has been broken and is retreating!");
for (e6=num_type(2,"Red Coats"); e6>0; e6--) {
retreat6=find_unit(2,"Red Coats");
unit_stance_order(2,retreat6,"Stand Ground");
unit_move_order(2,retreat6,16,205);
}
}if (num_type(2, "Janissaries")<30 && num_type(2,"Militia")<1) {
create_unit(2,6,228,"Militia",1);
popup_dialog("Lannes' V Corps is falling back!");
remove_objective("advance_1");
play_sound("fallback.wav");
for (e7=num_type(2,"Janissaries"); e7>0; e7--) {
retreat7=find_unit(2,"Janissaries");
x=object_position_x(2,retreat7);
y=object_position_y(2,retreat7);
unit_stance_order(2,retreat7,"Stand Ground");
unit_move_order(2,retreat7,x-20,y+20);
}
}if (num_type(2, "Janissaries")<20 && num_type(4,"Militia")<1) {
create_unit(4,237,54,"Militia",1);
popup_dialog("V Corps has been broken and is retreating!");
for (e8=num_type(2,"Janissaries"); e8>0; e8--) {
retreat8=find_unit(2,"Janissaries");
unit_stance_order(2,retreat8,"Stand Ground");
unit_move_order(2,retreat8,23,72);
}
}if (num_type(2, "Imperial Guard")<15 && num_type(4,"Supply Wagon")<1) {
create_unit(4,237,52,"Supply Wagon",1);
remove_objective("advance_5");
popup_dialog("Sire! The Imperial Guard has been broken and is retreating! The battle has turned against us!");
for (e10=num_type(2,"Imperial Guard"); e10>0; e10--) {
retreat10=find_unit(2,"Imperial Guard");
unit_stance_order(2,retreat10,"Stand Ground");
unit_move_order(2,retreat10,11,92);
}
}if (num_type(2, "Cuirassier")<8 && num_type(2,"Spy")<1) {
create_unit(2,6,226,"Spy",1);
for (e11=num_type(2,"Cuirassier"); e11>0; e11--) {
retreat11=find_unit(2,"Cuirassier");
unit_stance_order(2,retreat11,"Stand Ground");
unit_move_order(2,retreat11,12,107);
}
}if (num_type(2, "Hussar")<8 && num_type(4,"Spy")<1) {
create_unit(4,237,51,"Spy",1);
for (e12=num_type(2,"Hussar"); e12>0; e12--) {
retreat12=find_unit(2,"Hussar");
unit_stance_order(2,retreat12,"Stand Ground");
unit_move_order(2,retreat12,12,109);
}
}if (num_type(2, "Horse Grenadier")<8 && num_type(4,"Catapult")<1) {
create_unit(4,237,50,"Catapult",1);
for (e13=num_type(2,"Horse Grenadier"); e13>0; e13--) {
retreat13=find_unit(2,"Horse Grenadier");
unit_stance_order(2,retreat13,"Stand Ground");
unit_move_order(2,retreat13,12,112);
}
}if (num_type(2, "Horse Grenadier")<8 && num_type(2,"Hussar")<8 && num_type(2,"Cuirassier")<8 && num_type(2,"Catapult")<1) {
create_unit(2,6,224,"Catapult",1);
remove_objective("advance_4");
popup_dialog("Sire! Murat's cavalry has been driven off the field!");
} if (num_type(3, "Fusiliers")<40 && num_type(3,"Merchant")<1) {
create_unit(3,209,4,"Merchant",1);
popup_dialog("Bagration's Corps has been broken!");
for (g1=num_type(3,"Fusiliers"); g1>0; g1--) {
rus_retreat1=find_unit(3,"Fusiliers");
unit_stance_order(3,rus_retreat1,"Stand Ground");
unit_move_order(3,rus_retreat1,155,12);
}
}if (num_type(3, "Imperial Guard")<35 && num_type(3,"Scholar")<1) {
create_unit(3,210,4,"Scholar",1);
popup_dialog("The Russian Imperial Guard is falling back!");
for (g2=num_type(3,"Imperial Guard"); g2>0; g2--) {
rus_retreat2=find_unit(3,"Imperial Guard");
x=object_position_x(3,rus_retreat2);
y=object_position_y(3,rus_retreat2);
unit_stance_order(3,rus_retreat2,"Stand Ground");
unit_move_order(3,rus_retreat2,x+20,y-20);
}
}if (num_type(3, "Imperial Guard")<25 && num_type(3,"Militia")<1) {
create_unit(3,211,4,"Militia",1);
popup_dialog("The Russian Imperial Guard has been broken!");
for (g3=num_type(3,"Imperial Guard"); g3>0; g3--) {
rus_retreat3=find_unit(3,"Imperial Guard");
unit_stance_order(3,rus_retreat3,"Stand Ground");
unit_move_order(3,rus_retreat3,212,59);
}
}if (num_type(1, "Continental Marines")<45 && num_type(1,"Scholar")<1) {
create_unit(1,234,24,"Scholar",1);
popup_dialog("The Austrian center is falling back!");
for (h1=num_type(1,"Continental Marines"); h1>0; h1--) {
aus_retreat1=find_unit(1,"Continental Marines");
x=object_position_x(1,aus_retreat1);
y=object_position_y(1,aus_retreat1);
unit_stance_order(1,aus_retreat1,"Stand Ground");
unit_move_order(1,aus_retreat1,x+20,y-20);
} emp_retreat=find_unit(1,"Wellington");
x=object_position_x(1,emp_retreat);
y=object_position_y(1,emp_retreat);
unit_move_order(1,emp_retreat,x+20,y-20);
}if (num_type(1, "Continental Marines")<35 && num_type(1,"Militia")<1) {
create_unit(1,234,23,"Militia",1);
popup_dialog("The Austrian center has broken!");
for (h2=num_type(1,"Continental Marines"); h2>0; h2--) {
aus_retreat2=find_unit(1,"Continental Marines");
unit_stance_order(1,aus_retreat2,"Stand Ground");
unit_move_order(1,aus_retreat2,221,47);
} emp_retreat2=find_unit(1,"Wellington");
x=object_position_x(1,emp_retreat2);
y=object_position_y(1,emp_retreat2);
unit_move_order(1,emp_retreat2,x+20,y-20);
}if (num_type(1, "Junkers")<45 && num_type(1,"Caravan")<1) {
create_unit(1,234,22,"Caravan",1);
popup_dialog("The Austrian left is falling back!");
for (h3=num_type(1,"Junkers"); h3>0; h3--) {
aus_retreat3=find_unit(1,"Junkers");
x=object_position_x(1,aus_retreat3);
y=object_position_y(1,aus_retreat3);
unit_stance_order(1,aus_retreat3,"Stand Ground");
unit_move_order(1,aus_retreat3,x+20,y-20);
} emp_retreat3=find_unit(1,"Wellington");
x=object_position_x(1,emp_retreat3);
y=object_position_y(1,emp_retreat3);
unit_move_order(1,emp_retreat3,x+20,y-20);
}if (num_type(1, "Junkers")<35 && num_type(1,"Spy")<1) {
create_unit(1,234,21,"Spy",1);
popup_dialog("The Austrian left has broken!");
for (h4=num_type(1,"Junkers"); h4>0; h4--) {
aus_retreat4=find_unit(1,"Junkers");
unit_stance_order(1,aus_retreat4,"Stand Ground");
unit_move_order(1,aus_retreat4,231,108);
} emp_retreat4=find_unit(1,"Wellington");
x=object_position_x(1,emp_retreat4);
y=object_position_y(1,emp_retreat4);
unit_move_order(1,emp_retreat4,x+20,y-20);
}if (num_type(1, "Don Cossack")<10 && num_type(1,"Merchant")<1) {
create_unit(1,234,20,"Merchant",1);
for (h5=num_type(1,"Don Cossack"); h5>0; h5--) {
aus_retreat5=find_unit(1,"Don Cossack");
unit_stance_order(1,aus_retreat5,"Stand Ground");
unit_move_order(1,aus_retreat5,222,20);
}
}if (num_type(1, "Horse Guard Grenadier")<10 && num_type(1,"Slingers")<1) {
create_unit(1,234,19,"Slingers",1);
for (h6=num_type(1,"Horse Guard Grenadier"); h6>0; h6--) {
aus_retreat6=find_unit(1,"Horse Guard Grenadier");
unit_stance_order(1,aus_retreat6,"Stand Ground");
unit_move_order(1,aus_retreat6,223,20);
}
}if (num_type(1, "Horse Guard Grenadier")<10 && num_type(1,"Dragoon")<1) {
create_unit(1,234,18,"Dragoon",1);
for (h7=num_type(1,"Horse Guard Grenadier"); h7>0; h7--) {
aus_retreat7=find_unit(1,"Horse Guard Grenadier");
unit_stance_order(1,aus_retreat7,"Stand Ground");
unit_move_order(1,aus_retreat7,225,20);
}
}if (num_type(1, "Horse Guard Grenadier")<10 && num_type(1,"Hussar")<10 && num_type(1,"Don Cossack")<10 && num_type(1,"Catapult")<1) {
create_unit(1,234,17,"Catapult",1);
popup_dialog("Sire! Lichtenstein's cavalry has been driven off the field!");
}
//Add triggers and other commands to be executed each game frame here.
//Use Edit->Insert Trigger Function to select from the list of available functions
//Use Edit->Insert Trigger Block to add a blank trigger block.
//See ./scenario/sample_script.bhs for additional documentation}