Thargoid Wars v.4.3

Written by Commander Wombat.

March, 2006 (Code patch added July 2007 & January 2008 & December 2008).

Description:

This expansion pack adds four types of encounters with Thargoids. The first is a Thargoid attack
on space stations. You choose whether or not to participate in the defense of the station.

The second involves encountering Thargoids when exiting witchspace. The third is a fairly deadly
encounter that you may want to have an energy bomb for. These three encounters occur randomly
with a fairly low probability. The fourth encounter involves increased efforts on the part of
the Thargoids to collect intelligence. The overall premise is that the ongoing war with the
Thargoids has intensified with the Thargoids launching attacks more frequently.

The expansion pack also adds a system of rewards from the Intergalactic Navy (pursuant to Naval
regulation 18756.23.70A) for your participation in the war with the Thargoids. The reward system
is based on the number of encounters you have with the Thargoids. Currently only the encounters
that arise from this expansion pack are included. Rewards include credits and a series of medals.

Note: I am not an artist. You will agree with that statement if / when you see the first medal.

Note that this expansion pack does not add Thargoid encounters in Galaxy 1. I did this because
you can meet up to three Thargoid battleships in a single encounter. This might be a bit much
for a novice Ooliteer.

Requirements:

Version 1.52 (or higher) of Oolite is required. This expansion pack won't work with earlier
versions since it takes advantage of some of the scripting features introduced in 1.52.

To Install:

Move the thargoid_wars.oxp file into the AddOns folder in your Oolite folder. The Oolite folder
is where the Oolite program resides. The thargoid_wars.oxp file is in the ThargoidWars folder
along with this README.txt file. DO NOT move the entire ThargoidWars folder into the AddOns
folder - you only need the thargoid_wars.oxp file. If you have the previous version of
thargoid_wars.oxp, either delete it before installing this one, or let this one overwrite the old
version.

For more information on oxp's, visit http://wiki.alioth.net/index.php/Oolite_Main_Page.

Changes/Additions:

IMPORTANT UPDATE!!
v.4.3 - (December, 2008) Added a check for a previous mission choice being active. If it is, it will not display the station attack message until the other oxp has cleared it. All oxp's should clear this after reading it out. (But not all do).

v.4.2 - (January, 2008) Speed update. The original flat structure of the mission script is partitioned into logical parts for speed optimisation during "In flight" conditions. In the old situation on update-time with "in flight" situations, a minimum of 110 were conditions checked when there was nothing to be done. This improved version can already after 5 checked conditions conclude that there is nothing to be done with "in flight" situations. That is just 5.5% of the original evaluation time. No functional changes.

Removed one bug where a commander who launches during a station-attack offer, without answering the offer, would never get the offer again. Also added code that restarts this mission with old save-files that contain this bugged data.

Removed a bug in the forced launch after a station-attack were the program tried to reset the legal status to that before the jump. (In case the player had illegal cargo on board he should not get punished) Because of the wrong use of "expandable text" it was not saving the content of the variable but the name of the variable.
(Changes by Commander Eric Walch)

v.4.1 - (July, 2007) Code patch added to s top the Mission Clash Bug. A long standing problem with Oolite
Missions was that if two missions tried to give the player a briefing at the same time,
the player would miss one of them. For example you might be playing the Ionics Missions in
Galaxy 2 and Ionics tried to give you a briefing offering you a mission, but Thargoid Wars at
the same time decided to scramble you to defend the station against attacking Bugs. As a result
you never saw the Ionics briefing, and so although you now have a mission to do for the Ionics
Corperation, you are blissfully unaware of this fact as you never saw the message offering you
the mission!

This version of Thargoid Wars just adds a cunning code patch (devised by Commander Eric Walch).
If another OXP is giving the player a briefing, this version of Thargoid Wars will wait until
the player has seen the other briefing before displaying a Thargoid Wars briefing.

Other OXPers should take note, the fix is just to add "gui_screen_string oneof GUI_SCREEN_STATUS,
GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHORT_RANGE_CHART" as a condition to displaying
a mission briefing. That way your OXP won't put up a briefing if another OXP has
already "bagged" the mission screen and will wait until the player has seen the other briefing
before showing its briefing. Do use it, as then your OXP won't clash with anyone elses! 

It is important that you use this version of Thargoid Wars. As this OXP adds features to Galaxies
2 to 8, there are loads of other Missions that the old version could clash with (Assassins,
LoveCats, Ionics, Military, Nova and Thargoid Plans) to name but a few! 

v.4.0 - (March, 2006) Fixed bug where the station attacks occurred too often (thanks ArkanoiD and Rxke).
Also fixed minor bugs with other parts of the script. Added new encounter with the Thargoids.
This could be described as a "furball".

v.3.0.1 - Fixed bug where a ship from the shipyard could end up displayed behind the mission
screen during a station attack. Thanks to Rxke and EAGLE 5 for identifying it, and to aegidian
for suggesting the fix.

v.3.0 - Fixed bug that led to potential changes in legal status during station attack.
Also fixed the bug (some would say feature) that awarded new commanders 1000cr. I have also
altered the placement of Thargoids during the station attack so that they will be in scanner
range more often (but certainly not always).

v.2.2 - The siren is back (as an Ogg Vorbis file) and works. In addition, I have added a delay
to the station attack alert. This is somewhat variable, although not totally random, and allows
the player a little time to trade, buy fuel etc. I have also added delays to the other encounters
to add to the "realism" factor.

v.2.1 - The original oxp included a mp3 file that has resulted in a bug now that Oolite has been
changed to use the Ogg Vorbis format. However, there are currently issues with the Oolite sound
code that result in an updated Ogg Vorbis version of the sound file not playing. For now I have
removed the sound file from the oxp until the sound issues can be resolved. Many thanks to
Ahruman for help with this issue and for supplying the updated sound file.

v.2.0 - This version adds two new types of encounter and decreases (a little) the number of
encounters required to gain medals (pursuant to Naval regulation 18756.23.70A addendum 17F).

Disclaimer:

Feel free to copy, share, alter, mutilate or do whatever you like with these scripts.
If there are elements you want to use in your own expansion packs, go right ahead. However,
selling or otherwise profiting from them is simply not on. Don't do it.

If you find any bugs, and there are sure to be some, please send me all the gory details in a
Private Message  to Cmdr. Wombat on the Oolite bulletin board. Alternatively, simply make a post
there detailing the problem. Note that I am in no way responsible for any clashes with existing
or future Oolite expansion packs, although this was play tested without issue on a Mac with most
of the expansion packs from Oosat (up to March 2006) installed and with Oolite version 1.63.

Updated Version playtested by LittleBear on PC 1.69.1 with all other OXPs installed (July 2007).
Should work fine!
