From 6ac51747f13445f0bd6e1b76585c5285daa2ea32 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 24 Sep 2022 12:18:00 -0500 Subject: [PATCH] Updates per #12 --- Mission_TIE95.txt | 88 ++++------------------- Readme.txt | 8 +++ Tie/FlightGroup.FGGoals.cs | 18 +---- Tie/FlightGroup.Order.cs | 6 +- Tie/Mission.Trigger.cs | 13 +++- Tie/Mission.cs | 14 ++-- Tie/Strings.cs | 141 +++++++++---------------------------- 7 files changed, 74 insertions(+), 214 deletions(-) diff --git a/Mission_TIE95.txt b/Mission_TIE95.txt index 52c408c..a69ef21 100644 --- a/Mission_TIE95.txt +++ b/Mission_TIE95.txt @@ -1,7 +1,7 @@ TIE Mission File Author: Michael Gaisser (mjgaisser@gmail.com) Site: https://github.com/MikeG621 -Updated: 2020.10.10 +Updated: 2022.09.22 ===== This is going to be a very lengthy definition of the TIE95 mission file. Due @@ -77,7 +77,7 @@ struct FileHeader (size 0x1CA) 0x008 BYTE Unknown1 0x009 BOOL Unknown2 0x00A BYTE BriefingOfficers - 0x00D BOOL CapturedOnEject + 0x00D BOOL Unknown (Formerly CapturedOnEject) 0x018 CHAR[64][6] EndOfMissionMessages 0x19A CHAR[12][4] IffNames3-6 } @@ -274,9 +274,7 @@ present in the room before you launch into a mission. 03 Secret Order (No other values used, but evaluate to Both Officers) -CapturedOnEject will send you to a prison planet when true, rescued by Imperial -forces when false. Of course, death is always an option, and is seemingly -random. The next six strings are the messages you see after the given goals are +The next six strings are the messages you see after the given goals are completed or failed. The array is really [3,2], two messages each for PrimaryComplete, SecondaryComplete and PrimaryFailed in that order. Following that, we have the name of the extra IFFs. IFF1 and IFF2 are hard-coded as Rebel @@ -345,8 +343,7 @@ different orders take different amounts for different reasons. Target and TargetType are the same as Trigger.Variable and VariableType. Goals are for that specific flight group. The array is comprised of Primary, -Secondary, Secret and Bonus, in that order. The Secret goal as far I can tell -is simply hidden and really doesn't affect anything. For BonusGoalPoints, the +Secondary, Unused, and Bonus, in that order. For BonusGoalPoints, the stored value is expressed as (Points / 50), so 01 is 50pts, 02 is 100pts, etc. Because the value is an SBYTE, this yields a point range of [-6400, +6350]. By the Force use these goals instead of Global Goals when possible. @@ -565,12 +562,11 @@ Status 02 1/2 Warheads 03 No Shields 04 1/2 Shields -05 No Lasers +05 No Turrets 06 No Hyperdrive 07 Shields 0%, charging 08 Shields added or 200% 09 Hyperdrive added -14 Invincible Warhead 00 None @@ -649,7 +645,7 @@ Condition 15 0% Shields 16 50% Hull 17 Out of Warheads -18 Unknown (arrive?) +18 Cannon system disabled VariableType 00 None @@ -661,11 +657,9 @@ VariableType 06 Order (enum) 07 CraftWhen (enum) 08 Global Group -09 Misc (enum) -0A Unknown* - -* Appears to be nothing, probably due to sloppiness with the format -Only seen as "100% of 0A 01 must TRUE" and "Hold Steady, T3: 0A None" +09 Adjusted AI skill level (enum) +0A Status (enum) +0B All Craft CraftCategory 00 Starfighters @@ -786,18 +780,12 @@ Order 20 Board to Repair Var1 Docking Time (seconds x 5) Var2 Number of Dockings -21 Hold Station -22 Hold Steady -23 SS Hold Station -24 SS Kamikaze? -25 SS Kamikaze? -26 SS Disabled -27 SS Disabled CraftWhen -01 Boarding -02 Boarded -03 Defence +00 Captured +01 Inspected +02 Finish being boarded +03 Finished docking 04 Disabled 05 Attacked 06 Any hull damage @@ -806,56 +794,6 @@ CraftWhen 09 Player's craft 0A Non-player's craft -Misc -00 Rookie craft -01 Novice craft -02 Officer craft -03 Veteran craft -04 Ace craft -05 Top Ace craft -06 Stationary craft -07 Craft returning to base -08 Non-evading craft -09 Craft in formation -0A Rendezvousing craft -0B Disabled craft -0C Craft awaiting boarding -0D Attacking craft -0E Craft atatcking escorts -0F Protecting craft -10 Escorting craft -11 Disabling craft -12 Delivering craft -13 Siezing craft -14 Exchanging craft -15 Capturing craft -16 Craft destroying cargo -17 Picked up craft -18 Dropped off craft -19 Waiting fighters -1A Waiting starships -1B Patrolling starships -1C SS awaiting returns -1D SS waiting to launch -1E SS waiting to be boarded -1F SS witing for boarding craft to appear -20 SS attacking -21 SS disabling -22 SS disabling? -23 SS flying home -24 Rebels -25 Imperials -27 Spacecraft -28 Weapons -29 Space objects -2E Fighters -2F Transports -30 Freighters -31 Utility craft -32 Startships -33 Platforms -36 Mines - EventType 03 Page Break 04 Title Text diff --git a/Readme.txt b/Readme.txt index 10430df..996c946 100644 --- a/Readme.txt +++ b/Readme.txt @@ -11,6 +11,14 @@ Library for editing LucasArts *.XWI and *.TIE mission files for Xwing95, TIE95, ========= Version History + - Updates for TIE. Deleted items are those confirmed to have zero effect in the exectuable. [Issue #12] + - "Captured on Ejection" and "Secret Goals" removed + - Trigger "Unknown (arrive?)" now "cannon subsystem disabled" + - Trigger Type "Craft When" fixed + - Trigger Type "Misc" now "Adjusted AI Skill", added "Status" and "All Craft" types to match XvT + - Status "No Lasers" now "No Turrets", everything past "Hyperdrive Added" deleted + - Orders after "Board to Repair" deleted + v5.7.4, 27 Aug 2022 - (XxT) Briefing TicksPerSecond updated to 21 (0x15) instead of 20. diff --git a/Tie/FlightGroup.FGGoals.cs b/Tie/FlightGroup.FGGoals.cs index 27ba74a..712e354 100644 --- a/Tie/FlightGroup.FGGoals.cs +++ b/Tie/FlightGroup.FGGoals.cs @@ -1,13 +1,14 @@ /* * Idmr.Platform.dll, X-wing series mission library file, TIE95-XWA - * Copyright (C) 2009-2014 Michael Gaisser (mjgaisser@gmail.com) + * Copyright (C) 2009-2022 Michael Gaisser (mjgaisser@gmail.com) * Licensed under the MPL v2.0 or later * * Full notice in ../help/Idmr.Platform.chm - * Version: 2.1 + * Version: 2.1+ */ /* CHANGELOG + * [DEL #12] SecretCondition and Secret amount, still accesible via the Indexer * v2.1, 141214 * [UPD] change to MPL * v2.0, 120525 @@ -81,19 +82,6 @@ public byte SecondaryAmount get { return _items[3]; } set { _items[3] = value; } } - /// Gets or sets the hidden goal - /// Use of this goal is unknown, entirely hidden - public byte SecretCondition - { - get { return _items[4]; } - set { _items[4] = value; } - } - /// Gets or sets the amount of the FlightGroup required to meet - public byte SecretAmount - { - get { return _items[5]; } - set { _items[5] = value; } - } /// Gets or sets the Bonus goal public byte BonusCondition { diff --git a/Tie/FlightGroup.Order.cs b/Tie/FlightGroup.Order.cs index 6baf50e..1741216 100644 --- a/Tie/FlightGroup.Order.cs +++ b/Tie/FlightGroup.Order.cs @@ -4,10 +4,11 @@ * Licensed under the MPL v2.0 or later * * Full notice in ../help/Idmr.Platform.chm - * Version: 5.7 + * Version: 5.7+ */ /* CHANGELOG + * [UPD #12] Importing order values past Board to Repair (0x20) will reset to zero to match TIE behavior * v5.7, 220127 * [NEW] cloning ctor [JB] * v5.5, 2108001 @@ -84,7 +85,7 @@ static void checkValues(Order o) { string error = ""; byte tempVar; - if (o.Command > 39) error += "Command (" + o.Command + ")"; + if (o.Command > 32) o.Command = 0; // How TIE does it, also bypasses error in HI1W if (o.Target1Type == 10) o.Target1Type = o.Target1 = 0; if (o.Target2Type == 10) o.Target2Type = o.Target2 = 0; if (o.Target3Type == 10) o.Target3Type = o.Target3 = 0; @@ -202,6 +203,5 @@ public byte Unknown18 set { _items[4] = value; } } } - } } diff --git a/Tie/Mission.Trigger.cs b/Tie/Mission.Trigger.cs index 8b1ac42..84e66a1 100644 --- a/Tie/Mission.Trigger.cs +++ b/Tie/Mission.Trigger.cs @@ -4,10 +4,11 @@ * Licensed under the MPL v2.0 or later * * Full notice in ../help/Idmr.Platform.chm - * Version: 5.7 + * Version: 5.7+ */ /* CHANGELOG + * [UPD #12] ToString update for Ai Rating, Status and All Craft * v5.7, 220127 * [NEW] cloning ctor [JB] * v4.0, 200809 @@ -135,9 +136,15 @@ public override string ToString() trig += "Global Group " + Variable; break; case 9: - trig += "Misc " + BaseStrings.SafeString(Strings.Misc, Variable); + trig += "AI Rating " + BaseStrings.SafeString(Strings.Rating, Variable); break; - default: + case 0xA: + trig += "Craft with status: " + BaseStrings.SafeString(Strings.Status, Variable); + break; + case 0xB: + trig += "All craft"; + break; + default: trig += VariableType + " " + Variable; break; } diff --git a/Tie/Mission.cs b/Tie/Mission.cs index 0aae313..8c9be2d 100644 --- a/Tie/Mission.cs +++ b/Tie/Mission.cs @@ -1,13 +1,15 @@ /* * Idmr.Platform.dll, X-wing series mission library file, XW95-XWA - * Copyright (C) 2009-2020 Michael Gaisser (mjgaisser@gmail.com) + * Copyright (C) 2009-2022 Michael Gaisser (mjgaisser@gmail.com) * Licensed under the MPL v2.0 or later * * Full notice in ../help/Idmr.Platform.chm - * Version: 4.0 + * Version: 4.0+ */ /* CHANGELOG + * [DEL #12] CapturedOnEjection + * [UPD #12] Status reset if out of bounds during load * v4.0, 200809 * [UPD] PermaDeath changed to bool * [FIX] Handling to load incomplete briefing questions [JB] @@ -137,8 +139,6 @@ public void LoadFromStream(FileStream stream) stream.Position = 0xA; try { OfficersPresent = (BriefingOfficers)br.ReadByte(); } catch { OfficersPresent = BriefingOfficers.Both; } - stream.Position = 0xD; - CapturedOnEjection = br.ReadBoolean(); stream.Position = 0x18; for (i = 0; i < 6; i++) { @@ -178,6 +178,7 @@ public void LoadFromStream(FileStream stream) else FlightGroups[i].SpecialCargoCraft++; } FlightGroups[i].Status1 = buffer[4]; + if (FlightGroups[i].Status1 > 9 || (FlightGroups[i].Status1 > 7 && FlightGroups[i].CraftType == 0x70)) FlightGroups[i].Status1 = 0; FlightGroups[i].Missile = buffer[5]; FlightGroups[i].Beam = buffer[6]; FlightGroups[i].IFF = buffer[7]; @@ -431,8 +432,6 @@ public void Save() bw.Write((short)3); fs.Position = 0xA; fs.WriteByte((byte)OfficersPresent); - fs.Position = 0xD; - bw.Write(CapturedOnEjection); fs.Position = 0x18; for (int i = 0; i < 6; i++) { @@ -777,9 +776,6 @@ public bool SwapFG(int srcIndex, int dstIndex) /// Gets or sets the officers present before and after the mission /// Defaults to FlightOfficer public BriefingOfficers OfficersPresent { get; set; } - /// Gets or sets if the pilot is captured upon ejection or destruction - /// true results in capture, false results in rescue (default) - public bool CapturedOnEjection { get; set; } /// Gets or sets the FlightGroups for the mission /// Defaults to one FlightGroup diff --git a/Tie/Strings.cs b/Tie/Strings.cs index 61fe375..1755e71 100644 --- a/Tie/Strings.cs +++ b/Tie/Strings.cs @@ -1,13 +1,19 @@ /* * Idmr.Platform.dll, X-wing series mission library file, XW95-XWA - * Copyright (C) 2009-2020 Michael Gaisser (mjgaisser@gmail.com) + * Copyright (C) 2009-2022 Michael Gaisser (mjgaisser@gmail.com) * Licensed under the MPL v2.0 or later * * Full notice in ../help/Idmr.Platform.chm - * Version: 4.0 + * Version: 4.0+ */ /* CHANGELOG + * [UPD #12] Trigger 0x18 now "have cannon subsystem disabled" + * [UPD #12] TriggerType Misc now "Adjusted AI Skill" + * [DEL #12] Misc array + * [NEW #12] TriggerType Status and "All Craft" + * [UPD #12] "No Lasers" to "No Turrets", everything after "Hyperdrive added" deleted + * [DEL #12] All orders past Board to Repair * v4.0, 200809 * [UPD] IFF numbers removed * [NEW] Ability to reset _craftType and _craftAbbrv to defaults [JB] @@ -242,33 +248,22 @@ public abstract class Strings : BaseStrings static readonly string[] _status = { "Normal", "2x Warheads", "1/2 Warheads", - "No Shields", //[JB] Wasn't Disabled + "No Shields", "1/2 Shields", - "No Lasers", + "No Turrets", "No Hyperdrive", "Shields 0%, charging", "Shields added", - "Hyperdrive added", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "Invincible" + "Hyperdrive added" }; static readonly string[] _trigger = { "always (TRUE)", - "have arrived", //[JB] was "be created" + "have arrived", "be destroyed", "be attacked", "be captured", "be inspected", - "finish being boarded", //[JB] was "be boarded", updated to be more intuitive - "finish docking", //[JB] was "be docked" + "finish being boarded", + "finish docking", "be disabled", "have survived (exist)", "none (FALSE)", @@ -285,7 +280,7 @@ public abstract class Strings : BaseStrings "have 0% shields", "have 50% hull", "run out of missiles", - "Unknown (arrive?)" + "have cannon subsystem disabled" }; static readonly string[] _triggerType = { "none", "Flight Group", @@ -296,7 +291,9 @@ public abstract class Strings : BaseStrings "Ship orders", "Craft when", "Global Group", - "Misc", + "Adjusted AI Skill", + "Status", + "All Craft" }; static readonly string[] _amount = { "100%", "75%", @@ -353,84 +350,20 @@ public abstract class Strings : BaseStrings "SS Go Home", "SS Wait", "SS Board", - "Board to Repair", - "Hold Station", - "Hold Steady", - "Go Home", - "Evade Waypoint 1", - "Evade Waypoint 1", - "Rendezvous II", - "SS Disabled" + "Board to Repair" }; - static readonly string[] _craftWhen = { "", - "Boarding", - "Boarded", - "Defending", - "Disabled", - "Attacked", //[JB] Added this, and the next. Taken from XvT list but confirmed in TIE. + static readonly string[] _craftWhen = { "Captured", + "Inspected", + "Finished being boarded", + "Finished docking", + "Disabled", + "Attacked", "Any hull damage", "Special craft", "Non-special craft", "Player's craft", - "Non-player craft", - "" + "Non-player craft" }; - static readonly string[] _misc = { "Novice craft", - "Officer craft", - "Veteran craft", - "Ace craft", - "Top Ace craft", - "Jedi craft", - "Stationary craft", - "Craft returning to base", - "Non-evading craft", - "Craft in formation", - "Rendezvousing craft", - "Disabled craft", - "Craft awaiting orders", - "Attacking craft", - "Craft attacking escorts", - "Protecting craft", - "Escorting craft", - "Disabling craft", - "Delivering craft", - "Seizing craft", - "Exchanging craft", - "Capturing craft", - "Craft destroying cargo", - "Bagging craft", - "Drop Off craft", - "Waiting fighters", - "Waiting starships", - "Patrolling SS", - "SS waiting for returns", - "SS waiting to launch", - "SS waiting for boarding craft", - "SS waiting for boarding craft", - "SS attacking", - "SS disabling", - "SS disabling?", - "SS flying home", - "Rebels", - "Imperials", - "", - "Spacecraft", - "Weapons", - "Satellites/Mines", - "", - "", - "", - "", - "Fighters", - "Transports", - "Freighters", - "Utility craft", - "Starships", - "Platforms", - "", - "", - "Mines" - }; static readonly string[] _abort = { "never", "0% shields", "75% systems (not SS)", @@ -455,7 +388,7 @@ public abstract class Strings : BaseStrings "Boards targets (if stationary) to exchange cargo|Docking time (x5 sec)|# of dockings", "Boards targets (if stationary) to capture|Docking time (x5 sec)|# of dockings", "Boards targets (if stationary) to plant explosives. Target will explode when complete|Docking time (x5 sec)|# of dockings", - "Dock or pickup target, carry for remainder of mission or until dropped|Docking time (x5 sec)|# of dockings", //[JB] Changed Var2, was Meaningless. + "Dock or pickup target, carry for remainder of mission or until dropped|Docking time (x5 sec)|# of dockings", "Drops off designated Flight Group (disregards targets)|Deploy time? (x5 sec)|Flight Group #", "Waits for designated time before continuing. Returns fire|Wait time (x5 sec)|Meaningless", "Waits for designated time before continuing. Returns fire|Wait time (x5 sec)|Meaningless", @@ -470,14 +403,7 @@ public abstract class Strings : BaseStrings "Fly to Mothership, or Hyperspace. Attacks targets, returns fire|Meaningless|Meaningless", "Waits for designated time before continuing. Does not return fire|Wait time (x5 sec)|Meaningless", "Boards targets (if stationary)|Docking time (x5 sec)|# of dockings", - "Boards targets (if stationary) to repair systems|Docking time (x5 sec)|# of dockings", - "Stationary, 100% Systems, returns fire|Meaningless|Meaningless", - "Stationary, 100% Systems, returns fire|Meaningless|Meaningless", - "Enters Hyperspace|Meaningless|Meaningless", - "Circles Waypoint 1|Meaningless|Meaningless", - "Circles Waypoint 1|Meaningless|Meaningless", - "Flies to Waypoint 1 and rendezvouses with other craft|Meaningless|Meaningless", - "Disabled|Meaningless|Meaningless" + "Boards targets (if stationary) to repair systems|Docking time (x5 sec)|# of dockings" }; static readonly string[] _formation = { "Vic", "Finger Four", @@ -531,13 +457,13 @@ public static void OverrideShipList(string[] craftTypes, string[] craftAbbrv) /// Array is Length = 6 public static string[] Rating { get { return (string[])_rating.Clone(); } } /// Gets a copy of the Flight Group initial state parameters - /// Array is Length = 21 + /// Array is Length = 11 public static string[] Status { get { return (string[])_status.Clone(); } } /// Gets a copy of the Conditions required to complete trigger /// Array is Length = 25 public static string[] Trigger { get { return (string[])_trigger.Clone(); } } /// Gets a copy of the Categories that the Trigger Parameter belongs to - /// Array is Length = 10 + /// Array is Length = 12 public static string[] VariableType { get { return (string[])_triggerType.Clone(); } } /// Gets a copy of the quantities of applicable conditions that must be met /// Array is Length = 16 @@ -546,19 +472,16 @@ public static void OverrideShipList(string[] craftTypes, string[] craftAbbrv) /// Array is Length = 5 public static string[] GoalAmount { get { return (string[])_goalAmount.Clone(); } } /// Gets a copy of the FlightGroup orders - /// Array is Length = 40 + /// Array is Length = 33 public static string[] Orders { get { return (string[])_orders.Clone(); } } /// Gets a copy of the craft behaviour to be used in triggers /// Array is Length = 12 public static string[] CraftWhen { get { return (string[])_craftWhen.Clone(); } } - /// Gets a copy of miscellaneous triggers - /// Array is Length = 55 - public static string[] Misc { get { return (string[])_misc.Clone(); } } /// Gets a copy of the individual craft abort conditions /// Array is Length = 6 public static string[] Abort { get { return (string[])_abort.Clone(); } } /// Gets a copy of the descriptions of orders and variables - /// Array is Length = 40 + /// Array is Length = 33 public static string[] OrderDesc { get { return (string[])_orderDesc.Clone(); } } /// Gets a copy of the FlightGroup formations /// Array is Length = 13, replaces BaseStrings.Formation