[Gcblue-commits] gcb_wx/scripts AI.py,1.19,1.20 HotKey.py,1.3,1.4 UnitCommands.py,1.14,1.15
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:08
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/scripts Modified Files: AI.py HotKey.py UnitCommands.py Log Message: Index: HotKey.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/HotKey.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HotKey.py 9 Dec 2003 00:36:03 -0000 1.3 --- HotKey.py 10 Mar 2005 03:28:28 -0000 1.4 *************** *** 5,9 **** #UnitInfo.DisplayMessage(key) if (key == '1'): ! SetFractionalSpeed(UnitInfo, 0.4, 1) # last argument set to 1 to print message elif (key == '2'): SetFractionalSpeed(UnitInfo, 0.75, 1) --- 5,13 ---- #UnitInfo.DisplayMessage(key) if (key == '1'): ! if (UnitInfo.IsHelo()): ! SetFractionalSpeed(UnitInfo, 0.05, 1) # near hover for helo ! else: ! # last argument set to 1 to print message ! SetFractionalSpeed(UnitInfo, 0.4, 1) elif (key == '2'): SetFractionalSpeed(UnitInfo, 0.75, 1) *************** *** 12,15 **** --- 16,21 ---- elif (key == '4'): SetFractionalSpeed(UnitInfo, 1.1, 1) # afterburners or emergency power + elif (key == 'e'): + ToggleEngageAll(UnitInfo) elif (key == 'h'): UnitInfo.GetUserInput('SetHeading','Heading') Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AI.py 8 Mar 2005 00:41:48 -0000 1.19 --- AI.py 10 Mar 2005 03:28:27 -0000 1.20 *************** *** 224,228 **** best_target, best_launcher = GetImmediateTarget(UI) if (best_target != -1): ! UI.DisplayMessage('%s: targ: %d, lau: %d' % (UI.GetName(), best_target, best_launcher)) launcher_info = UI.GetLauncherInfo(best_launcher) if (launcher_info.IsValid()): --- 224,228 ---- best_target, best_launcher = GetImmediateTarget(UI) if (best_target != -1): ! #UI.DisplayMessage('%s: targ: %d, lau: %d' % (UI.GetName(), best_target, best_launcher)) launcher_info = UI.GetLauncherInfo(best_launcher) if (launcher_info.IsValid()): *************** *** 236,239 **** --- 236,241 ---- else: TI.SetMemoryValue(2, 0) + #else: + #UI.DisplayMessage('%s: no targets' % UI.GetName()) if (engage_mode == 1): # turn to target *************** *** 249,253 **** if (GetConnControl(BB)): UI.SetHeading(target_bearing-launcher_angle) ! engagement_angle = target_bearing - launcher_angle if (engagement_angle > 180.0): --- 251,255 ---- if (GetConnControl(BB)): UI.SetHeading(target_bearing-launcher_angle) ! engagement_angle = target_bearing - launcher_angle if (engagement_angle > 180.0): *************** *** 257,267 **** if (engagement_angle <= 0.5 * sector_width): EngageTargetWithLauncher(UI, launcher) ! TI.SetMemoryValue(2, 2) ! TI.SetUpdateInterval(10.0) # wait 10 seconds - if (engage_mode >= 2): - TI.SetMemoryValue(2, 0) # return to search mode - TI.SetUpdateInterval(20.0) - ReleaseConnControl(BB) --- 259,269 ---- if (engagement_angle <= 0.5 * sector_width): EngageTargetWithLauncher(UI, launcher) ! TI.SetMemoryValue(2, 0) ! TI.SetUpdateInterval(1.0) # wait 1 seconds ! ReleaseConnControl(BB) ! # set for "fire and forget" this way ! # add check here for semiactive guidance that requires keeping FC radar on target ! # for duration of engagement *************** *** 292,306 **** track_info = track_list.GetTrack(n) track_id = track_info.ID ! staleness = track_info.Time - current_time engaged_count = track_info.GetEngagedCount() ! if (track_info.IsAir() or track_info.IsMissile()): max_engaged_count = 2 else: max_engaged_count = 6 ! if ((engaged_count < max_engaged_count) and (staleness < 15.0)): UI.SetTarget(track_id) launcher_info = UI.GetBestLauncher() launcher_idx = launcher_info.Launcher if (launcher_idx != -1): target_range = UI.GetRangeToTarget() --- 294,311 ---- track_info = track_list.GetTrack(n) track_id = track_info.ID ! staleness = current_time - track_info.Time ! bearing_only = track_info.IsBearingOnly() engaged_count = track_info.GetEngagedCount() ! if (track_info.IsAir() or track_info.IsMissile() or track_info.IsSub()): max_engaged_count = 2 else: max_engaged_count = 6 + #UI.DisplayMessage('Track %d, %.0f/%d/%d' % (track_id, staleness, bearing_only, engaged_count)) ! if ((engaged_count < max_engaged_count) and (staleness < 15.0) and (not bearing_only)): UI.SetTarget(track_id) launcher_info = UI.GetBestLauncher() launcher_idx = launcher_info.Launcher + #UI.DisplayMessage('Best launcher %d' % launcher_idx) if (launcher_idx != -1): target_range = UI.GetRangeToTarget() Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** UnitCommands.py 2 Mar 2005 22:28:41 -0000 1.14 --- UnitCommands.py 10 Mar 2005 03:28:28 -0000 1.15 *************** *** 3,6 **** --- 3,14 ---- UI.AddTask('EngageAll', 2.0) + def ToggleEngageAll(UI): + if (UI.TaskExists('EngageAll')): + UI.DeleteTask('EngageAll') + else: + UI.AddTask('EngageAll', 2.0) + + + def AddWaypointOrderGroup(GI, lon, lat): unit_count = GI.GetUnitCount() *************** *** 235,238 **** --- 243,248 ---- UI.DisplayMessage('Set throttle to afterburn') else: + if (k > 1): + k = 1 max_speed = UI.GetMaxSpeed() UI.SetSpeed(k*max_speed) |