//========================================================================================== // // fasthold_sp1.gm // // Who When What //------------------------------------------------------------------------------------------ // palota 23 March 2010 Initial Script // palota 3 December 2010 main gate has 2 use points, changed MaxUsersInProgress and priorities, added DEFEND_health // palota 3 December 2011 fixed ladders, role to defend train, ATTACK_train, coverspots // //========================================================================================== // global Map = { Debug=0, alliesFlag=false, cemeteryDestroyed=false, objTaken=0, radioDestroyed=false, bookSecured=false, Navigation = { hatch_out = { navigate = function(_this) { _this.Bot.PressButton(BTN.USE); _this.Bot.HoldButton(BTN.FORWARD,7); }, }, hatch_out2 = { navigate = function(_this) { _this.AddAimRequest(Priority.High, "facing", Vector3(0.1,0,1)); _this.Bot.HoldButton(BTN.FORWARD, 1); sleep(1); _this.Bot.PressButton(BTN.USE); _this.Bot.HoldButton(BTN.BACKWARD, 1); sleep(1); _this.Bot.HoldButton(BTN.FORWARD, 2.4); sleep(2.4); }, }, hatch_out3 = { navigate = function(_this) { _this.AddAimRequest(Priority.High, "facing", Vector3(0,0.1,1)); _this.Bot.HoldButton(BTN.FORWARD, 1.5); sleep(1.5); _this.Bot.PressButton(BTN.USE); _this.Bot.HoldButton(BTN.BACKWARD, 0.8); sleep(0.8); _this.Bot.HoldButton(BTN.FORWARD, 4); for(j=0; j<20; j+=1){ pos = _this.Bot.GetPosition(); if(pos.z>960){ break; } sleep(0.2); } _this.Bot.HoldButton(BTN.STRAFE_L, 1); sleep(1); }, }, }, Roles = { AXIS = { DEFENDER1 = { numbots = 2, spawnpt = 5 }, }, }, SetSpawn1 = function(bot) { if (bot.GetTeam() == TEAM.ALLIES){ if (Map.alliesFlag){ bot.ChangeSpawnPoint(4); } else if(Map.cemeteryDestroyed){ if (RandInt(0,2)>0) { bot.ChangeSpawnPoint(3); } else { bot.ChangeSpawnPoint(0); } }else{ if (RandInt(0,1)==0) { bot.ChangeSpawnPoint(3); } else { bot.ChangeSpawnPoint(0); } } }else{ if(Map.radioDestroyed && Map.bookSecured){ bot.ChangeSpawnPoint(5); } else if(!bot.HasRole(ROLE.DEFENDER1)){ bot.ChangeSpawnPoint(4); } } }, SetSpawn = function() { foreach(bot in BotTable) { Map.SetSpawn1(bot); } }, SetRopes = function(enabled) { Wp.SetWaypointFlag("rope_east", "closed", !enabled); Wp.SetWaypointFlag("rope_west", "closed", !enabled); SetAvailableMapGoals( TEAM.ALLIES, enabled, "ROUTE_rope_.*"); SetAvailableMapGoals( TEAM.AXIS, enabled, "ROUTE_rope_.*"); }, SetTruck = function(incr) { Map.objTaken+=incr; SetAvailableMapGoals( TEAM.AXIS, Map.objTaken>0, "ATTACK_truck.*"); }, SetTower = function() { if(Map.radioDestroyed && Map.bookSecured){ Util.ClearRoleForGoals("DEFEND_train.*", ROLE.DEFENDER1); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_.*"); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_train.*"); SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Inner_Rope_Ladders"); Util.SetMaxUsersInProgress(10, "FLAG_enigma_box"); Map.SetSpawn(); } }, Checkpoint_Captured = function(byAllies) { Map.alliesFlag=byAllies; if(byAllies){ p=0.5; } else { p=0.1; } SetGoalPriority( "DEFEND.*", p, TEAM.AXIS); SetGoalPriority( "DEFEND_gate.*", 0.5, TEAM.AXIS); SetGoalPriority( "DEFEND_train.*", 0.75, TEAM.AXIS); SetGoalPriority( "DEFEND_health.*", 0.5, TEAM.AXIS); SetGoalPriority( "DEFEND_stairs2", 0.6, TEAM.AXIS); if(byAllies){ p=0.1; } else { p=0.75; } SetGoalPriority( "BUILD_Train_Yard_MG", p, TEAM.AXIS); if(byAllies){ p=0.81; } else { p=0.65; } SetGoalPriority( "PLANT_Axis_Radio_Tower", p, TEAM.ALLIES); if(byAllies){ p=9; } else { p=1; } Util.SetMaxUsersInProgress(p, "FLAG_axis_book"); if(byAllies){ p=5; } else { p=2; } Util.SetMaxUsersInProgress(p, "CHECKPOINT_garage_forward_spawn"); SetAvailableMapGoals( TEAM.AXIS, byAllies, "HEALTHCAB_401"); SetAvailableMapGoals( TEAM.ALLIES, !byAllies, "SNIPE_allies.*"); Wp.SetWaypointFlag("jump_down", "closed", !byAllies); Map.SetSpawn(); }, Inner_Rope_Ladders_Built = function( trigger ) { Map.SetRopes(true); Util.MapDebugPrint( "Inner_Rope_Ladders_Built" ); }, Inner_Rope_Ladders_Destroyed = function( trigger ) { Map.SetRopes(false); Util.MapDebugPrint( "Inner_Rope_Ladders_Destroyed" ); }, Axis_Fasthold_Gate_Destroyed = function( trigger ) { Map.Checkpoint_Captured(true); SetAvailableMapGoals( TEAM.ALLIES, true, { "BUILD_Inner_Rope_Ladders", ".*Command_Post", }); SetGoalPriority( "DEFEND_stairs.*", 0.4, TEAM.AXIS); SetGoalPriority( "DEFEND_tower_book.*", 0.55, TEAM.AXIS); Util.EnableGoal("ROUTE_gate"); SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_gate.*"); SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_tower.*"); SetAvailableMapGoals( TEAM.AXIS, false, { "DEFEND_gate.*", ".*MG42.*", }); SetAvailableMapGoals( TEAM.AXIS, true, { "MOBILE.*", "TRIPMINE_tower.*", }); Util.MapDebugPrint( "Axis_Fasthold_Gate_Destroyed" ); }, Axis_Radio_Tower_Destroyed = function( trigger ) { Map.radioDestroyed = true; Map.SetTower(); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_radio.*"); SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_tower.*"); Util.MapDebugPrint( "Axis_Radio_Tower_Destroyed" ); }, Cemetery_Escape_Exit_Destroyed = function( trigger ) { Map.cemeteryDestroyed=true; Util.EnableGoal("ROUTE_cemetery"); Map.SetSpawn(); Util.MapDebugPrint( "Cemetery_Escape_Exit_Destroyed" ); }, Train_Car_Door_Destroyed = function( trigger ) { SetAvailableMapGoals( TEAM.ALLIES, true, "FLAG_enigma_box"); SetAvailableMapGoals( TEAM.ALLIES, false, "ATTACK_train.*"); Util.MapDebugPrint( "Train_Car_Door_Destroyed" ); }, axis_book_Taken = function( trigger ) { Map.SetTruck(1); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_tower_book.*"); Util.MapDebugPrint( "axis_book_Taken" ); }, axis_book_Returned = function( trigger ) { Map.SetTruck(-1); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_tower_book.*"); Util.MapDebugPrint( "axis_book_Returned" ); }, axis_book_Captured = function( trigger ) { Map.bookSecured = true; Map.SetTruck(-1); Map.SetTower(); SetAvailableMapGoals( TEAM.ALLIES, false, "FLAG_axis_book"); Util.MapDebugPrint( "axis_book_Captured" ); }, enigma_box_Taken = function( trigger ) { Map.SetTruck(1); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_train.*"); Util.MapDebugPrint( "enigma_box_Taken" ); }, enigma_box_Returned = function( trigger ) { Map.SetTruck(-1); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_train.*"); Util.MapDebugPrint( "enigma_box_Returned" ); }, enigma_box_Captured = function( trigger ) { Map.SetTruck(-1); SetAvailableMapGoals( TEAM.AXIS, false, "DEFEND_train.*"); SetAvailableMapGoals( TEAM.ALLIES, false, "FLAG_enigma_box"); Util.MapDebugPrint( "enigma_box_Captured" ); }, garage_forward_spawn_Axis_Captured = function( trigger ) { Map.Checkpoint_Captured(false); Util.MapDebugPrint( "garage_forward_spawn_Axis_Captured" ); }, garage_forward_spawn_Allies_Captured = function( trigger ) { Map.Checkpoint_Captured(true); Util.MapDebugPrint( "garage_forward_spawn_Allies_Captured" ); }, }; global OnMapLoad = function() { OnTrigger( "Allies capture the Garage!", Map.garage_forward_spawn_Allies_Captured ); OnTrigger( "Axis reclaims the Garage!", Map.garage_forward_spawn_Axis_Captured ); OnTrigger( "Allied team has destroyed the fasthold gate!", Map.Axis_Fasthold_Gate_Destroyed ); OnTrigger( "Allied team has destroyed the Catacomb Escape Exit!", Map.Cemetery_Escape_Exit_Destroyed ); OnTrigger( "Allied team has destroyed the Train Car Door!", Map.Train_Car_Door_Destroyed ); OnTrigger( "The Inner Rope Ladders have been built!", Map.Inner_Rope_Ladders_Built ); OnTrigger( "The Inner Rope Ladders have been destroyed!", Map.Inner_Rope_Ladders_Destroyed ); OnTrigger( "The Allies have stolen the Axis code book!", Map.axis_book_Taken ); OnTrigger( "Flag returned axis_book!", Map.axis_book_Returned ); OnTrigger( "The Allies have secured the Axis code book!", Map.axis_book_Captured ); OnTrigger( "The Allies have stolen the Engima box!", Map.enigma_box_Taken ); OnTrigger( "Flag returned enigma_box!", Map.enigma_box_Returned ); OnTrigger( "The Allies have secured the Engima box!", Map.enigma_box_Captured); OnTrigger( "Allied team has destroyed the Radio Tower!", Map.Axis_Radio_Tower_Destroyed ); Util.DisableGoal("AMMOCAB_secret"); Util.DisableGoal("HEALTHCAB_secret"); Util.DisableGoal("TRIPMINE.*"); Util.SetRoleForGoals("DEFEND_train.*", ROLE.DEFENDER1); SetAvailableMapGoals( TEAM.AXIS, false, { "CAPPOINT_truck", ".*MG42_top.*north.*", "ATTACK_truck.*", "MOBILE.*", }); SetAvailableMapGoals( TEAM.ALLIES, false, { ".*MG42.*", "FLAG_enigma_box", "ATTACK_tower.*", "BUILD_Inner_Rope_Ladders", ".*Command_Post", }); SetGoalPriority(".*MG42_top_.*south", 0.4, TEAM.AXIS); SetGoalPriority(".*MG42_top_south.*", 0.5, TEAM.AXIS); SetGoalPriority("PLANT_Inner_Rope_Ladders", 0.91, TEAM.AXIS, CLASS.COVERTOPS); SetGoalPriority("PLANT_Inner_Rope_Ladders", 0.76, TEAM.AXIS, CLASS.ENGINEER); SetGoalPriority("PLANT_Command_Post", 0.69, TEAM.AXIS); SetGoalPriority("FLAG.*", 0.65, TEAM.AXIS, 0, true); SetGoalPriority("DEFUSE_Cemetery.*", 0.75, TEAM.AXIS, 0, true); SetGoalPriority("ATTACK_truck.*", 0.61, TEAM.AXIS); SetGoalPriority("PLANT_Command_Post", 0.6, TEAM.ALLIES, CLASS.ENGINEER); SetGoalPriority("PLANT_Train_Yard_MG", 0.1, TEAM.ALLIES, CLASS.ENGINEER); SetGoalPriority("SNIPE_allies_roof", 0.81, TEAM.ALLIES); Util.SetMaxUsersInProgress(1, ".*MG42.*"); Util.SetMaxUsersInProgress(1, ".*Command_Post"); Util.SetMaxUsersInProgress(1, "DEFEND_stairs2"); Util.SetMaxUsersInProgress(1, "DEFEND_gate.*"); Util.SetMaxUsersInProgress(1, "DEFEND_tower_book.*"); Util.SetMaxUsersInProgress(8, "ATTACK_truck.*"); Util.SetMaxUsersInProgress(3, "ATTACK_train.*"); Util.SetMaxUsersInProgress(5, "ATTACK_gate.*"); Util.SetMaxUsersInProgress(2, "FLAG_enigma_box"); SetMapGoalProperties( "DEFEND_.*", {mincamptime=40, maxcamptime=120} ); SetMapGoalProperties( "SNIPE_.*", {mincamptime=60, maxcamptime=120} ); SetMapGoalProperties( "MOUNTMG42_.*", {mincamptime=90, maxcamptime=300} ); Util.SetGoalPosition(4196, -78, 408, "PLANT_Cemetery_Escape_Exit"); Util.SetGoalPosition(381, 1548, 408, "PLANT_Inner_Rope_Ladders"); Util.SetGoalOffset(50, 0, 0, "PLANT_Train_Car_Door"); Util.AddUsePoint("PLANT_Axis_Fasthold_Gate", {Vector3(866.014, -374.125, 408.125), Vector3(863.806, -329.875, 408.125)} ); Map.Checkpoint_Captured(false); Map.SetRopes(false); Util.DisableGoal("ROUTE_gate"); Util.DisableGoal("ROUTE_cemetery"); MapRoutes = { PLANT_Axis_Fasthold_Gate = { ROUTE_allies_spawn = { ROUTE_allies1 = {}, ROUTE_allies3 = {}, ROUTE_allies4 = {}, ROUTE_allies5 = {}, }, }, PLANT_Cemetery_Escape_Exit = { ROUTE_allies_spawn = { ROUTE_allies5 = {}, ROUTE_allies6 = {}, }, }, CHECKPOINT_garage_forward_spawn = { ROUTE_allies_spawn = { ROUTE_sewerage = { Weight=3 }, ROUTE_allies6 = { ROUTE_cemetery = {}, }, }, ROUTE_allies_spawn_east = { ROUTE_sewerage = {}, ROUTE_cemetery = { Weight=3 }, }, ROUTE_axis_spawn = { ROUTE_stairs = {}, ROUTE_ropes = {}, }, }, PLANT_Axis_Radio_Tower = { ROUTE_flag = { ROUTE_rope_east = { Weight=4 }, ROUTE_rope_west = { Weight=3 }, ROUTE_stairs = { Weight=2 }, }, }, CAPPOINT_truck = { ROUTE_book = { ROUTE_cemetery = { Weight=2, ROUTE_allies5 = {}, ROUTE_allies6 = {}, }, ROUTE_sewerage = { Weight=2 }, ROUTE_gate = { Weight=1 }, }, ROUTE_enigma_box = { ROUTE_allies1 = {}, ROUTE_train_back = {}, }, }, BUILD_Train_Yard_MG = { ROUTE_flag = { ROUTE_north_tunnel = {}, ROUTE_axis_door = {}, }, }, DEFEND_tower1 = { ROUTE_axis_spawn = { ROUTE_upstairs = {} }, }, }; MapRoutes.FLAG_axis_book = MapRoutes.PLANT_Axis_Radio_Tower; MapRoutes["ATTACK_gate.*"] = MapRoutes.PLANT_Axis_Fasthold_Gate; MapRoutes.DEFEND_tower2 = MapRoutes.DEFEND_tower1; MapRoutes.DEFEND_tower3 = MapRoutes.DEFEND_tower1; MapRoutes.DEFEND_radio = MapRoutes.DEFEND_tower1; Util.Routes(MapRoutes); }; global OnBotJoin = function( bot ) { if(bot.GetTeam()==TEAM.ALLIES){ bot.TargetBreakableDist = 70.0; } Map.SetSpawn1(bot); };