Skip to content

Commit

Permalink
Updates per #12
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeG621 committed Sep 24, 2022
1 parent 03790a9 commit 6ac5174
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 214 deletions.
88 changes: 13 additions & 75 deletions Mission_TIE95.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TIE Mission File
Author: Michael Gaisser ([email protected])
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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
18 changes: 3 additions & 15 deletions Tie/FlightGroup.FGGoals.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*
* Idmr.Platform.dll, X-wing series mission library file, TIE95-XWA
* Copyright (C) 2009-2014 Michael Gaisser ([email protected])
* Copyright (C) 2009-2022 Michael Gaisser ([email protected])
* 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
Expand Down Expand Up @@ -81,19 +82,6 @@ public byte SecondaryAmount
get { return _items[3]; }
set { _items[3] = value; }
}
/// <summary>Gets or sets the hidden goal</summary>
/// <remarks>Use of this goal is unknown, entirely hidden</remarks>
public byte SecretCondition
{
get { return _items[4]; }
set { _items[4] = value; }
}
/// <summary>Gets or sets the amount of the FlightGroup required to meet <see cref="SecretCondition"/></summary>
public byte SecretAmount
{
get { return _items[5]; }
set { _items[5] = value; }
}
/// <summary>Gets or sets the Bonus goal</summary>
public byte BonusCondition
{
Expand Down
6 changes: 3 additions & 3 deletions Tie/FlightGroup.Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -202,6 +203,5 @@ public byte Unknown18
set { _items[4] = value; }
}
}

}
}
13 changes: 10 additions & 3 deletions Tie/Mission.Trigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
14 changes: 5 additions & 9 deletions Tie/Mission.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/*
* Idmr.Platform.dll, X-wing series mission library file, XW95-XWA
* Copyright (C) 2009-2020 Michael Gaisser ([email protected])
* Copyright (C) 2009-2022 Michael Gaisser ([email protected])
* 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]
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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++)
{
Expand Down Expand Up @@ -777,9 +776,6 @@ public bool SwapFG(int srcIndex, int dstIndex)
/// <summary>Gets or sets the officers present before and after the mission</summary>
/// <remarks>Defaults to <b>FlightOfficer</b></remarks>
public BriefingOfficers OfficersPresent { get; set; }
/// <summary>Gets or sets if the pilot is captured upon ejection or destruction</summary>
/// <remarks><b>true</b> results in capture, <b>false</b> results in rescue (default)</remarks>
public bool CapturedOnEjection { get; set; }

/// <summary>Gets or sets the FlightGroups for the mission</summary>
/// <remarks>Defaults to one FlightGroup</remarks>
Expand Down
Loading

0 comments on commit 6ac5174

Please sign in to comment.