// cs: possibly remove fake switch hack ... /******************************************************************************* Filename: escape2.gm Created by Advieszeur in 2008 Updated for 0.8 by d00d Last Updated: Sun, June 20 2010 Change log: - major comment cleanup (d00d) - use points for some plant goals (d00d) - changed priority of BUILD_assault_ramp to 0.8 (d00d) - added AimPosition to switch (d00d) - added MAP_TALK checks (d00d) - removed plant goal hacks, added user-defined plant goals (d00d) - fixed MG42 repair/mount goals (d00d) - script formatting (d00d) - removed WatchForWaypoint stuff (d00d) - Tweaking (Advieszeur) -------------------------------------------------------------------------------- Map description: Allied pow's has to make an escape attempt. To do that they must either: - Get access to the central area 1. Construct an assault ramp, to gain access to the axis lookout passageway 2. Break 1 or more of the 3 fences 3. Get to the maingate, and blow that up, this will make the lookout spawn permanent. - Get access to the main entrance 1. Steal the big shell from the ammo bunker, take it to the gun and fire it to blow the wall. 2. Blow the ammo cache on the third floor in the ammobunker to get access to the tunnel or roof route - Escape with the codebook 1. steal the codebook 2. repairing the gate control for opening the gate 3. escape with the book to truck outside the main entrance. -------------------------------------------------------------------------------- *** MAP GOALS *** //MG objects MOUNTMG42_141 //MG Outside Lookout MOUNTMG42_189 //MG INSIDE Lookout MOUNTMG42_187 //MG2 INSIDE Lookout MOUNTMG42_802 //MG1 Fallback MOUNTMG42_799 //MG2 Fallback REPAIRMG42_799 //MG2 Fallback REPAIRMG42_802 //MG1 Fallback REPAIRMG42_141 //MG Outside Lookout REPAIRMG42_189 //MG INSIDE Lookout REPAIRMG42_187 //MG2 INSIDE Lookout CHECKPOINT_forward_spawn //CTF /// ALLIES MAP GOALS /// FLAG_ctf2_script //Object codebook FLAG_ctf1_script //Object Shell for gun CAPPOINT_BigGun //return shell object to Gun CAPPOINT_Exit //return codebook to Exit home CAPPOINT_cp_control CAPPOINT_cp_health CAPPOINT_cp_dinner SNIPE_lookout_allies //Sniperspot Allies (lookout) BUILD_pile_of_crates BUILD_Command_Post //Command Post BUILD_assault_ramp //Assault Ramp BUILD_gate_control //Gate Control PLANT_east_fence PLANT_west_fence PLANT_Wooden_barrier //Wooden barrier PLANT_Command_Post //Command Post Axis destroy /// AXIS MAP GOALS /// BUILD_Command_Post //Command Post Axis BUILD_Wooden_barrier //Wooden barrier BUILD_Command_Post //Command Post PLANT_pile_of_crates //Pile of Crates PLANT_gate_control //Gate Control PLANT_assault_ramp //Assault Ramp *******************************************************************************/ global Map = { //set status for conditionals PlantMines = false, Ammo_Destroyed = 0, assault_ramp_status = 0, // not built Gun_Fired = 0, CheckPoint_Ignore = 0, Allies_Lowspawn = 0, // 0=start, 1=westfence, 2=lookout, 3=maingate GamePhase = 0, // 0=Start, 1=middle, 2=end MainGate_down = 0, Main_Dyno = 0, // Dyno counts Say_Allies = 0, // Says count Say_Axis = 0, // Says count Gate_Exit = 0, // 0 = open, 1 = close Book_Stolen = 0, // 1 = book is stolen Cappoint_switch = 0, // set when first time is switched New_cp = 0, // increase TargetBreakableDist in this trigger region increasebreakabledist = { Name = "increasebreakabledist", TriggerOnClass = CLASS.ANYPLAYER, OnEnter = function(ent) { b = Util.IsBot(ent); if (b && b.GetTeam() == TEAM.ALLIES) { b.TargetBreakableDist = 200.0; } Util.MapDebugPrint( GetEntName(ent) + " entering." ); }, OnExit = function(ent) { b = Util.IsBot(ent); if (b) { b.TargetBreakableDist = 80.0; } Util.MapDebugPrint( GetEntName(ent) + " exiting." ); }, }, barrier_build_assist = { Name = "barrier_build_assist", TriggerOnClass = CLASS.ENGINEER, OnEnter = function(ent) { team = GetEntTeam(ent); name = GetEntName(ent); bot = Util.GetBotByName(name); if ( team == TEAM.ALLIES && Map.assault_ramp_status == 0 && Map.GamePhase < 1 ) { SetAvailableMapGoals( TEAM.ALLIES, true, { "DEFEND_build_ramp_assist.*", "SMOKEBOMB_east_fence.*", }); if ( bot && MAP_TALK ) { if (RandInt(0,1) == 0) { bot.SayVoice(VOICE.CONST_COMMENCING); } else if (RandInt(0,1) == 0) { bot.SayVoice(VOICE.COVER_ME); } } } Util.MapDebugPrint( name + " entering.", true ); sleep( 10 ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_build_ramp_assist.*" ); Util.MapDebugPrint( "Disabling DEFEND_build_ramp_assist.* goals." ); }, OnExit = function(ent) { Util.MapDebugPrint( GetEntName(ent) + " exiting.", true ); }, }, barrier_build_assist2 = { Name = "barrier_build_assist2", TriggerOnClass = CLASS.ANYPLAYER, OnEnter = function(ent) { team = GetEntTeam(ent); name = GetEntName(ent); bot = Util.GetBotByName(name); if ( team == TEAM.ALLIES && Map.assault_ramp_status == 0 && Map.GamePhase < 1 ) { if ( bot && MAP_TALK ) { if ( RandRange(0,1) < 0.2 ) { bot.SayVoice(VOICE.ALL_CLEAR); } else if ( RandRange(0,1) < 0.7 ) { bot.SayVoice(VOICE.ON_DEFENSE); } } } }, }, Switches = { FireGun = { Enabled = true, WaypointName = "GunSwitch", AimPosition = Vec3( 1823, 850, -293 ), LimitTeam = 0, //Only available on trigger LimitClass = (1< 2) // 70% Fallback 30% Bunker { bot.ChangeSpawnPoint( 3 ); // fallback } if ( Map.Gun_Fired == 1 ) // 100% Spawn at bunker { bot.ChangeSpawnPoint( 3 ); // fallback if ( MAP_TALK && RandInt(1,10) < 3 ) { bot.ExecCommand("vsay_team FTFallBack"); } } } else if ( bot.GetTeam() == TEAM.ALLIES && MAP_TALK ) { if ( RandInt(0,9) < 2) { bot.SayVoice(VOICE.COMMAND_COMPLETED); } } } Util.MapDebugPrint( "cache_Destroyed, Hill Path and Cellar path opened" ); }, Wall_Destroyed = function( trigger ) { Map.Gun_Fired = 1; Map.CheckPoint_Ignore = 1; Map.GamePhase = 2; Map.Say_Allies = 0; Map.Say_Axis == 0; //Disable Attackpoint Gun Map.Switches.FireGun.LimitTeam = 0 ; //Disable Gun Switch Map.Switches.FakeSwitch2.LimitTeam = 0; //For backdoor path flag where route failed SetAvailableMapGoals(TEAM.ALLIES, false, { "PLANT_fan", "PLANT_west_fence", "PLANT_east_fence", "SNIPE_lookout_allies", "PLANT_Wooden_barrier", "DEFEND_Dyno_maingate", "BUILD_assault_ramp", "ATTACK_Ammo1", "ATTACK_Assault_Ram", "ARTILLERY_S_Main.*", "CALLARTILLERY_ElectricSpot.*", }); SetAvailableMapGoals(TEAM.ALLIES, true, "BUILD_gate_control"); SetAvailableMapGoals(TEAM.ALLIES, true, "FLAG_ctf2_script"); //Codebook SetAvailableMapGoals(TEAM.ALLIES, true, "ATTACK_at_fake"); //Backside Fake Attack SetAvailableMapGoals(TEAM.ALLIES, true, "ATTACK_at_control"); //Gate control inside if ( Map.ammo_Destroyed == 1 ) //Spawn at bunker { SetAvailableMapGoals(TEAM.ALLIES, false, "BUILD_con3_script"); //Pile of Crates SetAvailableMapGoals(TEAM.ALLIES, false, "CHECKPOINT_forward_spawn"); //CTF - Flag is permanent now //SetAvailableMapGoals(TEAM.ALLIES, false, "BUILD_Command_Post"); //Command Post SetAvailableMapGoals(TEAM.ALLIES, true, { "DEFEND_fake", "DEFEND_cp_Control", }); SetAvailableMapGoals(TEAM.ALLIES, true, "SNIPE_s_FallBack"); //Sniperspot allies on MG Fallback SetAvailableMapGoals(TEAM.ALLIES, true, "ATTACK_a_fallback_top"); //Attack on top of Fallback spawn SetAvailableMapGoals(TEAM.ALLIES, true, "DEFEND_d_dinner"); //defend (dinnerroom window) SetAvailableMapGoals(TEAM.ALLIES, true, "DEFEND_d_fallback_topdoor"); //Top of Fallback //MG for Allies too SetAvailableMapGoals(TEAM.ALLIES, true, "MOUNTMG42_802"); //MG1 Fallback SetAvailableMapGoals(TEAM.ALLIES, true, "MOUNTMG42_799"); //MG2 Fallback //Make fakeswitch active only for Allies Engi's replacing the failing route to the backdoor Map.Switches.FakeSwitch.LimitTeam = (1< 1) // 60% Bunker, 40% Lookout { bot.ChangeSpawnPoint( 4 ); // Bunker Util.MapDebugPrint( "axisbot spawn 4" ); } else { bot.ChangeSpawnPoint( 0 ); // forward spawn Util.MapDebugPrint( "axisbot spawn 0" ); } } if (Map.GamePhase == 2) { bot.ChangeSpawnPoint( 3 ); // fallback } } //More distanceview for snipers yield();yield(); // wait two frames if ( bot.CanSnipe() ) { bot.MaxViewDistance = 3000.0; } };