Difference between revisions of "FreeSpace 2 Mission File Format"

From FreeSpace Wiki
Jump to: navigation, search
(#Background bitmaps: Add historical note of still parsed entries)
 
(4 intermediate revisions by the same user not shown)
Line 80: Line 80:
 
         FLOAT, FLOAT, FLOAT
 
         FLOAT, FLOAT, FLOAT
 
*Orientation Matrix for FRED camera
 
*Orientation Matrix for FRED camera
 +
 +
$Starting wing names: LIST of STRINGS
 +
*Wings present at the start of the mission, also used for loadout selection
 +
*LIST defaults to ( "Alpha" "Beta" "Gamma" )
 +
*Maximum size of LIST is three strings
 +
*The first STRING in this list must match the first string in $Team-versus-team wing names:
 +
 +
$Squadron wing names: LIST of STRINGS
 +
*Unknown - need to check further
 +
*LIST defaults to ( "Alpha" "Beta" "Gamma" "Delta" "Epsilon" )
 +
 +
$Team-versus-team wing names: LIST of STRINGS
 +
*Unknown - need to check further
 +
*LIST defaults to ( "Alpha" "Zeta" )
 +
*The first STRING in this list must match the first string in $Starting wing names:
  
 
+SquadReassignName: STRING
 
+SquadReassignName: STRING

Latest revision as of 10:10, 26 January 2012

.fs2 files are simple text files defining how FS2 will 'execute' a given mission. It refers to external files for the actual assets used in the mission, including Model files and Tables.

General Format

File section headers start with the "#" character. Each file section should be separated by a blank line.

Statements start with either the "$" or "+" characters, and may last for multiple lines. Comments are indicated by ";!", and continue to the end of the line.

STRING refers to a String data. The game parses these from the ":" at the end of the flag it belongs to until the next flag begins.

XSTR is a single XSTR entry, formatted like this: XSTR("Text data", -1) . The "-1" refers to the entry in tstrings.tbl that contains the translated version.

INT is a single integer.

FLOAT is a floating point number, usually used with 6 digits after the decimal point.

SEXP is a symbolic expression or chain of symbolic expressions. Example:

( when
   ( >
      ( distance "Zeta 3" "center:1" )
      2000
   )
   ( send-message
      "#Command"
      "High"
      "msg08"
   )
)

Sections

#Mission Info

Fields:

$Version: STRING

  • contains the version number for this mission

$Name: XSTR

  • contains the name of this mission. Uses tstrings.tbl for translation.

$Author: STRING

  • The author's name

$Created: STRING

  • The time and date that this mission was created on. Format is "MM/DD/YY at HH:MI:SS", where MM = Month, DD = Day, YY = Year, HH = Hours (24 hour format), MI = minutes and SS = seconds.

$Notes: STRING

  • Contains any notes the mission designer wishes to add.

$End Notes: ??

$Mission Desc: XSTR

  • Contains a short description of this mission. Uses tstrings.tbl for translation.

$end_multi_text

+Game Type Flags: INT

+Flags: INT

+NebAwacs: FLOAT

+Storm: STRING

+Red Alert: INT

+Scramble: INT

+Disallow Support: 0 or 1

  • Whether or not support ships are available on this mission

+Hull Repair Ceiling: FLOAT

+Subsystem Repair Ceiling: FLOAT

+Player Entry Delay: FLOAT

+Viewer pos: FLOAT, FLOAT, FLOAT

  • FRED camera position

+Viewer orient:

       FLOAT, FLOAT, FLOAT, 
       FLOAT, FLOAT, FLOAT, 
       FLOAT, FLOAT, FLOAT
  • Orientation Matrix for FRED camera

$Starting wing names: LIST of STRINGS

  • Wings present at the start of the mission, also used for loadout selection
  • LIST defaults to ( "Alpha" "Beta" "Gamma" )
  • Maximum size of LIST is three strings
  • The first STRING in this list must match the first string in $Team-versus-team wing names:

$Squadron wing names: LIST of STRINGS

  • Unknown - need to check further
  • LIST defaults to ( "Alpha" "Beta" "Gamma" "Delta" "Epsilon" )

$Team-versus-team wing names: LIST of STRINGS

  • Unknown - need to check further
  • LIST defaults to ( "Alpha" "Zeta" )
  • The first STRING in this list must match the first string in $Starting wing names:

+SquadReassignName: STRING

+SquadReassignLogo: STRING

  • Squadron the player is reassigned to

$Skybox Model: STRING

  • Which skybox model to use

$AI Profile: STRING

  • Which AI profile is used

#Fiction Viewer

$File: STRING

  • Name of the text file that will be displayed in the fiction viewer. The file needs to be in data/fiction, and interface art for the fiction viewer must be present.

#Sexp_variables

$Variables:


#Plot Info

$Tour: XSTR

$Pre-Briefing Cutscene: STRING

$Pre-Mission Cutscene: STRING

$Next Mission Success: STRING

$Next Mission Partial: STRING

$Next Mission Failure: STRING


#Command Briefing

  • Defines the Command Briefing section of the briefing. If no command briefing is required, leave this blank. Stages are defined like this:

$Stage Text: XSTR

  • The text to be displayed in this stage

$end_multi_text

$Ani Filename: STRING

  • The ani that will be played while the above text is displayed

+Wave Filename: STRING

  • The filename of the voiceover

#Briefing

  • Defines the Mission Briefing. Leaving this blank will cause 'no briefing' to be shown instead of a mission briefing.

Briefing init

$start_briefing

$num_stages: INT

  • Number of stages in this briefing. Stages are defined as follows:

$start_stage

$multi_text XSTR

  • Briefing text for this stage.

$end_multi_text

$voice: STRING

  • Voiceover filename

$camera_pos: FLOAT, FLOAT, FLOAT

  • Camera position for this stage

$camera_orient:

           FLOAT, FLOAT, FLOAT,
           FLOAT, FLOAT, FLOAT,
           FLOAT, FLOAT, FLOAT 
  • Camera orientation matrix

$camera_time: INT

$num_lines: INT

$num_icons: INT

$Flags: INT

$Formula: SEXP

Icons

  • Icons are defined as follows

$start_icon

$type: INT

$team: STRING

  • Friendly, Hostile, or Neutral

$class: STRING

  • Must be a valid reference to a ship class from ships.tbl

$pos: FLOAT, FLOAT, FLOAT

$label: STRING

+id: INT

$hlight: INT

$mirror: INT

$multi_text

$end_multi_text

$end_icon


#Debriefing_info

$num stages: INT

  • Number of debriefing stages. Debrief stages are defined as follows

$Formula: SEXP

  • Conditions that must be true for the debriefing stage to be shown. Note that several debrief stages may be shown at the same time.

$Multi text

XSTR

$end_multi_text

$Voice: STRING

$Recommendation text: XSTR

$end_multi_text


#Alternate Types

$Alt: STRING

  • Contains an Alternate type name. This is a list entry; All alternate types used in the mission must appear here. Must be terminated by #end.

#Callsigns:

$Callsign: STRING

  • Similar to the Alternate Types list. All Callsigns used in the mission must be listed here. Must be terminated by #end.

#Players

  • Defines the players for the mission. At least one player must be defined.

$Starting Shipname: STRING

$Ship Choices: ( STRING INT )

  • The STRING contains the ship class, the INT holds the number of ships available. Can be left blank ( "$Ship choices: ( )" is valid).

+Weaponry Pool: ( STRING INT )

  • The STRING contains the weapon name, the INT the number of weapons available. Primary weapons are listed before secondary weapons.
  • NOTE: For multiplayer TVT missions, these three items need to be present a second time to define the loadout team 2 gets.

#Objects

  • Defines all the objects in the mission and their initial state.
  • This includes all ships (including the player ships), installations and other objects.
  • Does not include asteroid (debris) fields.

$Name: STRING

$Class: STRING

$Alt: STRING

  • Alternate class name. Must be defined in the #Alternate Types list above.

$Callsign: STRING

  • Optional Callsign. Must be defined in the #Callsigns list above.

$Team: STRING

$Location: FLOAT, FLOAT, FLOAT

$Orientation:

       FLOAT, FLOAT, FLOAT, 
       FLOAT, FLOAT, FLOAT, 
       FLOAT, FLOAT, FLOAT

$IFF: STRING

$AI Behavior: STRING

+AI Class: STRING

$AI Goals: ( goals ( SEXP ) )

  • SEXP must be from the ai goals list

$Cargo 1: XSTR

+Initial Velocity: INT

+Initial Hull: INT

+Subsystem: STRING

$Arrival Location: STRING

$Arrival Cue: SEXP

$Departure Location: STRING

$Departure Cue: SEXP

$Determination: INT

+Flags: ( STRING )

  • Flags must be enclosed by "".

+Respawn priority: INT

+Orders Accepted: INT

  • This is a bitfield

+Group: INT

+Score: INT

+Persona Index: INT


#Wings

  • Defines all wings in the mission, friendly and hostile

$Name: STRING

$Waves: INT

$Wave Threshold: INT

$Special Ship: INT

$Arrival Location: STRING

$Arrival Cue: SEXP

$Departure Location: STRING

$Departure Cue: SEXP

$Ships: ( STRING )

$AI Goals: ( goals ( SEXP ) )

  • SEXP must be from the ai goals list

+Hotkey: INT

+Flags: ( STRING )


#Events

  • The SEXPs that make up the Events List. Events are formatted as follows:

$Formula: SEXP

+Name: STRING

+Repeat Count: INT

+Interval: INT

+Chained: INT

  • The INT shows the chain delay in seconds.

+Objective: XSTR

+Team: INT


#Goals

  • The mission directives. Goals are formatted as follows:

$Type: STRING

  • Primary or Secondary

+name: STRING

$MessageNew: XSTR

$end_multi_text

$Formula: SEXP

+No music

+Invalid


#Waypoints

$Name: STRING

$List: ( ( FLOAT, FLOAT, FLOAT ) )

  • The list can contain more than one Waypoint, example: ( ( FLOAT, FLOAT, FLOAT ) ( FLOAT, FLOAT, FLOAT ) )

#Messages

$Name: STRING

$Team: INT

$MessageNew: XSTR

$end_multi_text

+Persona: STRING

+AVI Name: STRING

+Wave Name: STRING


#Reinforcements

$Name: STRING

  • Name of the wing that is available as reinforcement. That wing needs to have the "reinforcement" flag.

$Type: STRING

$Num times: INT

+Arrival Delay: INT

+No Messages: ( STRING )

+Yes Messages: ( STRING )


#Background bitmaps

$Num stars: INT

$Ambient light level: INT

+Neb2: STRING

+Neb2Flags: INT

+Nebula: STRING

  • (Optional) HISTORICAL Version 1 nebula, not used in FS2 retail campaign.
  • +Color: STRING
    • (Optional) HISTORICAL Version 1 nebula, not used in FS2 retail campaign.
  • +Pitch: INT
    • (Optional) HISTORICAL Version 1 nebula, not used in FS2 retail campaign.
  • +Bank: INT
    • (Optional) HISTORICAL Version 1 nebula, not used in FS2 retail campaign.
  • +Heading: INT
    • (Optional) HISTORICAL Version 1 nebula, not used in FS2 retail campaign.

$Bitmap List:

  • Contains all background bitmaps and suns. Sun entries look like this:

$Sun: STRING

$Angles: FLOAT FLOAT FLOAT

  • Background nebulae and other objects look like this:

$Starbitmap: STRING

+Angles: FLOAT FLOAT FLOAT

+ScaleX: FLOAT

+ScaleY: FLOAT

+DivX: INT

+DivY: INT


#Asteroid Fields

$Density: INT

+Field Type: INT

+Debris Genre: INT

+Field Debris Type: INT

$Average Speed: FLOAT

$Minimum: FLOAT, FLOAT, FLOAT

$Maximum: FLOAT, FLOAT, FLOAT


#Music

$Event Music: STRING

$Briefing Music: STRING


#End

  • The end of the file.