2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/FRED2/MissionSave.h $
15 * Mission saving in Fred.
18 * Revision 1.2 2002/06/09 04:41:13 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 4 1/19/99 3:57p Andsager
26 * Round 2 of variables
28 * 3 10/29/98 6:49p Dave
29 * Finished up Fred support for externalizing mission and campaign files.
31 * 2 10/07/98 6:28p Dave
32 * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
33 * Fred. Globalized mission and campaign file extensions. Removed Silent
34 * Threat specific code.
36 * 1 10/07/98 3:00p Dave
38 * 21 9/10/98 1:17p Dave
39 * Put in code to flag missions and campaigns as being MD or not in Fred
40 * and Freespace. Put in multiplayer support for filtering out MD
41 * missions. Put in multiplayer popups for warning of non-valid missions.
43 * 20 4/14/98 11:55a Allender
44 * add end-of-campaign sexpression to allow for mission replay at the end
47 * 19 3/05/98 3:59p Hoffoss
48 * Added a bunch of new command brief stuff, and asteroid initialization
51 * 18 9/30/97 5:56p Hoffoss
52 * Added music selection combo boxes to Fred.
54 * 17 8/25/97 5:56p Hoffoss
55 * Added multiple asteroid field support, loading and saving of asteroid
56 * fields, and ship score field to Fred.
58 * 16 8/17/97 10:22p Hoffoss
59 * Fixed several bugs in Fred with Undo feature. In the process, recoded
62 * 15 6/17/97 3:01p Lawrance
63 * allow FRED to save new briefing format
65 * 14 6/09/97 4:57p Hoffoss
66 * Added autosave and undo to Fred.
68 * 13 6/05/97 6:10p Hoffoss
69 * Added features: Autosaving, object hiding. Also fixed some minor bugs.
71 * 12 5/13/97 10:52a Hoffoss
72 * Added campaign saving code.
74 * 11 4/21/97 5:02p Hoffoss
75 * Player/player status editing supported, and both saved and loaded from
78 * 10 4/16/97 2:05p Hoffoss
79 * Mission saving and loading of turret info now implemented.
81 * 9 3/10/97 6:43p Hoffoss
82 * Standardized docking goal usage by fred to use names instead of
85 * 8 2/05/97 2:57p Hoffoss
86 * Added support for wing goals (initial orders) in Fred.
88 * 7 1/30/97 2:24p Hoffoss
89 * Added remaining mission file structures and implemented load/save of
95 #ifndef __MISSION_SAVE_CPP__
96 #define __MISSION_SAVE_CPP__
99 #include "missionparse.h"
104 #define BACKUP_DEPTH 9
106 class CFred_mission_save {
112 int save_mission_info();
113 int save_plot_info();
114 int save_variables();
115 // int save_briefing_info();
116 int save_cmd_brief();
117 int save_cmd_briefs();
119 int save_debriefing();
122 int save_common_object_data(object *objp, ship *shipp);
125 int save_waypoints();
126 int save_waypoint_list(waypoint_list &w);
127 int save_vector(vector &v);
128 int save_matrix(matrix &m);
131 int save_asteroid_fields();
133 void save_campaign_sexp(int node, int link);
136 void save_turret_info(ship_subsys *ptr, int ship);
138 int save_reinforcements();
139 void save_ai_goals(ai_goals *goalp, int ship);
140 int fout(char *format, ...);
141 int fout_ext(char *format, ...);
142 void parse_comments(int = 1);
143 CFred_mission_save() : err(0), raw_ptr(Mission_text_raw) { }
144 int save_mission_file(char *pathname);
145 int autosave_mission_file(char *pathname);
146 int save_campaign_file(char *pathname);