// cluedo.gm by IRATA [for Omni-bot version 0.61] // Updated for Omni-bot version 0.8 by Tardis ~ 18 June 2010 for cluedo 1.3 // // // History: // - Fixed Switches Tardis ~ 17 December 2010 // - let bots talk? added ~ Tardis ~ 18 June 2010 ~ End Game Only // - maybe let bots use transporter-switches - added paththough only ~ Tardis ~ 18 June 2010 // - add some nice sniper-spots outside added ~ Tardis ~ 18 June 2010 // - routing would be great added ~ Tardis ~ 18 June 2010 // - more waypoints outside ? - added ~ Tardis ~ 18 June 2010 // - resetAT just sets ATTACK/DEFENCE to false - taken out not used ~ Tardis ~ 18 June 2010 // - Spelling ~ billard = Billiard ~ Tardis ~ 18 June 2010 global Map = { Debug = 0, Allied_Command_Post_Dyno = 0, Axis_Command_Post_Dyno = 0, Neutral_Command_Post_Dyno = 0, lever_greenPos = 1, //switch is up initially lever_whitePos = 1, //switch is up initially lever_plumPos = 1, //switch is up initially lever_scarlettPos = 1, //switch is up initially lever_mustardPos = 1, //switch is up initially lever_peacockPos = 1, //switch is up initially lever_monkPos = 1, //switch is up initially billiardroom_flag_Axis_Captured = false, billiardroom_flag_Allies_Captured = false, conservatory_flag_Axis_Captured = false, conservatory_flag_Allies_Captured = false, diningroom_flag_Axis_Captured = false, diningroom_flag_Allies_Captured = false, kitchen_flag_Axis_Captured = false, kitchen_flag_Allies_Captured = false, library_flag_Axis_Captured = false, library_flag_Allies_Captured = false, lounge_flag_Axis_Captured = false, lounge_flag_Allies_Captured = false, study_flag_Axis_Captured = false, study_flag_Allies_Captured = false, Switches_conservatory_Enabled = false, Switches_kitchen_Enabled = false, Switches_study_Enabled = false, Switches_lounge_Enabled = false, Switches_diningroom_Enabled = false, Switches_billiardroom_Enabled = false, Switches_library_Enabled = false, lever_green_Enabled = false, //conservatory lever_white_Enabled = false, //kitchen lever_plum_Enabled = false, //study lever_scarlett_Enabled = false, //lounge lever_mustard_Enabled = false, //diningroom lever_peacock_Enabled = false, //billiardroom lever_monk_Enabled = false, //library DoorOpen = false, DoorClosed = true, // door is closed at start Talk = true, //set Talk to false if you don't want the bots to cheer after winning game: doorStart = Vector3(2109.987, 998.996, 24), doorEnd = Vector3(2110.159, 860.252, 24), Navigation = { door = { gotowp = "door", navigate = function(_this) { botId = _this.Bot.GetGameId(); for(i=0; i<15; i+=1) { // cs: note: the second to last param as the bots own id makes sure the trace ignores the bot tr = TraceLine(Map.doorStart, Map.doorEnd, null, TRACE.SHOT, botId, false); if (tr.fraction < 1) { sleep(0.2); } else { if(i>0){ sleep(0.4); } break; } } //_this.Bot.Say("door is open"); }, }, }, // /bot waypoint_setproperty paththrough Navigation_PT:door //switches //conservatory Switches = { conservatory = { Enabled = true, Priority = 0, //always set to 0 when using path through WaypointName = "conservatory", AimPosition = Vec3(2495.988, 2943.875, 70.996), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_greenPos == 0 ) { //wait 30 secs while the lever goes back up sleep(30); return true; } //always return false unless the lever is down: return false; }, }, //kitchen kitchen = { Enabled = true, //Priority = 0, //always set to 0 when using path through WaypointName = "kitchen", AimPosition = Vec3(1727.841, 2943.875, 70.750), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_whitePos == 0 ) { //wait 40 secs while the lever goes back up //Was 30 secs give player chance to get flag ! sleep(40); return true; } //always return false unless the lever is down: return false; }, }, //study study = { Enabled = true, Priority = 0, //always set to 0 when using path through WaypointName = "study", AimPosition = Vec3(3071.875, 1407.462, 71.276), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_plumPos == 0 ) { //wait 30 secs while the lever goes back up sleep(30); return true; } //always return false unless the lever is down: return false; }, }, //lounge lounge = { Enabled = true, Priority = 0, //always set to 0 when using path through WaypointName = "lounge", AimPosition = Vec3(1728.112, 960.125, 71.010), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_scarlettPos == 0 ) { //wait 30 secs while the lever goes back up sleep(30); return true; } //always return false unless the lever is down: return false; }, }, //diningroom diningroom = { Enabled = true, Priority = 0, //always set to 0 when using path through WaypointName = "diningroom", AimPosition = Vec3(1088.125, 1600.001, 70.996), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_mustardPos == 0 ) { //wait 30 secs while the lever goes back up sleep(30); return true; } //always return false unless the lever is down: return false; }, }, //billiardroom billiardroom = { Enabled = true, Priority = 0, //always set to 0 when using path through WaypointName = "billiardroom", AimPosition = Vec3(3071.875, 2431.715, 71.405), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_peacockPos == 0 ) { //wait 30 secs while the lever goes back up sleep(30); return true; } //always return false unless the lever is down: return false; }, }, //library library = { Enabled = true, Priority = 0, //always set to 0 when using path through WaypointName = "library", AimPosition = Vec3(3071.875, 1919.996, 70.967), LimitBots = 1, Timeout = 1500, LimitTeam = 0, // disabled initially. Wait = function() // bot wait a bit for slow moving lever { if ( Map.lever_monkPos == 0 ) { //wait 30 secs while the lever goes back up sleep(30); return true; } //always return false unless the lever is down: return false; }, }, }, //watch switches //conservatory lever_green = function( trigger ) { Enabled = true; if ( Map.lever_greenPos == 1 ) { Map.lever_greenPos = 0; Map.Switches.conservatory.Enabled = false; Wp.SetWaypointFlag("Con","closed",true); Util.MapDebugPrint( "conservatory_lever_down" ); } else { Map.lever_greenPos = 1; Map.Switches.conservatory.Enabled = true; Wp.SetWaypointFlag("Con","closed",false); Util.MapDebugPrint( "conservatory_lever_up"); } }, //kitchen lever_white = function( trigger ) { Enabled = true; if ( Map.lever_whitePos == 1 ) { Map.lever_whitePos = 0; Map.Switches.kitchen.Enabled = false; Util.DisableGoal ( "ATTACK_kitchen.*" ); Util.DisableGoal ( "DEFEND_defkitchen.*" ); Util.DisableGoal ( "SNIPE_kitchen.*" ); Wp.SetWaypointFlag("kitchen_window","closed",true); Wp.SetWaypointFlag("kitchen_window_1","closed",true); Wp.SetWaypointFlag("kitchen_a","closed",true); Wp.SetWaypointFlag("kitchen_water","closed",false); Wp.SetWaypointFlag("Kit","closed",true); Util.MapDebugPrint("kitchen_lever_down"); } else { Map.lever_whitePos = 1; Map.Switches.kitchen.Enabled = true; Wp.SetWaypointFlag("kitchen_window","closed",false); Wp.SetWaypointFlag("kitchen_window_1","closed",false); Wp.SetWaypointFlag("kitchen_a","closed",false); Wp.SetWaypointFlag("kitchen_water","closed",true); Wp.SetWaypointFlag("Kit","closed",false); Util.MapDebugPrint("kitchen_lever_up"); } }, //study lever_plum = function( trigger ) { Enabled = true; if ( Map.lever_plumPos == 1 ) { Map.lever_plumPos = 0; Map.Switches.study.Enabled = false; Wp.SetWaypointFlag("Stu","closed",true); Util.MapDebugPrint("study_lever_down"); } else { Map.lever_plumPos = 1; Map.Switches.study.Enabled = true; Wp.SetWaypointFlag("Stu","closed",false); Util.MapDebugPrint("study_lever_up"); } }, //lounge lever_scarlett = function( trigger ) { Enabled = true; if ( Map.lever_scarlettPos == 1 ) { Map.lever_scarlettPos = 0; Map.Switches.lounge.Enabled = false; Wp.SetWaypointFlag("Lou","closed",true); Util.MapDebugPrint("lounge_lever_down"); } else { Map.lever_scarlettPos = 1; Map.Switches.lounge.Enabled = true; Wp.SetWaypointFlag("Lou","closed",false); Util.MapDebugPrint("lounge_lever_up"); } }, //diningroom lever_mustard = function( trigger ) { Enabled = true; if ( Map.lever_mustardPos == 1 ) { Map.lever_mustardPos = 0; Map.Switches.diningroom.Enabled = false; Wp.SetWaypointFlag("Din","closed",true); Util.MapDebugPrint("dinningroom_lever_down"); } else { Map.lever_mustardPos = 1; Map.Switches.diningroom.Enabled = true; Wp.SetWaypointFlag("Din","closed",false); Util.MapDebugPrint("dinningroom_lever_up"); } }, //billiardroom lever_peacock = function( trigger ) { Enabled = true; if ( Map.lever_peacockPos == 1 ) { Map.lever_peacockPos = 0; Map.Switches.billiardroom.Enabled = false; Wp.SetWaypointFlag("Bil","closed",true); Util.MapDebugPrint("billiardroom_lever_down"); } else { Map.lever_peacockPos = 1; Map.Switches.billiardroom.Enabled = true; Wp.SetWaypointFlag("Bil","closed",false); Util.MapDebugPrint("billiardroom_lever_up"); } }, //library lever_monk = function( trigger ) { Enabled = true; if ( Map.lever_monkPos == 1 ) { Map.lever_monkPos = 0; Map.Switches.library.Enabled = false; Wp.SetWaypointFlag("Lib","closed",true); Util.MapDebugPrint("library_lever_down"); } else { Map.lever_monkPos = 1; Map.Switches.library.Enabled = true; Wp.SetWaypointFlag("Lib","closed",false); Util.MapDebugPrint("library_lever_up"); } }, //Get Flags // Lounge flag1_Get = function( trigger ) { Util.EnableGoal( "ATTACK_lounge.*" ); Util.EnableGoal( "CHECKPOINT_lounge_flag" ); Util.EnableGoal( "ROUTE_lounge" ); Util.EnableGoal( "ROUTE_lounge_1" ); Util.EnableGoal( "ROUTE_lounge_2" ); Util.EnableGoal( "ROUTE_lounge_3" ); Util.EnableGoal( "ROUTE_lounge_a" ); Wp.SetWaypointFlag("Lou","closed",false); Util.MapDebugPrint( "Get Lounge" ); }, // Dining-Room flag2_Get = function( trigger ) { Util.EnableGoal( "ATTACK_dining.*" ); Util.EnableGoal( "CHECKPOINT_diningroom_flag" ); Util.EnableGoal( "ROUTE_dinning" ); Util.EnableGoal( "ROUTE_dinning_1" ); Util.EnableGoal( "ROUTE_dinning_2" ); Util.EnableGoal( "ROUTE_dinning_a" ); Util.EnableGoal( "ROUTE_dinning_b" ); Util.EnableGoal( "ROUTE_dinning_c" ); Wp.SetWaypointFlag("Din","closed",false); Util.MapDebugPrint( "Get Dining-Room" ); }, // Kitchen flag3_Get = function( trigger ) { Util.EnableGoal( "ATTACK_kitchen.*" ); Util.EnableGoal( "CHECKPOINT_kitchen_flag" ); Util.EnableGoal( "ROUTE_kitchen_a" ); Util.EnableGoal( "ROUTE_kitchen_b" ); Util.EnableGoal( "ROUTE_kitchen_c" ); Wp.SetWaypointFlag("Kit","closed",false); Util.MapDebugPrint( "Get Kitchen" ); }, // Conservatory flag4_Get = function( trigger ) { Util.EnableGoal( "ATTACK_conservatory.*" ); Util.EnableGoal( "CHECKPOINT_conservatory_flag" ); Util.EnableGoal( "ROUTE_conservatory" ); Util.EnableGoal( "ROUTE_conservatory_1" ); Util.EnableGoal( "ROUTE_conservatory_2" ); Util.EnableGoal( "ROUTE_conservatory_3" ); Util.EnableGoal( "ROUTE_conservatory_a" ); Wp.SetWaypointFlag("Con","closed",false); Util.MapDebugPrint( "Get Conservatory" ); }, // Billiard-Room flag5_Get = function( trigger ) { Util.EnableGoal( "ATTACK_billiard.*" ); Util.EnableGoal( "CHECKPOINT_billiardroom_flag" ); Util.EnableGoal( "ROUTE_billard" ); Util.EnableGoal( "ROUTE_billard_1" ); Util.EnableGoal( "ROUTE_billard_2" ); Util.EnableGoal( "ROUTE_billard_a" ); Util.EnableGoal( "ROUTE_billard_b" ); Wp.SetWaypointFlag("Bil","closed",false); Util.MapDebugPrint( "Get Billiard" ); }, // Library flag6_Get = function( trigger ) { Util.EnableGoal( "ATTACK_library.*" ); Util.EnableGoal( "CHECKPOINT_library_flag" ); Util.EnableGoal( "ROUTE_library" ); Util.EnableGoal( "ROUTE_library_1" ); Util.EnableGoal( "ROUTE_library_a" ); Util.EnableGoal( "ROUTE_library_b" ); Wp.SetWaypointFlag("Lib","closed",false); Util.MapDebugPrint( "Get Library" ); }, // Study flag7_Get = function( trigger ) { Util.EnableGoal( "ATTACK_studdy.*" ); Util.EnableGoal( "CHECKPOINT_studdy_flag" ); Util.EnableGoal( "ROUTE_study" ); Util.EnableGoal( "ROUTE_study_1" ); Util.EnableGoal( "ROUTE_study_2" ); Util.EnableGoal( "ROUTE_study_a" ); Wp.SetWaypointFlag("Stu","closed",false); Util.MapDebugPrint( "Get Study" ); }, //Command Post Allied_Command_Post_Built = function( trigger ) { Util.MapDebugPrint( "Allied_Command_Post_Built" ); }, Allied_Command_Post_Planted = function( trigger ) { Map.Command_Post_Dyno += 1; Util.MapDebugPrint( "Command_Post_Planted" ); }, Allied_Command_Post_Defused = function( trigger ) { Map.Command_Post_Dyno -= 1; Util.MapDebugPrint( "Command_Post_Defused" ); }, Allied_Command_Post_Destroyed = function( trigger ) { Map.Command_Post_Dyno = 0; Util.MapDebugPrint( "Allied_Command_Post_Destroyed" ); }, Axis_Command_Post_Built = function( trigger ) { Util.MapDebugPrint( "Axis_Command_Post_Built" ); }, Axis_Command_Post_Planted = function( trigger ) { Map.Command_Post_Dyno += 1; Util.MapDebugPrint( "Command_Post_Planted" ); }, Axis_Command_Post_Defused = function( trigger ) { Map.Command_Post_Dyno -= 1; Util.MapDebugPrint( "Command_Post_Defused" ); }, Axis_Command_Post_Destroyed = function( trigger ) { Map.Command_Post_Dyno = 0; Util.MapDebugPrint( "Axis_Command_Post_Destroyed" ); }, //Flags Captured //billiardroom billiardroom_flag_Axis_Captured = function( trigger ) { SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_billiard.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_billiard.*" ); SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_defbilliard.*" ); SetAvailableMapGoals( TEAM.AXIS, true, "DEFEND_defbilliard.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "SNIPE_billard.*" ); SetAvailableMapGoals( TEAM.AXIS, false, "SNIPE_billard.*" ); SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_billiardroom_flag" ); Map.Switches.billiardroom.LimitTeam = (1<