//========================================================================================== // // eltz_beta1.gm // // Who When What //------------------------------------------------------------------------------------------ // palota 17 August 2010 Initial Script // palota 5 September 2010 paththrough navigation // palota 23 October 2010 MOBILEMG42, ATTACK_cp, DEFEND goals availability // //========================================================================================== // global Map = { Debug = 0, elevatorPos = 4, objTaken = false, Switches = { zeppelingate = { Enabled = true, Priority = 0, WaypointName = "zeppelingate", Wait = function() { sleep(2.5); return true; } }, zeppelingate_axis = { Enabled = false, Priority = 0.65, WaypointName = "zeppelingate", LimitBots = 1, LimitTeam = (1< 0; Map.Switches.zeppelingate_axis.Enabled = !closed; if(closed){ sleep(3); } Map.Switches.zeppelingate.Enabled = closed; }, lift_trigger = function( trigger ) { if (ToVector(trigger.Action).z > 0) { Util.MapDebugPrint("elevator is moving up", true); Map.elevatorPos=1; Map.Switches.elevator_down_in.Enabled = false; Map.Switches.elevator_down_call.Enabled = true; sleep(8); Map.Switches.elevator_up_call.Enabled = false; Map.Switches.elevator_up_in.Enabled = true; Map.elevatorPos=2; sleep(2); Map.elevatorPos=3; }else{ Util.MapDebugPrint("elevator is moving down", true); Map.elevatorPos=4; Map.Switches.elevator_up_in.Enabled = false; Map.Switches.elevator_up_call.Enabled = true; sleep(8); Map.Switches.elevator_down_call.Enabled = false; Map.Switches.elevator_down_in.Enabled = true; Map.elevatorPos=5; sleep(2); Map.elevatorPos=6; } }, Zeppelin_Landed = function( trigger ) { if (ToVector(trigger.Action).z < 0) { SetAvailableMapGoals(TEAM.ALLIES, true, { "FLAG_crystals_obj", "CAPPOINT_.*", }); Util.EnableGoal("ROUTE_nach_teleport.*"); Util.MapDebugPrint( "Zeppelin_Landed" ); } }, }; global OnMapLoad = function() { // Register callback functions OnTrigger( "Allies destroyed the Tunnel Grate", Map.Tunnel_Entrance_Destroyed ); OnTrigger( "Axis has constructed the Generator! Gates are now Closed!", Map.Generator_Built ); OnTrigger( "The Generator has been Destroyed! Castle Gates are now Open!!!", Map.Generator_Destroyed ); OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_Command_Post_Built ); OnTrigger( "Axis team has destroyed the Allied Command Post!", Map.Allied_Command_Post_Destroyed ); OnTrigger( "allies have stolen the Crystals!", Map.crystals_obj_Taken ); OnTrigger( "Flag returned crystals_obj!", Map.crystals_obj_Returned ); OnTrigger( "rocdoor_lever_goto", Map.zeppelin_gate_trigger ); OnTrigger( "lift_goto", Map.lift_trigger ); OnTrigger( "zep_clip_goto", Map.Zeppelin_Landed ); Util.DisableGoal(".*zeppelin.*", true); Util.DisableGoal("FLAG_crystals_obj"); Util.DisableGoal("ROUTE_west_gate"); Util.DisableGoal("ROUTE_east_gate"); Util.DisableGoal("ROUTE_tunnel_entrance"); Util.DisableGoal("ROUTE_nach_teleport.*"); Util.LimitToTeam(TEAM.ALLIES, "ROUTE_crystals"); Util.LimitToTeam(TEAM.AXIS, "ROUTE_crystals_axis"); SetAvailableMapGoals(TEAM.AXIS, false, "ATTACK_.*"); SetAvailableMapGoals(TEAM.ALLIES, false, { "DEFEND_.*", ".*MINE_.*", "SNIPE_castle_tower", }); SetGoalPriority("DEFEND_crystals.*", 0.53); SetGoalPriority("DEFEND_village.*", 0.53); SetGoalPriority("DEFEND_cp4", 0.52); SetGoalPriority("DEFEND_zeppelin.*", 0.85); SetGoalPriority("SNIPE_.*zeppelin.*", 0.9); SetGoalPriority("FLAG.*", 0.86, TEAM.AXIS, 0, true); SetGoalPriority("FLAG_crystals_obj", 0.69, TEAM.ALLIES); SetGoalPriority("PLANT_Allied_Command_Post", 0.78, TEAM.AXIS, CLASS.ENGINEER); SetGoalPriority("PLANTMINE_cp.*", 0.8, TEAM.AXIS, CLASS.ENGINEER); // Max users per goal Util.SetMaxUsers( 1, "BUILD_.*" ); Util.SetMaxUsers( 1, "DEFEND_.*" ); // Camp times SetMapGoalProperties( "DEFEND_.*", {mincamptime=30, maxcamptime=80} ); SetMapGoalProperties( "SNIPE_.*", {mincamptime=250, maxcamptime=350} ); SetMapGoalProperties( "MOBILE_.*", {mincamptime=200, maxcamptime=300} ); MapRoutes = { BUILD_Allied_Command_Post = { ROUTE_allies = { ROUTE_village_east = { Weight=2 }, ROUTE_village_statue = { ROUTE_north_east_cave = {}}, ROUTE_village_statue2 = { Weight=0.5, ROUTE_village_bridge = {}}, ROUTE_village_west = { Weight=1.5 }, ROUTE_waterfall = { Weight=1.5 }, }, }, DEFEND_cp1 = { ROUTE_axis1 = { ROUTE_nach_dorf = { Weight=2 }, ROUTE_nach_dorf2 = {}, ROUTE_nach_teleport1 = { Weight = 2, ROUTE_crystals_west1 = { ROUTE_caves_entrance = {} }, ROUTE_crystals_west2 = { ROUTE_caves_entrance = {} }, }, ROUTE_nach_teleport2 = { Weight = 2, ROUTE_crystals_north2 = { ROUTE_caves_entrance = {} }, ROUTE_crystals_north3 = { ROUTE_caves_entrance = {} }, }, }, ROUTE_crystals_axis = { ROUTE_east_gate = { Weight = 2 }, ROUTE_west_gate = { Weight = 4 }, ROUTE_tunnel = { Weight = 2 }, ROUTE_crystals_north = { ROUTE_caves_entrance = {}}, ROUTE_crystals_west1 = {}, ROUTE_crystals_west2 = {}, }, }, MOBILEMG42_tunnel1 = { ROUTE_axis1 = { ROUTE_tunnel = {}, } }, FLAG_crystals_obj = { ROUTE_command_post = { ROUTE_east_gate = { Weight = 2 }, ROUTE_west_gate = { Weight = 2 }, ROUTE_tunnel_entrance = { ROUTE_tunnel = {} }, ROUTE_caves_entrance = { ROUTE_crystals_north1 = {}, ROUTE_crystals_north2 = {}, ROUTE_crystals_north3 = {}, ROUTE_crystals_west1 = { Weight=1.5 }, ROUTE_crystals_west2 = { Weight=1.5 }, }, } }, CAPPOINT_zeppelin = { ROUTE_crystals = { ROUTE_west_gate = { Weight = 5 }, ROUTE_caves_entrance = { Weight = 2 }, ROUTE_zeppelin_gate = {}, ROUTE_zeppelin_above_gate = {}, } }, }; MapRoutes.CAPPOINT_zeppelin.ROUTE_teleporter = MapRoutes.CAPPOINT_zeppelin.ROUTE_crystals; MapRoutes.FLAG_crystals_obj.ROUTE_allies = MapRoutes.BUILD_Allied_Command_Post.ROUTE_allies; MapRoutes.ATTACK_tunnel1 = MapRoutes.BUILD_Allied_Command_Post; MapRoutes.ATTACK_tunnel2 = MapRoutes.ATTACK_tunnel1; MapRoutes.PLANT_Generator = MapRoutes.BUILD_Allied_Command_Post; MapRoutes.ATTACK_generator1 = MapRoutes.PLANT_Generator; MapRoutes.ATTACK_generator2 = MapRoutes.ATTACK_generator1; MapRoutes.ATTACK_cp1 = MapRoutes.BUILD_Allied_Command_Post; MapRoutes.ATTACK_cp2 = MapRoutes.ATTACK_cp1; MapRoutes.DEFEND_cp1.ROUTE_axis2 = MapRoutes.DEFEND_cp1.ROUTE_axis1; MapRoutes.DEFEND_cp2 = MapRoutes.DEFEND_cp1; MapRoutes.DEFEND_cp3 = MapRoutes.DEFEND_cp1; MapRoutes.DEFEND_cp4 = MapRoutes.DEFEND_cp1; MapRoutes.DEFEND_cp5 = MapRoutes.DEFEND_cp1; MapRoutes.DEFEND_cp6 = MapRoutes.DEFEND_cp1; MapRoutes.DEFEND_generator1 = MapRoutes.DEFEND_cp1; MapRoutes.MOBILEMG42_tunnel1.ROUTE_axis2 = MapRoutes.MOBILEMG42_tunnel1.ROUTE_axis1; MapRoutes.MOBILEMG42_tunnel2 = MapRoutes.MOBILEMG42_tunnel1; Util.Routes(MapRoutes); Util.UpdateSwitchData(); Map.SetCommandPost(true); //must be called after UpdateSwitchData, because there is yield in SetPercentInProgress Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." ); }; global OnBotJoin = function( bot ) { bot.TargetBreakableDist = 80.0; };