Open source remastering of the Freespace 2 engine
missionparse.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdarg.h>
#include <setjmp.h>
#include "ai/aigoals.h"
#include "asteroid/asteroid.h"
#include "bmpman/bmpman.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "debris/debris.h"
#include "gamesnd/eventmusic.h"
#include "globalincs/alphacolors.h"
#include "globalincs/linklist.h"
#include "hud/hudescort.h"
#include "hud/hudets.h"
#include "hud/hudwingmanstatus.h"
#include "iff_defs/iff_defs.h"
#include "io/timer.h"
#include "jumpnode/jumpnode.h"
#include "lighting/lighting.h"
#include "localization/localize.h"
#include "math/fvi.h"
#include "math/staticrand.h"
#include "mission/missionbriefcommon.h"
#include "mission/missioncampaign.h"
#include "mission/missiongoals.h"
#include "mission/missionhotkey.h"
#include "mission/missionlog.h"
#include "mission/missionmessage.h"
#include "mission/missionparse.h"
#include "missionui/fictionviewer.h"
#include "missionui/missioncmdbrief.h"
#include "missionui/redalert.h"
#include "mod_table/mod_table.h"
#include "nebula/neb.h"
#include "nebula/neblightning.h"
#include "network/multi.h"
#include "network/multi_endgame.h"
#include "network/multi_respawn.h"
#include "network/multimsgs.h"
#include "network/multiutil.h"
#include "object/parseobjectdock.h"
#include "object/waypoint.h"
#include "parse/generic_log.h"
#include "parse/parselo.h"
#include "parse/scripting.h"
#include "playerman/player.h"
#include "popup/popup.h"
#include "popup/popupdead.h"
#include "ship/ship.h"
#include "ship/shipfx.h"
#include "ship/shiphit.h"
#include "sound/ds.h"
#include "starfield/nebula.h"
#include "starfield/starfield.h"
#include "weapon/weapon.h"

Go to the source code of this file.


#define SHIP_WARP_TIME   5.0f
#define ARRIVAL_TIMESTAMP   2000
#define WARP_IN_MIN_DISTANCE   1000.0f
#define WARP_IN_TIME_MIN   3000
#define WARP_IN_TIME_MAX   6000


fix game_get_overall_frametime ()
void parse_player_info2 (mission *pm)
void post_process_mission ()
int allocate_subsys_status ()
void parse_common_object_data (p_object *objp)
void parse_asteroid_fields (mission *pm)
int mission_set_arrival_location (int anchor, int location, int distance, int objnum, int path_mask, vec3d *new_pos, matrix *new_orient)
int get_anchor (char *name)
void mission_parse_set_up_initial_docks ()
void mission_parse_set_arrival_locations ()
void mission_set_wing_arrival_location (wing *wingp, int num_to_set)
int parse_lookup_alt_name (char *name)
void parse_init (bool basic=false)
void parse_object_set_handled_flag_helper (p_object *pobjp, p_dock_function_info *infop)
void parse_object_clear_all_handled_flags ()
int parse_object_on_arrival_list (p_object *pobjp)
int add_path_restriction ()
void mission_parse_mark_non_arrival (p_object *p_objp)
void mission_parse_mark_non_arrival (wing *wingp)
void mission_parse_mark_non_arrivals ()
void convertFSMtoFS2 ()
void parse_custom_bitmap (const char *expected_string_640, const char *expected_string_1024, char *string_field_640, char *string_field_1024)
void parse_mission_info (mission *pm, bool basic=false)
void parse_player_info (mission *pm)
void parse_cutscenes (mission *pm)
void parse_plot_info (mission *pm)
void parse_briefing_info (mission *pm)
void parse_music (mission *pm, int flags)
void parse_fiction (mission *pm)
void parse_cmd_brief (mission *pm)
void parse_cmd_briefs (mission *pm)
void parse_briefing (mission *pm, int flags)
void parse_debriefing_new (mission *pm)
void position_ship_for_knossos_warpin (p_object *p_objp)
void parse_dock_one_docked_object (p_object *pobjp, p_object *parent_pobjp)
int parse_create_object_sub (p_object *objp)
void parse_create_docked_object_helper (p_object *pobjp, p_dock_function_info *infop)
int parse_create_object (p_object *pobjp)
void parse_bring_in_docked_wing (p_object *p_objp, int wingnum, int shipnum)
void resolve_parse_flags (object *objp, int parse_flags, int parse_flags2)
void fix_old_special_explosions (p_object *p_objp, int variable_index)
void fix_old_special_hits (p_object *p_objp, int variable_index)
int parse_object (mission *pm, int flag, p_object *p_objp)
void mission_parse_handle_late_arrivals (p_object *p_objp)
void mission_parse_maybe_create_parse_object (p_object *pobjp)
int get_reassigned_index (team_data *current_team, int ship_class)
void update_loadout_totals (team_data *current_team, int loadout_index)
bool is_ship_assignable (p_object *p_objp)
void process_loadout_objects ()
void parse_objects (mission *pm, int flag)
void swap_parse_object (p_object *p_obj, int new_ship_class)
p_objectmission_parse_get_parse_object (ushort net_signature)
p_objectmission_parse_get_parse_object (const char *name)
int find_wing_name (char *name)
int parse_wing_create_ships (wing *wingp, int num_to_create, int force, int specific_instance)
 Tries to create a wing of ships. More...
void parse_wing (mission *pm)
void parse_wings (mission *pm)
void resolve_path_masks (int anchor, int *path_mask)
void post_process_path_stuff ()
void post_process_ships_wings ()
void parse_event (mission *pm)
void parse_events (mission *pm)
void parse_goal (mission *pm)
void parse_goals (mission *pm)
void parse_waypoint_list (mission *pm)
void parse_waypoints_and_jumpnodes (mission *pm)
void parse_messages (mission *pm, int flags)
void parse_reinforcement (mission *pm)
void parse_reinforcements (mission *pm)
void parse_one_background (background_t *background)
void parse_bitmaps (mission *pm)
void parse_variables ()
int parse_mission (mission *pm, int flags)
int get_mission_info (const char *filename, mission *mission_p, bool basic)
int parse_main (const char *mission_name, int flags)
void mission_parse_close ()
bool sexp_is_locked_false (int node)
void set_cue_to_false (int *cue)
void reset_arrival_to_false (p_object *pobjp, bool reset_wing)
void parse_object_mark_dock_leader_helper (p_object *pobjp, p_dock_function_info *infop)
void parse_object_clear_handled_flag_helper (p_object *pobjp, p_dock_function_info *infop)
int mission_parse_is_multi (const char *filename, char *mission_name)
int mission_parse_get_multi_mission_info (const char *filename)
p_objectmission_parse_get_arrival_ship (const char *name)
 Returns the parse object on the ship arrival list associated with the given name. More...
p_objectmission_parse_get_arrival_ship (ushort net_signature)
 Returns the parse object on the ship arrival list associated with the given net signature. More...
void mission_parse_mark_reinforcement_available (char *name)
int mission_did_ship_arrive (p_object *objp)
void mission_maybe_make_ship_arrive (p_object *p_objp)
void mission_parse_support_arrived (int objnum)
void mission_eval_arrivals ()
int ship_can_use_warp_drive (ship *shipp)
int mission_do_departure (object *objp, bool goal_is_to_warp)
void mission_eval_departures ()
void mission_parse_eval_stuff ()
int insert_subsys_status (p_object *pobjp)
subsys_statusparse_get_subsys_status (p_object *pobjp, char *subsys_name)
int get_parse_name_index (const char *name)
int get_special_anchor (char *name)
void mission_parse_fixup_players ()
void mission_add_to_arriving_support (object *requester_objp)
int pp_collide_any (vec3d *curpos, vec3d *goalpos, float radius, object *ignore_objp1, object *ignore_objp2, int big_only_flag)
int get_warp_in_pos (vec3d *pos, object *objp, float x, float y, float z)
void mission_bring_in_support_ship (object *requester_objp)
int mission_is_support_ship_arriving ()
int mission_is_repair_scheduled (object *objp)
int mission_remove_scheduled_repair (object *objp)
int mission_parse_lookup_alt (const char *name)
void mission_parse_lookup_alt_index (int index, char *out)
int mission_parse_add_alt (const char *name)
void mission_parse_remove_alt (const char *name)
void mission_parse_reset_alt ()
int mission_parse_lookup_callsign (const char *name)
void mission_parse_lookup_callsign_index (int index, char *out)
int mission_parse_add_callsign (const char *name)
void mission_parse_remove_callsign (const char *name)
void mission_parse_reset_callsign ()
int is_training_mission ()
void conv_fix_punctuation_section (char *str, char *section_start, char *section_end, char *text_start, char *text_end)
void conv_fix_punctuation ()
void clear_texture_replacements ()


struct {
   char   docker [NAME_LENGTH]
   char   dockee [NAME_LENGTH]
   char   docker_point [NAME_LENGTH]
   char   dockee_point [NAME_LENGTH]
Initially_docked [MAX_SHIPS]
int Total_initially_docked
mission The_mission
char Mission_filename [80]
int Mission_palette
int Nebula_index
int Num_ai_behaviors = MAX_AI_BEHAVIORS
int Num_cargo = 0
int Num_status_names = MAX_STATUS_NAMES
int Num_arrival_names = MAX_ARRIVAL_NAMES
int Num_goal_type_names = MAX_GOAL_TYPE_NAMES
int Num_parse_goals
int Player_starts = 1
int Num_teams
fix Entry_delay_time = 0
int Num_unknown_ship_classes
int Num_unknown_weapon_classes
int Num_unknown_loadout_classes
ushort Current_file_checksum = 0
ushort Last_file_checksum = 0
int Current_file_length = 0
char Mission_alt_types [MAX_ALT_TYPE_NAMES][NAME_LENGTH]
int Mission_alt_type_count = 0
char Mission_callsigns [MAX_CALLSIGNS][NAME_LENGTH]
int Mission_callsign_count = 0
p_object Ship_arrival_list
SCP_vector< p_objectParse_objects
p_object Support_ship_pobj
char Arriving_repair_targets [MAX_AI_GOALS][NAME_LENGTH]
int Num_arriving_repair_targets
subsys_statusSubsys_status = NULL
int Subsys_index
int Subsys_status_size
char Mission_parse_storm_name [NAME_LENGTH] = "none"
team_data Team_data [MAX_TVT_TEAMS]
char Player_start_shipname [NAME_LENGTH]
int Player_start_shipnum
int Num_parse_names
SCP_vector< texture_replaceFred_texture_replacements
int Num_path_restrictions
path_restriction_t Path_restrictions [MAX_PATH_RESTRICTIONS]
char * Nebula_filenames [NUM_NEBULAS]
char * Neb2_filenames [NUM_NEBULAS]
char * Nebula_colors [NUM_NEBULA_COLORS]
char * Ai_behavior_names [MAX_AI_BEHAVIORS]
char * Cargo_names [MAX_CARGO]
char Cargo_names_buf [MAX_CARGO][NAME_LENGTH]
char * Ship_class_names [MAX_SHIP_CLASSES]
char * Icon_names [MIN_BRIEF_ICONS]
char * Status_desc_names [MAX_STATUS_NAMES]
char * Status_type_names [MAX_STATUS_NAMES]
char * Status_target_names [MAX_STATUS_NAMES]
char * Arrival_location_names [MAX_ARRIVAL_NAMES]
char * Departure_location_names [MAX_DEPARTURE_NAMES]
char * Goal_type_names [MAX_GOAL_TYPE_NAMES]
char * Reinforcement_type_names []
char * Old_game_types [OLD_MAX_GAME_TYPES]
char * Parse_object_flags [MAX_PARSE_OBJECT_FLAGS]
char * Parse_object_flags_2 [MAX_PARSE_OBJECT_FLAGS_2]
char * Mission_event_log_flags [MAX_MISSION_EVENT_LOG_FLAGS]
int Num_reinforcement_type_names = sizeof(Reinforcement_type_names) / sizeof(char *)
vec3d Parse_viewer_pos
matrix Parse_viewer_orient
int Loading_screen_bm_index =-1
int Mission_arrival_timestamp
int Mission_departure_timestamp
fix Mission_end_time
int Multi_ping_timestamp

Macro Definition Documentation


Definition at line 358 of file missionparse.cpp.


Definition at line 357 of file missionparse.cpp.


Definition at line 355 of file missionparse.cpp.


Definition at line 354 of file missionparse.cpp.

#define ARRIVAL_TIMESTAMP   2000

Definition at line 345 of file missionparse.cpp.


Definition at line 346 of file missionparse.cpp.


Definition at line 133 of file missionparse.cpp.


Definition at line 351 of file missionparse.cpp.

#define SHIP_WARP_TIME   5.0f

Definition at line 117 of file missionparse.cpp.

#define WARP_IN_MIN_DISTANCE   1000.0f

Definition at line 7467 of file missionparse.cpp.

#define WARP_IN_TIME_MAX   6000

Definition at line 7469 of file missionparse.cpp.

#define WARP_IN_TIME_MIN   3000

Definition at line 7468 of file missionparse.cpp.

Function Documentation

int add_path_restriction ( )

Definition at line 7356 of file missionparse.cpp.

int allocate_subsys_status ( )

Definition at line 7230 of file missionparse.cpp.

void clear_texture_replacements ( )

Definition at line 7996 of file missionparse.cpp.

void conv_fix_punctuation ( )

Definition at line 7974 of file missionparse.cpp.

void conv_fix_punctuation_section ( char *  str,
char *  section_start,
char *  section_end,
char *  text_start,
char *  text_end 

Go through all the displayed text in one section and fix the section and text delimiters should all be different

Definition at line 7952 of file missionparse.cpp.

void convertFSMtoFS2 ( )

Definition at line 7990 of file missionparse.cpp.

int find_wing_name ( char *  name)

Definition at line 3912 of file missionparse.cpp.

void fix_old_special_explosions ( p_object p_objp,
int  variable_index 

Definition at line 2659 of file missionparse.cpp.

void fix_old_special_hits ( p_object p_objp,
int  variable_index 

Definition at line 2684 of file missionparse.cpp.

fix game_get_overall_frametime ( )

Definition at line 230 of file fredstubs.cpp.

int get_anchor ( char *  name)

Definition at line 7437 of file missionparse.cpp.

int get_mission_info ( const char *  filename,
mission mission_p,
bool  basic 

Definition at line 5881 of file missionparse.cpp.

int get_parse_name_index ( const char *  name)

Definition at line 7341 of file missionparse.cpp.

int get_reassigned_index ( team_data current_team,
int  ship_class 

Checks if any ships of a certain ship class are still available in the team loadout

The index of the ship in team_data->ship_list if found or -1 if it isn't

Definition at line 3603 of file missionparse.cpp.

int get_special_anchor ( char *  name)

Look for <any friendly>, <any hostile player>, etc.

Definition at line 7410 of file missionparse.cpp.

int get_warp_in_pos ( vec3d pos,
object objp,
float  x,
float  y,
float  z 

Set the warp in position for a support ship relative to an object. Caller tries several positions, passing vector in x, y, z.

Definition at line 7511 of file missionparse.cpp.

int insert_subsys_status ( p_object pobjp)

Definition at line 7280 of file missionparse.cpp.

bool is_ship_assignable ( p_object p_objp)

Attempts to set the class of this ship based which ship classes still remain unassigned in the ship loadout The ship class specified by the mission file itself is tested first. Followed by the list of alt classes. If an alt class flagged as default_to_this_class is reached the ship will be assigned to that class. If the class can't be assigned because no ships of that class remain the function returns false.

Definition at line 3643 of file missionparse.cpp.

int is_training_mission ( )

Definition at line 7944 of file missionparse.cpp.

void mission_add_to_arriving_support ( object requester_objp)

Adds requester_objp onto the queue of ships for the arriving support ship to service

Definition at line 7474 of file missionparse.cpp.

void mission_bring_in_support_ship ( object requester_objp)

Modified by Goober5000 to allow more flexibility in support ships

Definition at line 7534 of file missionparse.cpp.

int mission_did_ship_arrive ( p_object objp)

Takes a parse object and checks the arrival cue, delay and destruction of object it is arriving from then creates the object if necessary.

-1 if not created.
objnum of created ship otherwise

Definition at line 6635 of file missionparse.cpp.

int mission_do_departure ( object objp,
bool  goal_is_to_warp 

Called to make object objp depart. Rewritten and expanded by Goober5000.

Definition at line 7012 of file missionparse.cpp.

void mission_eval_arrivals ( )

Check the lists of arriving ships and wings, creating new ships/wings if the arrival criteria have been met

Definition at line 6820 of file missionparse.cpp.

void mission_eval_departures ( )

Put here because mission_eval_arrivals is here.

Might move these to a better location later – MWA

Definition at line 7137 of file missionparse.cpp.

int mission_is_repair_scheduled ( object objp)

Returns true if the given ship is scheduled to be repaired by the arriving support ship

Definition at line 7716 of file missionparse.cpp.

int mission_is_support_ship_arriving ( void  )

Returns true if a support ship is currently in the process of warping in.

Definition at line 7705 of file missionparse.cpp.

void mission_maybe_make_ship_arrive ( p_object p_objp)

Definition at line 6723 of file missionparse.cpp.

int mission_parse_add_alt ( const char *  name)

Definition at line 7811 of file missionparse.cpp.

int mission_parse_add_callsign ( const char *  name)

Definition at line 7899 of file missionparse.cpp.

void mission_parse_close ( )

Definition at line 6016 of file missionparse.cpp.

void mission_parse_eval_stuff ( )

Called from high level game loop to do mission evaluation stuff

Definition at line 7224 of file missionparse.cpp.

void mission_parse_fixup_players ( void  )

Fixup the goals/ai references for player objects in the mission

Definition at line 7450 of file missionparse.cpp.

p_object* mission_parse_get_arrival_ship ( const char *  name)

Returns the parse object on the ship arrival list associated with the given name.

[in]nameThe name of the object
The parse object, or NULL if no object with the given name is on the arrival list
This function is used to determine whether a ship has arrived. Ships on the arrival list are considered to not be in the game; In order to make respawns work in multiplayer, player ships (those marked with the P_OF_PLAYER_START flag) are never removed from it.

Definition at line 6423 of file missionparse.cpp.

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.

[in]net_signatureThe net signature of the object
The parse object, or NULL if no object with the given signature is on the arrival list
This function is used to determine whether a ship has arrived. Ships on the arrival list are considered to not be in the game; In order to make respawns work in multiplayer, player ships (those marked with the P_OF_PLAYER_START flag) are never removed from it.

Definition at line 6449 of file missionparse.cpp.

int mission_parse_get_multi_mission_info ( const char *  filename)

Called to retrieve useful information about a mission.

We will get the name, description, and number of players for a mission. Probably used for multiplayer only? The calling function can use the information in The_mission to get the name/description of the mission if needed.

Definition at line 6401 of file missionparse.cpp.

p_object* mission_parse_get_parse_object ( ushort  net_signature)

Definition at line 3885 of file missionparse.cpp.

p_object* mission_parse_get_parse_object ( const char *  name)

Definition at line 3899 of file missionparse.cpp.

void mission_parse_handle_late_arrivals ( p_object p_objp)

Definition at line 3404 of file missionparse.cpp.

int mission_parse_is_multi ( const char *  filename,
char *  mission_name 

Returns true or false if the given mission support multiplayers

Definition at line 6346 of file missionparse.cpp.

int mission_parse_lookup_alt ( const char *  name)

Alternate name stuff

Definition at line 7771 of file missionparse.cpp.

void mission_parse_lookup_alt_index ( int  index,
char *  out 

Definition at line 7791 of file missionparse.cpp.

int mission_parse_lookup_callsign ( const char *  name)

Callsign stuff

Definition at line 7859 of file missionparse.cpp.

void mission_parse_lookup_callsign_index ( int  index,
char *  out 

Definition at line 7879 of file missionparse.cpp.

void mission_parse_mark_non_arrival ( p_object p_objp)

Definition at line 6738 of file missionparse.cpp.

void mission_parse_mark_non_arrival ( wing wingp)

Definition at line 6745 of file missionparse.cpp.

void mission_parse_mark_non_arrivals ( )

Set a flag on all parse objects on ship arrival list which cannot arrive in the mission

Definition at line 6761 of file missionparse.cpp.

void mission_parse_mark_reinforcement_available ( char *  name)

Mark a reinforcement as available

Definition at line 6606 of file missionparse.cpp.

void mission_parse_maybe_create_parse_object ( p_object pobjp)

Definition at line 3435 of file missionparse.cpp.

void mission_parse_remove_alt ( const char *  name)

Definition at line 7830 of file missionparse.cpp.

void mission_parse_remove_callsign ( const char *  name)

Definition at line 7918 of file missionparse.cpp.

void mission_parse_reset_alt ( )

Definition at line 7851 of file missionparse.cpp.

void mission_parse_reset_callsign ( )

Definition at line 7939 of file missionparse.cpp.

void mission_parse_set_arrival_locations ( )

Called after a mission is parsed to set the arrival locations of all ships in the mission to the apprioriate spot. Mainly needed because ships might be in dock bays to start the mission, so their AI mode must be set appropriately.

Definition at line 6093 of file missionparse.cpp.

void mission_parse_set_up_initial_docks ( )

Definition at line 6253 of file missionparse.cpp.

void mission_parse_support_arrived ( int  objnum)

Deal with support ship arrival. This function can get called from either single or multiplayer. Needed to that clients can know when to abort rearm.

objnumis the object number of the arriving support ship

Definition at line 6784 of file missionparse.cpp.

int mission_remove_scheduled_repair ( object objp)

Removed the given ship from the list of ships that are to get repair by arriving support ship

Definition at line 7737 of file missionparse.cpp.

int mission_set_arrival_location ( int  anchor,
int  location,
int  dist,
int  objnum,
int  path_mask,
vec3d new_pos,
matrix new_orient 

Sets the arrival location of a parse object according to the arrival location of the object.

objnum of anchor ship if there is one, -1 otherwise.

Definition at line 6468 of file missionparse.cpp.

void mission_set_wing_arrival_location ( wing wingp,
int  num_to_set 

Sets the arrival location of the ships in wingp.

wingpPointer to wing
num_to_setThe threshold value for wings may have us create more ships in the wing when there are still some remaining

Definition at line 6035 of file missionparse.cpp.

void parse_asteroid_fields ( mission pm)

Definition at line 5353 of file missionparse.cpp.

void parse_bitmaps ( mission pm)

Definition at line 5222 of file missionparse.cpp.

void parse_briefing ( mission pm,
int  flags 

Parse the data required for the mission briefing

NOTE: This updates the global Briefing struct with all the data necessary to drive the briefing

Definition at line 1361 of file missionparse.cpp.

void parse_briefing_info ( mission pm)

Definition at line 1042 of file missionparse.cpp.

void parse_bring_in_docked_wing ( p_object p_objp,
int  wingnum,
int  shipnum 

There are a bunch of assumptions in the code that, in FS2, the wing will be created first, and then it will create its component ships. If a wing arrives because all its ships were docked to something else, these assumptions are turned inside out. So we have to sort of bootstrap the creation of the wing by running a subset of the code from parse_wing_create_ships().

Definition at line 2428 of file missionparse.cpp.

void parse_cmd_brief ( mission pm)

Parse command briefing

Definition at line 1312 of file missionparse.cpp.

void parse_cmd_briefs ( mission pm)

Definition at line 1341 of file missionparse.cpp.

void parse_common_object_data ( p_object objp)

Definition at line 3517 of file missionparse.cpp.

void parse_create_docked_object_helper ( p_object pobjp,
p_dock_function_info infop 

Definition at line 1722 of file missionparse.cpp.

int parse_create_object ( p_object pobjp)

This is a bit tricky because of the way initial docking is now handled. Docking groups require special treatment.

Definition at line 1746 of file missionparse.cpp.

int parse_create_object_sub ( p_object p_objp)

Given a stuffed p_object struct, create an object and fill in the necessary fields.

object number.

Definition at line 1807 of file missionparse.cpp.

void parse_custom_bitmap ( const char *  expected_string_640,
const char *  expected_string_1024,
char *  string_field_640,
char *  string_field_1024 

Definition at line 405 of file missionparse.cpp.

void parse_cutscenes ( mission pm)

Definition at line 977 of file missionparse.cpp.

void parse_debriefing_new ( mission pm)

Parse the data required for the mission debriefings

Definition at line 1579 of file missionparse.cpp.

void parse_dock_one_docked_object ( p_object pobjp,
p_object parent_pobjp 

This is conceptually almost the same as obj_move_one_docked_object and is used in the same way.

Definition at line 1675 of file missionparse.cpp.

void parse_event ( mission pm)

Definition at line 4789 of file missionparse.cpp.

void parse_events ( mission pm)

Definition at line 4892 of file missionparse.cpp.

void parse_fiction ( mission pm)

Parse fiction viewer

Definition at line 1264 of file missionparse.cpp.

subsys_status* parse_get_subsys_status ( p_object pobjp,
char *  subsys_name 

Definition at line 7324 of file missionparse.cpp.

void parse_goal ( mission pm)

Definition at line 4903 of file missionparse.cpp.

void parse_goals ( mission pm)

Definition at line 4962 of file missionparse.cpp.

void parse_init ( bool  basic)

Initialize the mission parse process.

Definition at line 5929 of file missionparse.cpp.

int parse_lookup_alt_name ( char *  name)
int parse_main ( const char *  mission_name,
int  flags 

Definition at line 5947 of file missionparse.cpp.

void parse_messages ( mission pm,
int  flags 

Definition at line 5031 of file missionparse.cpp.

int parse_mission ( mission pm,
int  flags 

Definition at line 5519 of file missionparse.cpp.

void parse_mission_info ( mission pm,
bool  basic = false 

Definition at line 434 of file missionparse.cpp.

void parse_music ( mission pm,
int  flags 

Parse the event music and briefing music for the mission

Definition at line 1089 of file missionparse.cpp.

int parse_object ( mission pm,
int  flag,
p_object p_objp 

Mp points at the text of an object, which begins with the "$Name:" field. Snags all object information. Creating the ship now only happens after everything has been parsed.

flagis parameter that is used to tell what kind information we are retrieving from the mission. if we are just getting player starts, then don't create the objects

Definition at line 2721 of file missionparse.cpp.

void parse_object_clear_all_handled_flags ( )

Definition at line 6229 of file missionparse.cpp.

void parse_object_clear_handled_flag_helper ( p_object pobjp,
p_dock_function_info infop 

Definition at line 6223 of file missionparse.cpp.

void parse_object_mark_dock_leader_helper ( p_object pobjp,
p_dock_function_info infop 

In both retail and SCP, the dock "leader" is defined as the only guy in his group with a non-false arrival cue

Definition at line 6170 of file missionparse.cpp.

int parse_object_on_arrival_list ( p_object pobjp)

Definition at line 6812 of file missionparse.cpp.

void parse_object_set_handled_flag_helper ( p_object pobjp,
p_dock_function_info infop 

Definition at line 6217 of file missionparse.cpp.

void parse_objects ( mission pm,
int  flag 

Definition at line 3752 of file missionparse.cpp.

void parse_one_background ( background_t background)

Definition at line 5149 of file missionparse.cpp.

void parse_player_info ( mission pm)

Definition at line 794 of file missionparse.cpp.

void parse_player_info2 ( mission pm)

Definition at line 833 of file missionparse.cpp.

void parse_plot_info ( mission pm)

Definition at line 1015 of file missionparse.cpp.

void parse_reinforcement ( mission pm)

Definition at line 5076 of file missionparse.cpp.

void parse_reinforcements ( mission pm)

Definition at line 5140 of file missionparse.cpp.

void parse_variables ( )

Definition at line 5462 of file missionparse.cpp.

void parse_waypoint_list ( mission pm)

Definition at line 4971 of file missionparse.cpp.

void parse_waypoints_and_jumpnodes ( mission pm)

Definition at line 4986 of file missionparse.cpp.

void parse_wing ( mission pm)

Definition at line 4305 of file missionparse.cpp.

int parse_wing_create_ships ( wing wingp,
int  num_to_create,
int  force,
int  specific_instance 

Tries to create a wing of ships.

[in,out]wingpPointer to the wing structure of the wing to be created
[in]num_to_createNumber of ships to create
[in]forceIf set to 1, the wing will be created regardless of whether or not the arrival conditions have been met yet.
[in]specific_instanceSet this to create a specific ship from this wing
Number of ships created

Definition at line 3934 of file missionparse.cpp.

void parse_wings ( mission pm)

Definition at line 4631 of file missionparse.cpp.

void position_ship_for_knossos_warpin ( p_object p_objp)

Definition at line 1624 of file missionparse.cpp.

void post_process_mission ( )

Definition at line 5648 of file missionparse.cpp.

void post_process_path_stuff ( )

Resolve arrival/departure path masks NB: between parsing and the time this function is run, the path_mask variables store the index of the path info; at all other times, they store the masks of the bay paths as expected

Definition at line 4697 of file missionparse.cpp.

void post_process_ships_wings ( )

Definition at line 4720 of file missionparse.cpp.

int pp_collide_any ( vec3d curpos,
vec3d goalpos,
float  radius,
object ignore_objp1,
object ignore_objp2,
int  big_only_flag 

Return true if the vector from curpos to goalpos intersects with any ship other than the ignore objects. Calls pp_collide()

Definition at line 2842 of file aicode.cpp.

void process_loadout_objects ( )

Checks the list of Parse_objects to see if any of them should be reassigned based on the number of ships of that class that were present in the loadout.

Definition at line 3693 of file missionparse.cpp.

void reset_arrival_to_false ( p_object pobjp,
bool  reset_wing 

Definition at line 6145 of file missionparse.cpp.

void resolve_parse_flags ( object objp,
int  parse_flags,
int  parse_flags2 

Definition at line 2491 of file missionparse.cpp.

void resolve_path_masks ( int  anchor,
int path_mask 

Definition at line 4643 of file missionparse.cpp.

void set_cue_to_false ( int cue)

Definition at line 6138 of file missionparse.cpp.

bool sexp_is_locked_false ( int  node)

Definition at line 6129 of file missionparse.cpp.

int ship_can_use_warp_drive ( ship shipp)

Checks the warp drive; we might be able to depart some other way (e.g. by entering a docking bay)

Definition at line 6996 of file missionparse.cpp.

void swap_parse_object ( p_object p_obj,
int  new_ship_class 

Replaces a p_object with a new one based on a Ship_info index.

Definition at line 3802 of file missionparse.cpp.

void update_loadout_totals ( team_data current_team,
int  loadout_index 

Updates the loadout quanities for a ship class.

Definition at line 3625 of file missionparse.cpp.

Variable Documentation

char* Ai_behavior_names[MAX_AI_BEHAVIORS]
Initial value:
= {
"Get behind",
"Stay Near",
"Big Ship",
"Be Rearmed",
"Evade Weapon",
"Play Dead",
"Bay Emerge",
"Bay Depart",
"Sentry Gun",
"Warp Out",

Definition at line 184 of file missionparse.cpp.

char* Arrival_location_names[MAX_ARRIVAL_NAMES]
Initial value:
= {
"Hyperspace", "Near Ship", "In front of ship", "Docking Bay",

Definition at line 236 of file missionparse.cpp.

char Arriving_repair_targets[MAX_AI_GOALS][NAME_LENGTH]

Definition at line 130 of file missionparse.cpp.

p_object * Arriving_support_ship

Definition at line 129 of file missionparse.cpp.

char* Cargo_names[MAX_CARGO]

Definition at line 208 of file missionparse.cpp.

char Cargo_names_buf[MAX_CARGO][NAME_LENGTH]

Definition at line 209 of file missionparse.cpp.

ushort Current_file_checksum = 0

Definition at line 105 of file missionparse.cpp.

int Current_file_length = 0

Definition at line 107 of file missionparse.cpp.

char* Departure_location_names[MAX_DEPARTURE_NAMES]
Initial value:
= {
"Hyperspace", "Docking Bay",

Definition at line 240 of file missionparse.cpp.

char dockee[NAME_LENGTH]

Definition at line 79 of file missionparse.cpp.

char dockee_point[NAME_LENGTH]

Definition at line 81 of file missionparse.cpp.

char docker[NAME_LENGTH]

Definition at line 78 of file missionparse.cpp.

char docker_point[NAME_LENGTH]

Definition at line 80 of file missionparse.cpp.

fix Entry_delay_time = 0

Definition at line 99 of file missionparse.cpp.

SCP_vector<texture_replace> Fred_texture_replacements

Definition at line 152 of file missionparse.cpp.

char* Goal_type_names[MAX_GOAL_TYPE_NAMES]
Initial value:
= {
"Primary", "Secondary", "Bonus",

Definition at line 244 of file missionparse.cpp.

char* Icon_names[MIN_BRIEF_ICONS]
Initial value:
= {
"Fighter", "Fighter Wing", "Cargo", "Cargo Wing", "Largeship",
"Largeship Wing", "Capital", "Planet", "Asteroid Field", "Waypoint",
"Support Ship", "Freighter(no cargo)", "Freighter(has cargo)",
"Freighter Wing(no cargo)", "Freighter Wing(has cargo)", "Installation",
"Bomber", "Bomber Wing", "Cruiser", "Cruiser Wing", "Unknown", "Unknown Wing",
"Player Fighter", "Player Fighter Wing", "Player Bomber", "Player Bomber Wing",
"Knossos Device", "Transport Wing", "Corvette", "Gas Miner", "Awacs", "Supercap", "Sentry Gun", "Jump Node", "Transport"

Definition at line 213 of file missionparse.cpp.

LOCAL { ... } Initially_docked[MAX_SHIPS]
ushort Last_file_checksum = 0

Definition at line 106 of file missionparse.cpp.

int Loading_screen_bm_index =-1

Definition at line 338 of file missionparse.cpp.

int Mission_alt_type_count = 0

Definition at line 111 of file missionparse.cpp.

char Mission_alt_types[MAX_ALT_TYPE_NAMES][NAME_LENGTH]

Definition at line 110 of file missionparse.cpp.

int Mission_arrival_timestamp

Definition at line 341 of file missionparse.cpp.

int Mission_callsign_count = 0

Definition at line 115 of file missionparse.cpp.

char Mission_callsigns[MAX_CALLSIGNS][NAME_LENGTH]

Definition at line 114 of file missionparse.cpp.

int Mission_departure_timestamp

Definition at line 342 of file missionparse.cpp.

fix Mission_end_time

Definition at line 343 of file missionparse.cpp.

char* Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS]
Initial value:
= {
"always true",
"always false",
"first repeat",
"last repeat",
"first trigger",
"last trigger",
"state change",

Definition at line 318 of file missionparse.cpp.

char Mission_filename[80]

Definition at line 87 of file missionparse.cpp.

int Mission_palette

Definition at line 89 of file missionparse.cpp.

char Mission_parse_storm_name[NAME_LENGTH] = "none"

Definition at line 138 of file missionparse.cpp.

int Multi_ping_timestamp

Definition at line 30 of file fredstubs.cpp.

char* Neb2_filenames[NUM_NEBULAS]
Initial value:
= {

Definition at line 165 of file missionparse.cpp.

char* Nebula_colors[NUM_NEBULA_COLORS]
Initial value:
= {
"Grey blue",
"Grey Green",

Definition at line 172 of file missionparse.cpp.

char* Nebula_filenames[NUM_NEBULAS]
Initial value:
= {

Definition at line 159 of file missionparse.cpp.

int Nebula_index

Definition at line 90 of file missionparse.cpp.

int Num_ai_behaviors = MAX_AI_BEHAVIORS

Definition at line 91 of file missionparse.cpp.

int Num_arrival_names = MAX_ARRIVAL_NAMES

Definition at line 94 of file missionparse.cpp.

int Num_arriving_repair_targets

Definition at line 131 of file missionparse.cpp.

int Num_cargo = 0

Definition at line 92 of file missionparse.cpp.

int Num_goal_type_names = MAX_GOAL_TYPE_NAMES

Definition at line 95 of file missionparse.cpp.

int Num_parse_goals

Definition at line 96 of file missionparse.cpp.

int Num_parse_names

Definition at line 150 of file missionparse.cpp.

int Num_path_restrictions

Definition at line 154 of file missionparse.cpp.

int Num_reinforcement_type_names = sizeof(Reinforcement_type_names) / sizeof(char *)

Definition at line 333 of file missionparse.cpp.

int Num_status_names = MAX_STATUS_NAMES

Definition at line 93 of file missionparse.cpp.

int Num_teams

Definition at line 98 of file missionparse.cpp.

int Num_unknown_loadout_classes

Definition at line 103 of file missionparse.cpp.

int Num_unknown_ship_classes

Definition at line 101 of file missionparse.cpp.

int Num_unknown_weapon_classes

Definition at line 102 of file missionparse.cpp.

char* Old_game_types[OLD_MAX_GAME_TYPES]
Initial value:
= {
"Single Player Only",
"Multiplayer Only",
"Single/Multi Player",
"Training mission"

Definition at line 253 of file missionparse.cpp.


Definition at line 149 of file missionparse.cpp.

char* Parse_object_flags[MAX_PARSE_OBJECT_FLAGS]
Initial value:
= {

Definition at line 260 of file missionparse.cpp.

char* Parse_object_flags_2[MAX_PARSE_OBJECT_FLAGS_2]
Initial value:
= {

Definition at line 290 of file missionparse.cpp.

SCP_vector<p_object> Parse_objects

Definition at line 124 of file missionparse.cpp.

matrix Parse_viewer_orient

Definition at line 336 of file missionparse.cpp.

vec3d Parse_viewer_pos

Definition at line 335 of file missionparse.cpp.

Definition at line 155 of file missionparse.cpp.

p_object* Player_start_pobject

Definition at line 145 of file missionparse.cpp.

char Player_start_shipname[NAME_LENGTH]

Definition at line 143 of file missionparse.cpp.

int Player_start_shipnum

Definition at line 144 of file missionparse.cpp.

int Player_starts = 1

Definition at line 97 of file missionparse.cpp.

char* Reinforcement_type_names[]
Initial value:
= {

Definition at line 248 of file missionparse.cpp.

p_object Ship_arrival_list

Definition at line 121 of file missionparse.cpp.

char* Ship_class_names[MAX_SHIP_CLASSES]

Definition at line 211 of file missionparse.cpp.

char* Status_desc_names[MAX_STATUS_NAMES]
Initial value:
= {
"Shields Critical", "Engines Damaged", "Fully Operational",

Definition at line 223 of file missionparse.cpp.

char* Status_target_names[MAX_STATUS_NAMES]
Initial value:
= {
"Weapons", "Engines", "Cable TV",

Definition at line 231 of file missionparse.cpp.

char* Status_type_names[MAX_STATUS_NAMES]
Initial value:
= {
"Damaged", "Disabled", "Corroded",

Definition at line 227 of file missionparse.cpp.

int Subsys_index

Definition at line 135 of file missionparse.cpp.

subsys_status* Subsys_status = NULL

Definition at line 134 of file missionparse.cpp.

int Subsys_status_size

Definition at line 136 of file missionparse.cpp.

p_object Support_ship_pobj

Definition at line 128 of file missionparse.cpp.

Definition at line 140 of file missionparse.cpp.

mission The_mission

Definition at line 86 of file missionparse.cpp.

int Total_initially_docked

Definition at line 84 of file missionparse.cpp.