====== .OBJ file ====== The OBJ file holds all the objectives in a mission. Objectives are basically static things, like towns, cities, bridges, bases. Things which cannot be moved. \\ Objectives are usually composed of features. Each feature being a particular part of the overall objective. So an airbase objective may have runway, hangar and control tower as features. \\ Objectives also have a fixed position on the map governed by their X, Y coordinates. They may also have: \\ a parent - an objective that they are a child of, used in the naming sometimes. \\ a name - an index into the strings file used to name the objective. 0 indicates the objective has no name of its own. \\ a campaign ID - ID2 - used to related things. \\ an owner - which side owns this objective. \\ a controller - which side actually controls the objective. \\ a type - an index into the OCD file showing which objective type this is. \\ Various flags associated with the objective \\ Details of each feature composing the objective, detailing how damaged it is. \\ A list of links to other objectives - this gives routes to other places. \\ ===== .OBJ File Format ===== ==== Raw (compressed contents) ==== ^Field^Data Type^Width (in bytes)^Description^ |NumObjectives |Signed 16-bit integer|2|Number of objective records in the data that follows| |UncompressedSize|Signed 32-bit integer|4|Size, in bytes, of the data that follows, when it's uncompressed| |CompressedSize |Signed 32-bit integer|4|Size, in bytes, of the compressed file to follow| |DATA|byte[]|(CompressedSize)|[[falcon4:file_formats:cam_trn_tac:lzss_compression|LZSS-compressed]] binary data.| ==== Uncompressed contents of the DATA field ==== ^Field^Data Type^Width (in bytes)^Description^Versions^ |objectiveRecords[]|ObjectiveRecord[NumObjectives]| | |All| ===== Structures Used ===== === ObjectiveRecord structure === ^Field^Data Type^Width (in bytes)^Description^Versions^ |objectiveType|unsigned 16-bit integer|2| |All| |objective|ObjectiveClass| | |All| === ObjectiveClass structure === ^Field^Data Type^Width (in bytes)^Description^Versions^ |id|VU_ID|8| |All| |entityType| unsigned 16-bit integer | 2| | All| |x| Signed 16-bit integer | 2| | All| |y| Signed 16-bit integer | 2| | All| |z| single-precision 32-bit floating point | 4| | >=70 | |spotTime| unsigned 32-bit integer | 4| | All | |spotted| signed 16-bit integer | 2| | All | |baseFlags | signed 16-bit integer | 2| | All | |owner | byte | 1| | All | |campId | signed 16-bit integer | 2| | All | |lastRepair|unsigned 32-bit integer|4| |All| |obj_flags|unsigned 32-bit integer|4| |>1| |obj_flags|unsigned 16-bit integer|2| |< = 1| |supply|byte|1| |All| |fuel|byte|1| |All| |losses|byte|1| |All| |numStatuses|byte|1| |All| |fStatus[]|byte[numStatuses]|(numStatuses) bytes| |All| |priority|byte|1| |All| |nameId|Signed 16-bit integer|2| |All| |parent|VU_ID|8| |All| |first_owner|byte|1| |All| |numLinks|byte|1| |All| |link_data[]|ObjectiveLink[numLinks]| | |All| |hasRadarData|byte|1| |>=20| |detect_ratio[]|array of single-precision 32-bit floating point * 8|4*8 = 32 bytes| Only present if hasRadarData field <> 0 |>=20| === ObjectiveLink structure === ^Field^Data Type^Width (in bytes)^Description^ |costs[]|byte[8]|8| | |newId|VU_ID|8| | === VU_ID structure === ^Field^Data Type^Width (in bytes)^Description^ |num_|unsigned 32-bit integer|4| | |creator_|unsigned 32-bit integer|4| |