View Issue Details

IDProjectCategoryView StatusLast Update
0001553FSSCPWCSagapublic2008-01-08 22:24
ReporterTolwyn Assigned ToGoober5000  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Summary0001553: Disable hard-coded autopilot
DescriptionStrictly speaking it is not a bug, but...

would it be possible to disable hard-coded autopilot either per sexp or per mission flag?

In missions with scripted autopilot the only feature we use is the nav point display, everything else interferes with our scripting. We are forced to use a pretty crazy hack to disable autopilot, which does not always work. It includes an invisible hostile ship and a reset-key sexp (Alt-A) combined with a distance check.
TagsNo tags attached.

Activities

KeldorKatarn

2008-01-06 01:32

reporter   ~0008783

Last edited: 2008-01-06 17:31

Check attached diff for possible solution

KeldorKatarn

2008-01-06 17:06

reporter   ~0008784

Last edited: 2008-01-06 17:31

Use the new2 diff, the other ones have a problem, the autopilot warnings about hazards or enemies were still played.
I don't know how to delete attachments here so can someone delete the older two?

2008-01-06 17:30

 

NoAutopilot_NEW2_Diff.txt (5,724 bytes)   
Index: fred.rc
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/fred2/fred.rc,v
retrieving revision 1.33
diff -u -r1.33 fred.rc
--- fred.rc	30 Dec 2007 18:30:28 -0000	1.33
+++ fred.rc	5 Jan 2008 19:51:34 -0000
@@ -986,6 +986,9 @@
     LTEXT           "Persona",IDC_STATIC,11,258,32,8
     CONTROL         "Use Autopilot Cinematics",IDC_USE_AUTOPILOT_CINEMATICS,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,118,123,10
+    CONTROL         "Deactivate Hardcoded Autopilot",
+                    IDC_DEACTIVATE_AUTOPILOT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,163,129,123,10
 END
 
 IDD_PREFERENCES DIALOG DISCARDABLE  0, 0, 333, 81
 
 
Index: missionnotesdlg.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/fred2/missionnotesdlg.cpp,v
retrieving revision 1.12
diff -u -r1.12 missionnotesdlg.cpp
--- missionnotesdlg.cpp	23 Jul 2007 15:16:48 -0000	1.12
+++ missionnotesdlg.cpp	5 Jan 2008 19:51:33 -0000
@@ -320,6 +320,7 @@
 	m_no_briefing = FALSE;
 	m_no_debriefing = FALSE;
 	m_autpilot_cinematics = FALSE;
+    m_no_autpilot = FALSE;
 	m_max_hull_repair_val = 0.0f;
 	m_max_subsys_repair_val = 100.0f;
 	m_contrail_threshold = CONTRAIL_THRESHOLD_DEFAULT;
@@ -365,6 +366,7 @@
 	DDX_Check(pDX, IDC_NO_BRIEFING, m_no_briefing);
 	DDX_Check(pDX, IDC_NO_DEBRIEFING, m_no_debriefing);
 	DDX_Check(pDX, IDC_USE_AUTOPILOT_CINEMATICS, m_autpilot_cinematics);
+    DDX_Check(pDX, IDC_DEACTIVATE_AUTOPILOT, m_no_autpilot);
 	DDX_Text(pDX, IDC_MAX_HULL_REPAIR_VAL, m_max_hull_repair_val);
 	DDV_MinMaxFloat(pDX, m_max_hull_repair_val, 0, 100);
 	DDX_Text(pDX, IDC_MAX_SUBSYS_REPAIR_VAL, m_max_subsys_repair_val);
@@ -577,6 +579,13 @@
 	} else {
 		The_mission.flags &= ~MISSION_FLAG_USE_AP_CINEMATICS;
 	}
+    
+    // set autopilot
+	if ( m_no_autpilot ) {
+		The_mission.flags |= MISSION_FLAG_DEACTIVATE_AP;
+	} else {
+		The_mission.flags &= ~MISSION_FLAG_DEACTIVATE_AP;
+	}
 
 	if ( flags != The_mission.flags ){
 		set_modified();
@@ -659,6 +668,7 @@
 	m_no_briefing = (The_mission.flags & MISSION_FLAG_NO_BRIEFING) ? 1 : 0;
 	m_no_debriefing = (The_mission.flags & MISSION_FLAG_NO_DEBRIEFING) ? 1 : 0;
 	m_autpilot_cinematics = (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) ? 1 : 0;
+    m_no_autpilot =  (The_mission.flags & MISSION_FLAG_DEACTIVATE_AP) ? 1 : 0;
 	
 
 	m_loading_640=_T(The_mission.loading_screen[GR_640]);
 	
 	
Index: missionnotesdlg.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/fred2/missionnotesdlg.h,v
retrieving revision 1.7
diff -u -r1.7 missionnotesdlg.h
--- missionnotesdlg.h	23 Jul 2007 15:16:48 -0000	1.7
+++ missionnotesdlg.h	5 Jan 2008 19:51:33 -0000
@@ -230,6 +230,7 @@
 	BOOL		m_no_briefing;
 	BOOL		m_no_debriefing;
 	BOOL		m_autpilot_cinematics;
+    BOOL		m_no_autpilot;
 	float		m_max_hull_repair_val;
 	float		m_max_subsys_repair_val;
 	BOOL		m_contrail_threshold_flag;
 	

Index: resource.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/fred2/resource.h,v
retrieving revision 1.25
diff -u -r1.25 resource.h
--- resource.h	30 Dec 2007 18:30:28 -0000	1.25
+++ resource.h	5 Jan 2008 19:51:33 -0000
@@ -1103,6 +1103,7 @@
 #define IDC_SKYBOX_MODEL                1594
 #define IDC_MINI_HELP_BOX               1595
 #define IDC_ALT_AS_CALLSIGN             1596
+#define IDC_DEACTIVATE_AUTOPILOT        1597
 #define ID_FILE_MISSIONNOTES            32771
 #define ID_DUPLICATE                    32774
 #define ID_VIEW_ROTATE                  32775
 

Index: keycontrol.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/io/keycontrol.cpp,v
retrieving revision 2.85
diff -u -r2.85 keycontrol.cpp
--- keycontrol.cpp	20 Nov 2007 01:11:12 -0000	2.85
+++ keycontrol.cpp	6 Jan 2008 12:25:39 -0000
@@ -3373,19 +3373,17 @@
 
 		// Autopilot key control
 		case AUTO_PILOT_TOGGLE:
-			if (AutoPilotEngaged)
-			{
-				EndAutoPilot();
-			}
-			else
-			{
-				if (CanAutopilot(true))
-				{
-					StartAutopilot();
-				}
-				else
-					gamesnd_play_iface(SND_GENERAL_FAIL);
-			}
+            if (!(The_mission.flags & MISSION_FLAG_DEACTIVATE_AP)) {
+                if (AutoPilotEngaged) {
+                    EndAutoPilot();
+                }
+                else if (CanAutopilot(true)) {
+                    StartAutopilot();
+                }
+                else {
+                    gamesnd_play_iface(SND_GENERAL_FAIL);
+                }
+            }
 			break;
 
 		case NAV_CYCLE:
 	

Index: missionparse.h
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/mission/missionparse.h,v
retrieving revision 2.104
diff -u -r2.104 missionparse.h
--- missionparse.h	30 Dec 2007 18:30:29 -0000	2.104
+++ missionparse.h	5 Jan 2008 19:51:33 -0000
@@ -670,6 +670,7 @@
 #define MISSION_FLAG_PLAYER_START_AI			(1<<19) // Player Starts mission under AI Control (NOT MULTI COMPATABLE) - Kazan
 #define MISSION_FLAG_ALL_ATTACK					(1<<20)	// all teams at war - Goober5000
 #define MISSION_FLAG_USE_AP_CINEMATICS			(1<<21) // Kazan - use autopilot cinematics
+#define MISSION_FLAG_DEACTIVATE_AP         	    (1<<22) // KeldorKatarn - deactivate autopilot
 
 // some mice macros for mission type
 #define IS_MISSION_MULTI_COOP			(The_mission.game_type & MISSION_TYPE_MULTI_COOP)
 
 
NoAutopilot_NEW2_Diff.txt (5,724 bytes)   

Kazan

2008-01-08 10:53

developer   ~0008792

Goob: any reason for this not to go in if it passes me reviewing the diff?

Kazan

2008-01-08 22:24

developer   ~0008797

patch approved and applied (requied by hand application, keldor's tree is out of sync)

Issue History

Date Modified Username Field Change
2008-01-02 19:40 Tolwyn New Issue
2008-01-06 01:32 KeldorKatarn File Added: NoAutopilot_Diff.txt
2008-01-06 01:32 KeldorKatarn Note Added: 0008783
2008-01-06 17:05 KeldorKatarn File Added: NoAutopilot_NEW_Diff.txt
2008-01-06 17:06 KeldorKatarn Note Added: 0008784
2008-01-06 17:30 KeldorKatarn File Added: NoAutopilot_NEW2_Diff.txt
2008-01-06 17:31 KeldorKatarn Note Edited: 0008784
2008-01-06 17:31 KeldorKatarn Note Edited: 0008783
2008-01-07 01:11 Goober5000 Status new => assigned
2008-01-07 01:11 Goober5000 Assigned To => Goober5000
2008-01-08 10:52 Kazan File Deleted: NoAutopilot_Diff.txt
2008-01-08 10:53 Kazan File Deleted: NoAutopilot_NEW_Diff.txt
2008-01-08 10:53 Kazan Note Added: 0008792
2008-01-08 22:24 Kazan Status assigned => resolved
2008-01-08 22:24 Kazan Resolution open => fixed
2008-01-08 22:24 Kazan Note Added: 0008797