FS2_Open
Open source remastering of the Freespace 2 engine
missionparse.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
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 the
6  * source.
7  *
8 */
9 
10 #ifndef _PARSE_H
11 #define _PARSE_H
12 
13 #include <setjmp.h>
14 
15 #include "ai/ai.h"
16 #include "ai/ai_profiles.h"
17 #include "graphics/2d.h"
18 #include "io/keycontrol.h"
19 #include "model/model.h"
20 #include "object/object.h"
21 #include "parse/sexp.h"
22 #include "sound/sound.h"
23 
24 //WMC - This should be here
25 #define FS_MISSION_FILE_EXT NOX(".fs2")
26 
27 struct wing;
28 struct p_dock_instance;
29 
30 #define NUM_NEBULAS 3 // how many background nebulas we have altogether
31 #define NUM_NEBULA_COLORS 9
32 
33 #define DEFAULT_AMBIENT_LIGHT_LEVEL 0x00787878
34 
35 // arrival anchor types
36 // mask should be high enough to avoid conflicting with ship anchors
37 #define SPECIAL_ARRIVAL_ANCHOR_FLAG 0x1000
38 #define SPECIAL_ARRIVAL_ANCHOR_PLAYER_FLAG 0x0100
39 
40 // update version when mission file format changes, and add approprate code
41 // to check loaded mission version numbers in the parse code. Also, be sure
42 // to update both MissionParse and MissionSave (FRED) when changing the
43 // mission file format!
44 #define MISSION_VERSION 0.10f
45 #define FRED_MISSION_VERSION 0.10f
46 
47 #define WING_PLAYER_BASE 0x80000 // used by Fred to tell ship_index in a wing points to a player
48 
49 // mission parse flags used for parse_mission() to tell what kind of information to get from the mission file
50 #define MPF_ONLY_MISSION_INFO (1 << 0)
51 #define MPF_IMPORT_FSM (1 << 1)
52 
53 // bitfield definitions for missions game types
54 #define OLD_MAX_GAME_TYPES 4 // needed for compatibility
55 #define OLD_GAME_TYPE_SINGLE_ONLY 0
56 #define OLD_GAME_TYPE_MULTI_ONLY 1
57 #define OLD_GAME_TYPE_SINGLE_MULTI 2
58 #define OLD_GAME_TYPE_TRAINING 3
59 
60 #define MAX_MISSION_TYPES 5
61 #define MISSION_TYPE_SINGLE (1<<0)
62 #define MISSION_TYPE_MULTI (1<<1)
63 #define MISSION_TYPE_TRAINING (1<<2)
64 #define MISSION_TYPE_MULTI_COOP (1<<3)
65 #define MISSION_TYPE_MULTI_TEAMS (1<<4)
66 #define MISSION_TYPE_MULTI_DOGFIGHT (1<<5)
67 
68 #define MISSION_FLAG_SUBSPACE (1<<0) // mission takes place in subspace
69 #define MISSION_FLAG_NO_PROMOTION (1<<1) // cannot get promoted or badges in this mission
70 #define MISSION_FLAG_FULLNEB (1<<2) // mission is a full nebula mission
71 #define MISSION_FLAG_NO_BUILTIN_MSGS (1<<3) // disables builtin msgs
72 #define MISSION_FLAG_NO_TRAITOR (1<<4) // player cannot become a traitor
73 #define MISSION_FLAG_TOGGLE_SHIP_TRAILS (1<<5) // toggles ship trails (off in nebula, on outside nebula)
74 #define MISSION_FLAG_SUPPORT_REPAIRS_HULL (1<<6) // Toggles support ship repair of ship hulls
75 #define MISSION_FLAG_BEAM_FREE_ALL_BY_DEFAULT (1<<7) // Beam-free-all by default - Goober5000
76 #define MISSION_FLAG_CURRENTLY_UNUSED_1 (1<<8)
77 #define MISSION_FLAG_CURRENTLY_UNUSED_2 (1<<9)
78 #define MISSION_FLAG_NO_BRIEFING (1<<10) // no briefing, jump right into mission - Goober5000
79 #define MISSION_FLAG_TOGGLE_DEBRIEFING (1<<11) // Turn on debriefing for dogfight. Off for everything else - Goober5000
80 #define MISSION_FLAG_CURRENTLY_UNUSED_3 (1<<12)
81 #define MISSION_FLAG_ALLOW_DOCK_TREES (1<<13) // toggle between hub and tree model for ship docking (see objectdock.cpp) - Gooober5000
82 #define MISSION_FLAG_2D_MISSION (1<<14) // Mission is meant to be played top-down style; 2D physics and movement.
83 #define MISSION_FLAG_CURRENTLY_UNUSED_4 (1<<15)
84 #define MISSION_FLAG_RED_ALERT (1<<16) // a red-alert mission - Goober5000
85 #define MISSION_FLAG_SCRAMBLE (1<<17) // a scramble mission - Goober5000
86 #define MISSION_FLAG_NO_BUILTIN_COMMAND (1<<18) // turns off Command without turning off pilots - Karajorma
87 #define MISSION_FLAG_PLAYER_START_AI (1<<19) // Player Starts mission under AI Control (NOT MULTI COMPATABLE) - Kazan
88 #define MISSION_FLAG_ALL_ATTACK (1<<20) // all teams at war - Goober5000
89 #define MISSION_FLAG_USE_AP_CINEMATICS (1<<21) // Kazan - use autopilot cinematics
90 #define MISSION_FLAG_DEACTIVATE_AP (1<<22) // KeldorKatarn - deactivate autopilot (patch approved by Kazan)
91 #define MISSION_FLAG_ALWAYS_SHOW_GOALS (1<<23) // Karajorma - Show the mission goals, even for training missions
92 #define MISSION_FLAG_END_TO_MAINHALL (1<<24) // niffiwan - Return to the mainhall after debrief
93 
94 // some mice macros for mission type
95 #define IS_MISSION_MULTI_COOP (The_mission.game_type & MISSION_TYPE_MULTI_COOP)
96 #define IS_MISSION_MULTI_TEAMS (The_mission.game_type & MISSION_TYPE_MULTI_TEAMS)
97 #define IS_MISSION_MULTI_DOGFIGHT (The_mission.game_type & MISSION_TYPE_MULTI_DOGFIGHT)
98 
99 
100 // Goober5000
101 typedef struct support_ship_info {
102  int arrival_location; // arrival location
103  int arrival_anchor; // arrival anchor
104  int departure_location; // departure location
105  int departure_anchor; // departure anchor
106  float max_hull_repair_val; // % of a ship's hull that can be repaired -C
107  float max_subsys_repair_val; // same thing, except for subsystems -C
108  int max_support_ships; // max number of consecutive support ships
109  int max_concurrent_ships; // max number of concurrent support ships in mission per team
110  int ship_class; // ship class of support ship
111  int tally; // number of support ships so far
112  int support_available_for_species; // whether support is available for a given species (this is a bitfield)
114 
115 // movie type defines
116 #define MOVIE_PRE_FICTION 0
117 #define MOVIE_PRE_CMD_BRIEF 1
118 #define MOVIE_PRE_BRIEF 2
119 #define MOVIE_PRE_GAME 3
120 #define MOVIE_PRE_DEBRIEF 4
121 #define MOVIE_END_CAMPAIGN 5
122 
123 // defines a mission cutscene.
124 typedef struct mission_cutscene {
125  int type;
127  int formula;
129 
130 typedef struct mission {
133  float version;
139  int flags;
140  int num_players; // valid in multiplayer missions -- number of players supported
141  uint num_respawns; // valid in multiplayer missions -- number of respawns allowed
142  int max_respawn_delay; // valid in multiplayer missions -- number of respawns allowed
144  char squad_filename[MAX_FILENAME_LEN]; // if the player has been reassigned to a squadron, this is the filename of the logo, otherwise empty string
145  char squad_name[NAME_LENGTH]; // if the player has been reassigned to a squadron, this is the name of the squadron, otherwise empty string
156 
157  // Goober5000
160 
161  // Goober5000
166 
167  // Goober5000
169 
171 
172  void Reset( )
173  {
174  int i = 0;
175  name[ 0 ] = '\0';
176  author[ 0 ] = '\0';
177  version = 0.;
178  created[ 0 ] = '\0';
179  modified[ 0 ] = '\0';
180  notes[ 0 ] = '\0';
181  mission_desc[ 0 ] = '\0';
182  game_type = 0;
183  flags = 0;
184  num_players = 0;
185  num_respawns = 0;
186  max_respawn_delay = 0;
187  memset(&Ignored_keys, 0, sizeof(int)*CCFG_MAX);
188  memset( &support_ships, 0, sizeof( support_ships ) );
189  squad_filename[ 0 ] = '\0';
190  squad_name[ 0 ] = '\0';
191  for ( i = 0; i < GR_NUM_RESOLUTIONS; i++ )
192  loading_screen[ i ][ 0 ] = '\0';
193  skybox_model[ 0 ] = '\0';
194  vm_set_identity(&skybox_orientation);
195  skybox_flags = 0;
196  envmap_name[ 0 ] = '\0';
197  contrail_threshold = 0;
198  ambient_light_level = DEFAULT_AMBIENT_LIGHT_LEVEL;
199  sound_environment.id = -1;
200  command_persona = 0;
201  command_sender[ 0 ] = '\0';
202  event_music_name[ 0 ] = '\0';
203  briefing_music_name[ 0 ] = '\0';
204  substitute_event_music_name[ 0 ] = '\0';
205  substitute_briefing_music_name[ 0 ] = '\0';
206  ai_profile = NULL;
207  cutscenes.clear( );
208  }
209 
211  {
212  Reset( );
213  }
214 } mission;
215 
216 // cargo defines
217 // NOTE: MAX_CARGO MUST REMAIN <= 64 (CARGO_NO_DEPLETE) for NO_DEPLETE to work.
218 // FURTHER NOTE (Goober5000): If a new flag is added here, the code (particularly in sexp.cpp)
219 // must be reworked so that all the flags are maintained from function to function
220 #define CARGO_INDEX_MASK 0xBF
221 #define CARGO_NO_DEPLETE 0x40 // CARGO_NO_DEPLETE + CARGO_INDEX_MASK must == FF
222 #define MAX_CARGO 30
223 
224 
225 // Goober5000 - contrail threshold (previously defined in ShipContrails.cpp)
226 #define CONTRAIL_THRESHOLD_DEFAULT 45
227 
228 extern mission The_mission;
229 extern char Mission_filename[80]; // filename of mission in The_mission (Fred only)
230 
231 #define MAX_FORMATION_NAMES 3
232 #define MAX_STATUS_NAMES 3
233 
234 // defines for arrival locations. These defines should match their counterparts in the arrival location
235 // array
236 #define MAX_ARRIVAL_NAMES 4
237 #define ARRIVE_AT_LOCATION 0
238 #define ARRIVE_NEAR_SHIP 1
239 #define ARRIVE_IN_FRONT_OF_SHIP 2
240 #define ARRIVE_FROM_DOCK_BAY 3
241 
242 // defines for departure locations. These defines should match their counterparts in the departure location
243 // array
244 #define MAX_DEPARTURE_NAMES 2
245 #define DEPART_AT_LOCATION 0
246 #define DEPART_AT_DOCK_BAY 1
247 
248 #define MAX_GOAL_TYPE_NAMES 3
249 
250 // alternate ship type names
251 #define MAX_ALT_TYPE_NAMES 100
253 extern int Mission_alt_type_count;
254 
255 // callsign
256 #define MAX_CALLSIGNS 100
258 extern int Mission_callsign_count;
259 
260 // path restrictions
261 #define MAX_PATH_RESTRICTIONS 10
262 typedef struct path_restriction_t {
267 
268 extern char *Ship_class_names[MAX_SHIP_CLASSES];
269 extern char *Ai_behavior_names[MAX_AI_BEHAVIORS];
271 extern char *Status_desc_names[MAX_STATUS_NAMES];
272 extern char *Status_type_names[MAX_STATUS_NAMES];
277 
278 extern char *Reinforcement_type_names[];
279 extern char *Object_flags[];
280 extern char *Parse_object_flags[];
281 extern char *Parse_object_flags_2[];
282 extern char *Icon_names[];
283 extern char *Mission_event_log_flags[];
284 
285 extern char *Cargo_names[MAX_CARGO];
287 
289 
290 extern int Num_iff;
291 extern int Num_ai_behaviors;
292 extern int Num_ai_classes;
293 extern int Num_cargo;
294 extern int Num_status_names;
295 extern int Num_arrival_names;
296 extern int Num_formation_names;
297 extern int Num_goal_type_names;
299 extern int Player_starts;
300 extern fix Entry_delay_time;
301 extern int Loading_screen_bm_index;
302 
303 extern int Num_unknown_ship_classes;
304 extern int Num_unknown_weapon_classes;
305 extern int Num_unknown_loadout_classes;
306 
308 extern int Current_file_length;
309 
310 #define SUBSYS_STATUS_NO_CHANGE -999
311 
312 typedef struct subsys_status {
314  float percent; // percent damaged
319  int ai_class;
321 } subsys_status;
322 
323 typedef struct texture_replace {
329 
331 
332 typedef struct alt_class {
334  int variable_index; // if set allows the class to be set by a variable
336 }alt_class;
337 
338 #define MAX_OBJECT_STATUS 10
339 
340 // a parse object
341 // information from a $OBJECT: definition is read into this struct to
342 // be copied into the real object, ship, etc. structs
343 class p_object
344 {
345 public:
348 
352  int team;
353  int behavior; // ai_class;
354  int ai_goals; // sexp of lists of goals that this ship should try and do
355  char cargo1;
357 
362 
363  int subsys_index; // index into subsys_status array
364  int subsys_count; // number of elements used in subsys_status array
368 
370  int arrival_distance; // used when arrival location is near or in front of some ship
371  int arrival_anchor; // ship used for anchoring an arrival point
372  int arrival_path_mask; // Goober5000
373  int arrival_cue; // Index in Sexp_nodes of this sexp.
375 
378  int departure_path_mask; // Goober5000
379  int departure_cue; // Index in Sexp_nodes of this sexp.
381 
383 
384  int wingnum; // set to -1 if not in a wing -- Wing array index otherwise
385  int pos_in_wing; // Goober5000 - needed for FRED with the new way things work
386 
387  int flags; // mission savable flags
388  int flags2; // Goober5000
389  int escort_priority; // priority in escort list
390  int ai_class;
391  int hotkey; // hotkey number (between 0 and 9) -1 means no hotkey
392  int score;
393  float assist_score_pct; // percentage of the score which players who gain an assist will get when this ship is killed
394  int orders_accepted; // which orders this ship will accept from the player
395  p_dock_instance *dock_list; // Goober5000 - parse objects this parse object is docked to
396  object *created_object; // Goober5000
397  int group; // group object is within or -1 if none.
399  int kamikaze_damage; // base damage for a kamikaze attack
400 
401  bool use_special_explosion; // new special explosion/hitpoints system
409 
412 
413  ushort net_signature; // network signature this object can have
415 
416  char wing_status_wing_index; // wing index (0-4) in wingman status gauge
417  char wing_status_wing_pos; // wing position (0-5) in wingman status gauge
418 
419  uint respawn_count; // number of respawns for this object. Applies only to player wing ships in multiplayer
420  int respawn_priority; // priority this ship has for controlling respawn points
421 
422  int alt_type_index; // optional alt type index
423  int callsign_index; // optional callsign index
424 
425  float ship_max_hull_strength; // Needed to deal with special hitpoints
427 
429 
430  // Goober5000
432 
434 
436 
437  p_object();
438  ~p_object();
439 };
440 
441 // defines for flags used for p_objects when they are created. Used to help create special
442 // circumstances for those ships. This list of bitfield indicators MUST correspond EXACTLY
443 // (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
444 
445 #define MAX_PARSE_OBJECT_FLAGS 27
446 
447 #define P_SF_CARGO_KNOWN (1<<0)
448 #define P_SF_IGNORE_COUNT (1<<1)
449 #define P_OF_PROTECTED (1<<2)
450 #define P_SF_REINFORCEMENT (1<<3)
451 #define P_OF_NO_SHIELDS (1<<4)
452 #define P_SF_ESCORT (1<<5)
453 #define P_OF_PLAYER_START (1<<6)
454 #define P_SF_NO_ARRIVAL_MUSIC (1<<7)
455 #define P_SF_NO_ARRIVAL_WARP (1<<8)
456 #define P_SF_NO_DEPARTURE_WARP (1<<9)
457 #define P_SF_LOCKED (1<<10)
458 #define P_OF_INVULNERABLE (1<<11)
459 #define P_SF_HIDDEN_FROM_SENSORS (1<<12)
460 #define P_SF_SCANNABLE (1<<13) // ship is a "scannable" ship
461 #define P_AIF_KAMIKAZE (1<<14)
462 #define P_AIF_NO_DYNAMIC (1<<15)
463 #define P_SF_RED_ALERT_STORE_STATUS (1<<16)
464 #define P_OF_BEAM_PROTECTED (1<<17)
465 #define P_OF_FLAK_PROTECTED (1<<18)
466 #define P_OF_LASER_PROTECTED (1<<19)
467 #define P_OF_MISSILE_PROTECTED (1<<20)
468 #define P_SF_GUARDIAN (1<<21)
469 #define P_KNOSSOS_WARP_IN (1<<22)
470 #define P_SF_VAPORIZE (1<<23)
471 #define P_SF2_STEALTH (1<<24)
472 #define P_SF2_FRIENDLY_STEALTH_INVIS (1<<25)
473 #define P_SF2_DONT_COLLIDE_INVIS (1<<26)
474 
475 // the following parse object flags are used internally by FreeSpace
476 #define P_SF_USE_UNIQUE_ORDERS (1<<27) // tells a newly created ship to use the default orders for that ship
477 #define P_SF_DOCK_LEADER (1<<28) // Goober5000 - a docked parse object that is the leader of its group
478 #define P_SF_CANNOT_ARRIVE (1<<29) // used to indicate that this ship's arrival cue will never be true
479 #define P_SF_WARP_BROKEN (1<<30) // warp engine should be broken for this ship
480 #define P_SF_WARP_NEVER (1<<31) // warp drive is destroyed
481 
482 // more parse flags! -- Goober5000
483 // same caveat: This list of bitfield indicators MUST correspond EXACTLY
484 // (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
485 
486 #define MAX_PARSE_OBJECT_FLAGS_2 25
487 
488 #define P2_SF2_PRIMITIVE_SENSORS (1<<0)
489 #define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
490 #define P2_SF2_NAV_CARRY_STATUS (1<<2)
491 #define P2_SF2_AFFECTED_BY_GRAVITY (1<<3)
492 #define P2_SF2_TOGGLE_SUBSYSTEM_SCANNING (1<<4)
493 #define P2_OF_TARGETABLE_AS_BOMB (1<<5)
494 #define P2_SF2_NO_BUILTIN_MESSAGES (1<<6)
495 #define P2_SF2_PRIMARIES_LOCKED (1<<7)
496 #define P2_SF2_SECONDARIES_LOCKED (1<<8)
497 #define P2_SF2_NO_DEATH_SCREAM (1<<9)
498 #define P2_SF2_ALWAYS_DEATH_SCREAM (1<<10)
499 #define P2_SF2_NAV_NEEDSLINK (1<<11)
500 #define P2_SF2_HIDE_SHIP_NAME (1<<12)
501 #define P2_SF2_SET_CLASS_DYNAMICALLY (1<<13)
502 #define P2_SF2_LOCK_ALL_TURRETS_INITIALLY (1<<14)
503 #define P2_SF2_AFTERBURNER_LOCKED (1<<15)
504 #define P2_OF_FORCE_SHIELDS_ON (1<<16)
505 #define P2_OF_IMMOBILE (1<<17)
506 #define P2_SF2_NO_ETS (1<<18)
507 #define P2_SF2_CLOAKED (1<<19)
508 #define P2_SF2_SHIP_LOCKED (1<<20)
509 #define P2_SF2_WEAPONS_LOCKED (1<<21)
510 #define P2_SF2_SCRAMBLE_MESSAGES (1<<22)
511 #define P2_OF_NO_COLLIDE (1<<23) // This actually changes the OF_COLLIDES object flag
512 #define P2_SF2_NO_DISABLED_SELF_DESTRUCT (1<<24)
513 
514 // and again: these flags do not appear in the array
515 //#define blah (1<<28)
516 //#define blah (1<<29)
517 #define P2_RED_ALERT_DELETED (1<<30) // Goober5000 - used analogously to SEF_PLAYER_DELETED
518 #define P2_ALREADY_HANDLED (1<<31) // Goober5000 - used for docking currently, but could be used generically
519 
520 
521 // Goober5000 - this is now dynamic
523 #define POBJ_INDEX(pobjp) (pobjp - &Parse_objects[0]) // yes, this arithmetic is valid :D
524 
527 
528 typedef struct {
529  // ships
530  int default_ship; // default ship type for player start point (recommended choice)
531  int num_ship_choices; // number of ship choices inside ship_list
532  int loadout_total; // Total number of ships available of all classes
533  int ship_list[MAX_SHIP_CLASSES];
534  char ship_list_variables[MAX_SHIP_CLASSES][TOKEN_LENGTH];
535  int ship_count[MAX_SHIP_CLASSES];
536  char ship_count_variables[MAX_SHIP_CLASSES][TOKEN_LENGTH];
537 
538  // weapons
540  int weaponry_pool[MAX_WEAPON_TYPES];
541  int weaponry_count[MAX_WEAPON_TYPES];
542  char weaponry_pool_variable[MAX_WEAPON_TYPES][TOKEN_LENGTH];
543  char weaponry_amount_variable[MAX_WEAPON_TYPES][TOKEN_LENGTH];
544  bool weapon_required[MAX_WEAPON_TYPES];
545 } team_data;
546 
547 #define MAX_P_WINGS 16
548 #define MAX_SHIP_LIST 16
549 
552 extern int Subsys_index;
553 
554 extern vec3d Parse_viewer_pos;
556 
557 extern int Mission_arrival_timestamp;
558 extern int Mission_departure_timestamp;
559 extern fix Mission_end_time;
560 
562 extern int Num_parse_names;
563 extern int Num_teams;
564 
566 extern int Player_start_shipnum;
568 
569 extern int Mission_palette; // index of palette file to use for mission
570 extern int Nebula_index; // index into Nebula_filenames[] of nebula to use in mission.
571 extern char *Nebula_filenames[NUM_NEBULAS];
572 extern char *Nebula_colors[NUM_NEBULA_COLORS];
574 
576 
577 
578 int parse_main(const char *mission_name, int flags = 0);
584 void resolve_parse_flags(object *objp, int parse_flags, int parse_flags2);
585 
586 void mission_parse_close();
587 
588 // used in squadmate messaging stuff to create wings from reinforcements.
589 int parse_wing_create_ships(wing *wingp, int num_to_create, int force = 0, int specific_instance = -1 );
590 
591 // function for getting basic mission data without loading whole mission
592 int mission_parse_is_multi(const char *filename, char *mission_name );
594 
595 // called externally from multiplayer code
596 int mission_do_departure(object *objp, bool goal_is_to_warp = false);
597 
598 // called externally from freespace.cpp
599 void mission_parse_fixup_players(void);
600 
601 // get a index to a perminently kept around name of a ship or wing
602 int get_parse_name_index(const char *name);
603 
604 // called from freespace game level loop
606 
607 // function to set the ramaing time left in the mission
608 void mission_parse_set_end_time( int seconds );
609 
610 // code to bring in a repair ship.
611 void mission_bring_in_support_ship( object *requester_objp );
613 void mission_add_to_arriving_support( object *requester_objp );
614 int mission_is_repair_scheduled( object *objp );
616 void mission_parse_support_arrived( int objnum );
617 
618 // alternate name stuff
619 int mission_parse_lookup_alt(const char *name);
620 void mission_parse_lookup_alt_index(int index, char *out);
621 int mission_parse_add_alt(const char *name);
622 void mission_parse_remove_alt(const char *name);
624 
625 // callsign stuff
626 int mission_parse_lookup_callsign(const char *name);
627 void mission_parse_lookup_callsign_index(int index, char *out);
628 int mission_parse_add_callsign(const char *name);
629 void mission_parse_remove_callsign(const char *name);
631 
632 // is training mission
633 int is_training_mission();
634 
635 // code to save/restore mission parse stuff
636 int get_mission_info(const char *filename, mission *missionp = NULL, bool basic = true);
637 
638 // Goober5000
639 void parse_dock_one_docked_object(p_object *pobjp, p_object *parent_pobjp);
640 
641 // Goober5000
642 extern int Knossos_warp_ani_used;
643 
644 // Karajorma
645 void swap_parse_object(p_object *p_obj, int ship_class);
647 
648 // Goober5000
649 subsys_status *parse_get_subsys_status(p_object *pobjp, char *subsys_name);
650 
651 
652 #endif
653 
#define MAX_CALLSIGNS
Definition: missionparse.h:256
void swap_parse_object(p_object *p_obj, int ship_class)
int Num_cargo
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
matrix skybox_orientation
Definition: missionparse.h:148
void parse_dock_one_docked_object(p_object *pobjp, p_object *parent_pobjp)
int alt_type_index
Definition: missionparse.h:422
char misc[NAME_LENGTH]
Definition: missionparse.h:382
char Neb2_texture_name[MAX_FILENAME_LEN]
Definition: neb.cpp:75
int Nebula_index
int secondary_ammo[MAX_SHIP_SECONDARY_BANKS]
Definition: missionparse.h:318
int i
Definition: multi_pxo.cpp:466
char Mission_alt_types[MAX_ALT_TYPE_NAMES][NAME_LENGTH]
uint num_respawns
Definition: missionparse.h:141
subsys_status * parse_get_subsys_status(p_object *pobjp, char *subsys_name)
int persona_index
Definition: missionparse.h:398
int escort_priority
Definition: missionparse.h:389
char Mission_filename[80]
#define MAX_SHIP_PRIMARY_BANKS
Definition: globals.h:62
int respawn_priority
Definition: missionparse.h:420
int pos_in_wing
Definition: missionparse.h:385
void mission_parse_fixup_players(void)
int game_type
Definition: missionparse.h:138
char * Status_desc_names[MAX_STATUS_NAMES]
char briefing_music_name[NAME_LENGTH]
Definition: missionparse.h:163
int Mission_callsign_count
p_object * mission_parse_get_arrival_ship(ushort net_signature)
Returns the parse object on the ship arrival list associated with the given net signature.
int Num_goal_type_names
int support_available_for_species
Definition: missionparse.h:112
char ship_name[NAME_LENGTH]
Definition: missionparse.h:324
int ai_class
Definition: missionparse.h:390
int ambient_light_level
Definition: missionparse.h:152
GLuint index
Definition: Glext.h:5608
struct subsys_status subsys_status
#define MAX_WINGS
Definition: globals.h:50
#define MAX_SHIPS
Definition: globals.h:37
int Num_unknown_loadout_classes
SCP_vector< texture_replace > replacement_textures
Definition: missionparse.h:431
int special_exp_damage
Definition: missionparse.h:402
int special_exp_inner
Definition: missionparse.h:404
p_object * next
Definition: missionparse.h:347
Definition: pstypes.h:88
void clear_texture_replacements()
int callsign_index
Definition: missionparse.h:423
#define GR_NUM_RESOLUTIONS
Definition: 2d.h:651
int departure_path_mask
Definition: missionparse.h:378
int secondary_banks[MAX_SHIP_SECONDARY_BANKS]
Definition: missionparse.h:317
int parse_main(const char *mission_name, int flags=0)
fix Entry_delay_time
int Current_file_length
char * Parse_object_flags[]
int loadout_total
Definition: missionparse.h:532
int skybox_flags
Definition: missionparse.h:150
struct alt_class alt_class
#define MAX_FORMATION_NAMES
Definition: missionparse.h:231
int max_respawn_delay
Definition: missionparse.h:142
float assist_score_pct
Definition: missionparse.h:393
SCP_string team_color_setting
Definition: missionparse.h:356
int primary_ammo[MAX_SHIP_PRIMARY_BANKS]
Definition: missionparse.h:316
int mission_parse_add_alt(const char *name)
int ship_class
Definition: missionparse.h:351
Definition: ship.h:1516
int kamikaze_damage
Definition: missionparse.h:399
int status_count
Definition: missionparse.h:358
bool default_to_this_class
Definition: missionparse.h:335
#define MAX_SHIP_BAY_PATHS
Definition: model.h:538
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
object * objp
Definition: lua.cpp:3105
int arrival_anchor
Definition: missionparse.h:371
void mission_parse_eval_stuff()
int Knossos_warp_ani_used
Definition: fireballs.cpp:33
ushort net_signature
Definition: missionparse.h:413
void resolve_parse_flags(object *objp, int parse_flags, int parse_flags2)
int special_exp_shockwave_speed
Definition: missionparse.h:407
vec3d Parse_viewer_pos
int Player_start_shipnum
int Num_status_names
int Mission_palette
int get_parse_name_index(const char *name)
char Cargo_names_buf[MAX_CARGO][NAME_LENGTH]
int Num_iff
int arrival_delay
Definition: missionparse.h:374
struct support_ship_info support_ship_info
p_object Support_ship_pobj
int arrival_path_mask
Definition: missionparse.h:372
sound_env sound_environment
Definition: missionparse.h:155
#define MAX_SHIP_SECONDARY_BANKS
Definition: globals.h:63
void mission_parse_remove_alt(const char *name)
int destroy_before_mission_time
Definition: missionparse.h:414
int Num_unknown_weapon_classes
char squad_filename[MAX_FILENAME_LEN]
Definition: missionparse.h:144
int is_training_mission()
#define MAX_OBJECT_STATUS
Definition: missionparse.h:338
#define MAX_DEPARTURE_NAMES
Definition: missionparse.h:244
struct mission mission
float max_shield_recharge
Definition: missionparse.h:428
char created[DATE_TIME_LENGTH]
Definition: missionparse.h:134
#define MAX_AI_BEHAVIORS
Definition: ai.h:189
unsigned int uint
Definition: pstypes.h:64
struct path_restriction_t path_restriction_t
p_object Ship_arrival_list
int Ignored_keys[CCFG_MAX]
Definition: keycontrol.cpp:471
int Mission_arrival_timestamp
float version
Definition: missionparse.h:133
#define MAX_SHIP_CLASSES
Definition: globals.h:48
char Mission_parse_storm_name[NAME_LENGTH]
void mission_parse_reset_callsign()
ai_profile_t * ai_profile
Definition: missionparse.h:168
int Mission_alt_type_count
int departure_anchor
Definition: missionparse.h:377
char * filename
char * Arrival_location_names[MAX_ARRIVAL_NAMES]
int Num_ai_classes
Definition: aicode.cpp:195
float neb_far_multi
Definition: missionparse.h:153
#define MAX_WEAPON_TYPES
Definition: globals.h:73
int num_weapon_choices
Definition: missionparse.h:539
char Parse_names[MAX_SHIPS+MAX_WINGS][NAME_LENGTH]
void mission_parse_lookup_callsign_index(int index, char *out)
char * Nebula_filenames[NUM_NEBULAS]
void vm_set_identity(matrix *m)
Definition: vecmat.cpp:150
float ship_max_hull_strength
Definition: missionparse.h:425
#define MAX_CARGO
Definition: missionparse.h:222
char * Icon_names[]
int mission_parse_get_multi_mission_info(const char *filename)
int mission_parse_is_multi(const char *filename, char *mission_name)
SCP_vector< alt_class > alt_classes
Definition: missionparse.h:433
char squad_name[NAME_LENGTH]
Definition: missionparse.h:145
int primary_banks[MAX_SHIP_PRIMARY_BANKS]
Definition: missionparse.h:315
int alt_iff_color[MAX_IFFS][MAX_IFFS]
Definition: missionparse.h:435
int subsys_index
Definition: missionparse.h:363
char * Goal_type_names[MAX_GOAL_TYPE_NAMES]
#define NUM_NEBULAS
Definition: missionparse.h:30
#define MAX_GOAL_TYPE_NAMES
Definition: missionparse.h:248
char notes[NOTES_LENGTH]
Definition: missionparse.h:136
int arrival_location
Definition: missionparse.h:369
int arrival_cue
Definition: missionparse.h:373
int status[MAX_OBJECT_STATUS]
Definition: missionparse.h:360
#define DEFAULT_AMBIENT_LIGHT_LEVEL
Definition: missionparse.h:33
char skybox_model[MAX_FILENAME_LEN]
Definition: missionparse.h:147
int special_exp_outer
Definition: missionparse.h:405
int special_exp_blast
Definition: missionparse.h:403
#define MISSION_DESC_LENGTH
Definition: globals.h:28
int Num_reinforcement_type_names
char path_names[MAX_SHIP_BAY_PATHS][MAX_NAME_LEN]
Definition: missionparse.h:265
void mission_parse_support_arrived(int objnum)
int initial_shields
Definition: missionparse.h:367
bool use_shockwave
Definition: missionparse.h:406
int default_ship
Definition: missionparse.h:530
char wing_status_wing_index
Definition: missionparse.h:416
uint respawn_count
Definition: missionparse.h:419
int arrival_distance
Definition: missionparse.h:370
fix Mission_end_time
int variable_index
Definition: missionparse.h:334
char * Mission_event_log_flags[]
char loading_screen[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN]
Definition: missionparse.h:146
p_object * Player_start_pobject
int Player_starts
void mission_parse_remove_callsign(const char *name)
long fix
Definition: pstypes.h:54
void mission_add_to_arriving_support(object *requester_objp)
#define DATE_TIME_LENGTH
Definition: globals.h:19
int orders_accepted
Definition: missionparse.h:394
SCP_vector< mission_cutscene > cutscenes
Definition: missionparse.h:170
char Mission_callsigns[MAX_CALLSIGNS][NAME_LENGTH]
void mission_parse_set_end_time(int seconds)
char modified[DATE_TIME_LENGTH]
Definition: missionparse.h:135
bool use_special_explosion
Definition: missionparse.h:401
void mission_parse_reset_alt()
float neb_near_multi
Definition: missionparse.h:154
GLbitfield flags
Definition: Glext.h:6722
int mission_is_repair_scheduled(object *objp)
struct mission_cutscene mission_cutscene
GLuint const GLchar * name
Definition: Glext.h:5608
char filename[MAX_FILENAME_LEN]
Definition: missionparse.h:126
char * Ship_class_names[MAX_SHIP_CLASSES]
char * Reinforcement_type_names[]
char command_sender[NAME_LENGTH]
Definition: missionparse.h:159
#define TOKEN_LENGTH
Definition: globals.h:41
int Num_parse_names
object * created_object
Definition: missionparse.h:396
p_object * Arriving_support_ship
Definition: missionparse.h:573
int Num_teams
int initial_hull
Definition: missionparse.h:366
int mission_do_departure(object *objp, bool goal_is_to_warp=false)
void mission_parse_lookup_alt_index(int index, char *out)
int initial_velocity
Definition: missionparse.h:365
int get_mission_info(const char *filename, mission *missionp=NULL, bool basic=true)
#define MAX_ALT_TYPE_NAMES
Definition: missionparse.h:251
char old_texture[MAX_FILENAME_LEN]
Definition: missionparse.h:325
#define NAME_LENGTH
Definition: globals.h:15
void Reset()
Definition: missionparse.h:172
int Subsys_index
int Num_formation_names
char * Ai_behavior_names[MAX_AI_BEHAVIORS]
int parse_wing_create_ships(wing *wingp, int num_to_create, int force=0, int specific_instance=-1)
Tries to create a wing of ships.
char event_music_name[NAME_LENGTH]
Definition: missionparse.h:162
ushort Current_file_checksum
GLenum target
Definition: Glext.h:6872
p_object * mission_parse_get_parse_object(ushort net_signature)
unsigned short ushort
Definition: pstypes.h:63
int special_exp_deathroll_time
Definition: missionparse.h:408
mission The_mission
int departure_delay
Definition: missionparse.h:380
char substitute_briefing_music_name[NAME_LENGTH]
Definition: missionparse.h:165
char * Parse_object_flags_2[]
int Num_unknown_ship_classes
float ship_max_shield_strength
Definition: missionparse.h:426
int special_shield
Definition: missionparse.h:411
The total number of defined control actions (or last define + 1)
char * Formation_names[MAX_FORMATION_NAMES]
char mission_desc[MISSION_DESC_LENGTH]
Definition: missionparse.h:137
p_object * prev
Definition: missionparse.h:347
char * Nebula_colors[NUM_NEBULA_COLORS]
#define MAX_TVT_TEAMS
Definition: globals.h:57
int Mission_departure_timestamp
char Player_start_shipname[NAME_LENGTH]
char cargo1
Definition: missionparse.h:355
matrix orient
Definition: missionparse.h:350
#define MAX_STATUS_NAMES
Definition: missionparse.h:232
int mission_parse_lookup_callsign(const char *name)
subsys_status * Subsys_status
int mission_parse_lookup_alt(const char *name)
int num_players
Definition: missionparse.h:140
#define MAX_ARRIVAL_NAMES
Definition: missionparse.h:236
#define MAX_IFFS
Definition: globals.h:34
struct texture_replace texture_replace
int command_persona
Definition: missionparse.h:158
SCP_vector< texture_replace > Fred_texture_replacements
int ship_class
Definition: missionparse.h:333
int Num_ai_behaviors
char * Status_type_names[MAX_STATUS_NAMES]
int mission_is_support_ship_arriving(void)
int contrail_threshold
Definition: missionparse.h:151
int ai_goals
Definition: missionparse.h:354
char envmap_name[MAX_FILENAME_LEN]
Definition: missionparse.h:149
#define NUM_NEBULA_COLORS
Definition: missionparse.h:31
#define NOTES_LENGTH
Definition: globals.h:20
team_data Team_data[MAX_TVT_TEAMS]
int Loading_screen_bm_index
SCP_vector< p_object > Parse_objects
void mission_parse_close()
int departure_cue
Definition: missionparse.h:379
support_ship_info support_ships
Definition: missionparse.h:143
int subsys_count
Definition: missionparse.h:364
matrix Parse_viewer_orient
#define MAX_NAME_LEN
Definition: model.h:29
int mission_remove_scheduled_repair(object *objp)
int parse_create_object(p_object *objp)
char * Object_flags[]
char author[NAME_LENGTH]
Definition: missionparse.h:132
int num_ship_choices
Definition: missionparse.h:531
int status_type[MAX_OBJECT_STATUS]
Definition: missionparse.h:359
char * Cargo_names[MAX_CARGO]
int departure_location
Definition: missionparse.h:376
float max_subsys_repair_val
Definition: missionparse.h:107
p_dock_instance * dock_list
Definition: missionparse.h:395
int id
Definition: sound.h:92
char new_texture[MAX_FILENAME_LEN]
Definition: missionparse.h:326
char wing_status_wing_pos
Definition: missionparse.h:417
int mission_parse_add_callsign(const char *name)
char * Departure_location_names[MAX_DEPARTURE_NAMES]
char substitute_event_music_name[NAME_LENGTH]
Definition: missionparse.h:164
vec3d pos
Definition: missionparse.h:349
void mission_bring_in_support_ship(object *requester_objp)
int special_hitpoints
Definition: missionparse.h:410
int Num_arrival_names
char * Status_target_names[MAX_STATUS_NAMES]
int behavior
Definition: missionparse.h:353