//========================================================================================== // // battleship.gm // // Who When What //------------------------------------------------------------------------------------------ // ^1{WeB}^7*^4GA^1NG$^4TA^7* 12 September 2015 Initial Script // //========================================================================================== // global Map = { Debug = 1, // please set to zero before distributing your script ShowMovers = false, Allied_Command_Post_Dyno = 0, Assault_Ramp_Dyno = 0, Axis_Command_Post_Dyno = 0, Ship_Engine_One_Dyno = 0, Ship_Engine_Two_Dyno = 0, harbour_Wall_Dyno = 0, Allied_Command_Post_Built = function( trigger ) { if ( TestMap ) { return; } SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_harbour_Wall" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Harbour_1" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Harbour_2" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Harbour_3" ); Util.MapDebugPrint( "Allied_Command_Post_Built" ); }, Assault_Ramp_Built = function( trigger ) { if ( TestMap ) { return; } Util.MapDebugPrint( "Assault_Ramp_Built" ); }, Axis_Command_Post_Built = function( trigger ) { if ( TestMap ) { return; } Util.MapDebugPrint( "Axis_Command_Post_Built" ); }, Allied_Command_Post_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Allied_Command_Post_Dyno += 1; Util.MapDebugPrint( "Allied_Command_Post_Planted" ); }, Assault_Ramp_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Assault_Ramp_Dyno += 1; Util.MapDebugPrint( "Assault_Ramp_Planted" ); }, Axis_Command_Post_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Axis_Command_Post_Dyno += 1; Util.MapDebugPrint( "Axis_Command_Post_Planted" ); }, Ship_Engine_One_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_One_Dyno += 1; Util.MapDebugPrint( "Ship_Engine_One_Planted" ); }, Ship_Engine_2_NEW_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_One_Dyno += 1; Util.MapDebugPrint( "Ship_Engine_2_NEW_Planted" ); }, Ship_Engine_Two_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_Two_Dyno += 1; Util.MapDebugPrint( "Ship_Engine_Two_Planted" ); }, Ship_Engine_1_NEW_Planted = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_Two_Dyno += 1; Util.MapDebugPrint( "Ship_Engine_1_NEW_Planted" ); }, harbour_Wall_Planted = function( trigger ) { if ( TestMap ) { return; } Map.harbour_Wall_Dyno += 1; Util.MapDebugPrint( "harbour_Wall_Planted" ); }, Allied_Command_Post_Defused = function( trigger ) { if ( TestMap ) { return; } Map.Allied_Command_Post_Dyno -= 1; Util.MapDebugPrint( "Allied_Command_Post_Defused" ); }, Assault_Ramp_Defused = function( trigger ) { if ( TestMap ) { return; } Map.Assault_Ramp_Dyno -= 1; Util.MapDebugPrint( "Assault_Ramp_Defused" ); }, Axis_Command_Post_Defused = function( trigger ) { if ( TestMap ) { return; } Map.Axis_Command_Post_Dyno -= 1; Util.MapDebugPrint( "Axis_Command_Post_Defused" ); }, Ship_Engine_One_Defused = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_One_Dyno -= 1; Util.MapDebugPrint( "Ship_Engine_One_Defused" ); }, Ship_Engine_Two_Defused = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_Two_Dyno -= 1; Util.MapDebugPrint( "Ship_Engine_Two_Defused" ); }, harbour_Wall_Defused = function( trigger ) { if ( TestMap ) { return; } Map.harbour_Wall_Dyno -= 1; Util.MapDebugPrint( "harbour_Wall_Defused" ); }, Allied_Command_Post_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.Allied_Command_Post_Dyno = 0; Util.MapDebugPrint( "Allied_Command_Post_Destroyed" ); }, Assault_Ramp_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.Assault_Ramp_Dyno = 0; Util.MapDebugPrint( "Assault_Ramp_Destroyed" ); }, Axis_Command_Post_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.Axis_Command_Post_Dyno = 0; Util.MapDebugPrint( "Axis_Command_Post_Destroyed" ); }, Ship_Engine_One_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_One_Dyno = 0; Util.MapDebugPrint( "Ship_Engine_One_Destroyed" ); }, Ship_Engine_1_NEW_Destroyed = function( trigger ) { if ( TestMap ) { return; } SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ship_Engine_1_NEW" ); Map.Ship_Engine_One_Dyno = 0; Util.MapDebugPrint( "Ship_Engine_1_NEW_Destroyed" ); }, Ship_Engine_Two_Destroyed = function( trigger ) { if ( TestMap ) { return; } Map.Ship_Engine_Two_Dyno = 0; Util.MapDebugPrint( "Ship_Engine_Two_Destroyed" ); }, Ship_Engine_2_NEW_Destroyed = function( trigger ) { if ( TestMap ) { return; } SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ship_Engine_2_NEW" ); Map.Ship_Engine_Two_Dyno = 0; Util.MapDebugPrint( "Ship_Engine_2_NEW_Destroyed" ); }, harbour_Wall_Destroyed = function( trigger ) { if ( TestMap ) { return; } SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Assault_Ramp" ); SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Blast_Doors" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Harbour_4" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Harbour_5" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Harbour_1" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Harbour_2" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Harbour_3" ); Map.harbour_Wall_Dyno = 0; Util.MapDebugPrint( "harbour_Wall_Destroyed" ); }, Blast_Doors_Open = function( trigger ) { if ( TestMap ) { return; } SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Ship_Engine_1_NEW" ); SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Ship_Engine_2_NEW" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Engine_1" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Engine_2" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Engine_3" ); SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Engine_4" ); SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_Blast_Doors" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Engine_1" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Engine_2" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Engine_3" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Engine_4" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Ship_1" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Ship_2" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Ship_3" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Ship_4" ); Util.MapDebugPrint( "Blast_Doors_Open" ); }, }; global OnMapLoad = function() { if ( TestMapOn ) { Util.AutoTestMap(); } // Register callback functions OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_Command_Post_Built ); OnTrigger( "Allied Team have built the assault ramp!", Map.Assault_Ramp_Built ); OnTrigger( "Axis Command Post constructed. Charge speed increased!", Map.Axis_Command_Post_Built ); OnTrigger( "Planted at the Allied Command Post.", Map.Allied_Command_Post_Planted ); OnTrigger( "Planted at the MISSING_STRING.", Map.Assault_Ramp_Planted ); OnTrigger( "Planted at the Axis Command Post.", Map.Axis_Command_Post_Planted ); OnTrigger( "Planted at Ship Engine One.", Map.Ship_Engine_1_NEW_Planted ); OnTrigger( "Planted at Ship Engine Two.", Map.Ship_Engine_2_NEW_Planted ); OnTrigger( "Planted at the MISSING_STRING.", Map.harbour_Wall_Planted ); OnTrigger( "Defused at the Allied Command Post.", Map.Allied_Command_Post_Defused ); OnTrigger( "Defused at the MISSING_STRING.", Map.Assault_Ramp_Defused ); OnTrigger( "Defused at the Axis Command Post.", Map.Axis_Command_Post_Defused ); OnTrigger( "Defused at the MISSING_STRING.", Map.Ship_Engine_One_Defused ); OnTrigger( "Defused at the MISSING_STRING.", Map.Ship_Engine_Two_Defused ); OnTrigger( "Defused at the MISSING_STRING.", Map.harbour_Wall_Defused ); OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_Command_Post_Destroyed ); OnTrigger( "Axis have destroyed the assault ramp!", Map.Assault_Ramp_Destroyed ); OnTrigger( "Allied team has destroyed the Axis Command Post!", Map.Axis_Command_Post_Destroyed ); OnTrigger( "The Allies have destroyed Engine One!", Map.Ship_Engine_One_Destroyed ); OnTrigger( "The Allies have destroyed Engine One!", Map.Ship_Engine_1_NEW_Destroyed ); OnTrigger( "The Allies have destroyed Engine Two!", Map.Ship_Engine_Two_Destroyed ); OnTrigger( "The Allies have destroyed Engine Two!", Map.Ship_Engine_2_NEW_Destroyed ); OnTrigger( "The Allies have destroyed the harbour wall!", Map.harbour_Wall_Destroyed ); OnTrigger( "The Allies have opened the Engineroom Blast-Doors!", Map.Blast_Doors_Open ); SetGoalPriority( "SWITCH_Blast_Doors", 0.91 ); SetGoalPriority( "PLANT_Ship_Engine_1_NEW", 0.91 ); SetGoalPriority( "PLANT_Ship_Engine_2_NEW", 0.91 ); SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Assault_Ramp" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_harbour_Wall" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ship_Engine_One" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ship_Engine_1_NEW" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ship_Engine_Two" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Ship_Engine_2_NEW" ); SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_Blast_Doors" ); SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_Command_Post" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Engine_1" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Engine_2" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Engine_3" ); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_Engine_4" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Harbour_4" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Harbour_5" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Ship_1" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Ship_2" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Ship_3" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_Ship_4" ); SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Axis_Command_Post" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Harbour_1" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Harbour_2" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Harbour_3" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Engine_1" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Engine_2" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Engine_3" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Engine_4" ); //~Util.DisableGoal( ".*", true ); // all but routes //~SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_.*" ); //~SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_.*" ); // Max users per goal //Util.SetMaxUsers( 1, "DEFEND_.*" ); //Util.SetMaxUsers( 1, "GRENADE_.*" ); //Util.SetMaxUsers( 1, "MOUNTMG42_.*" ); // Camp times SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} ); SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=10, MaxCampTime=60} ); Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." ); }; global OnBotJoin = function( bot ) { // Uncomment for shootable breakables //~bot.TargetBreakableDist = 90.0; // Only set MaxViewDistance on maps with limited sight (e.g. fog) //~bot.MaxViewDistance = 2400; }; global InitializeRoutes = function() { MapRoutes = { BUILD_Assault_Ramp = { }, BUILD_Allied_Command_Post = { }, BUILD_Axis_Command_Post = { }, PLANT_Ship_Engine_One = { }, PLANT_harbour_Wall = { }, PLANT_Axis_Command_Post = { }, PLANT_Ship_Engine_Two = { }, PLANT_Assault_Ramp = { }, PLANT_Allied_Command_Post = { }, }; Util.Routes(MapRoutes); };