Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion Thargoid Wars

Content

Warnings

  1. License not specified
  2. XML Manifest found
  3. Unknown key 'licence' in XML manifest.plist

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds several thargoid related missions in galaxy 2 and higher Adds several thargoid related missions in galaxy 2 and higher
Identifier oolite.oxp.CmdrWombat.ThargoidWars oolite.oxp.CmdrWombat.ThargoidWars
Title Thargoid Wars Thargoid Wars
Category Missions Missions
Author Cmdr. Wombat Cmdr. Wombat
Version 4.6 4.6
Tags Thargoid Thargoid
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Thargoid_Wars n/a
Download URL https://wiki.alioth.net/img_auth.php/d/d6/ThargoidWars_4.6.oxz n/a
License
File Size n/a
Upload date 1610873479

Documentation

Also read http://wiki.alioth.net/index.php/Thargoid%20Wars

README.txt

Thargoid Wars v.4.6

Written by Commander Wombat.

March, 2006 (Code patch added July 2007 & January 2008 & December 2008 & November 2009 & March 2010).
Updates after version 4.0 by Eric Walch

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 a military energy unit 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.75 (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.75.

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.
Or visit the discussion forum at: http://www.aegidian.org/bb/viewtopic.php?t=4129

Additional hint: When you want stronger thargoids to combat against, just install one or more
thargoid adding oxps like Thargorn_Threat.oxp.

Changes/Additions:

v.4.6 - (May 2014) Raised minimum Oolite to 1.75. The decoys are now random thargoid ships.

v.4.5.4 - (November 2011) Fixed a bug of not getting station attacks anymore. (Bug probably introduced in 4.5.1).

v.4.5.3 - (July 2011) Changed one code line after a rapport of a crash on the start of the station attack.
Not sure if this oxp was the cause, but better safe than sorry.

v.4.5.2 - (July 2011) Fixed a problem of continuous station attack messages.

v.4.5.1 - (January 2011) Changed a casing bug in JS that was ignored in older Oolites but would give
errors after Oolite 1.74.2

v.4.5 - (March, 2010) Raised minimum version to 1.74. Started using the new mission-page code.
Changed the way points are collected. Just being in the system together with thargoids is no
longer enough. Points are now only collected for killing them.

v.4.4 - (November, 2009) Code translated to Java Script. Will now run on Oolite 1.57 until 1.65 with
the old scripting and on Oolite 1.73 or newer with the new scripting. It won't do anything when used 
with intermediate Oolite versions.

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!

Equipment

This expansion declares no equipment. This may be related to warnings.

Ships

Name
Thargoid Satellite Radar Dish
Thargoid Spy Satellite

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Scripts/thargoidWars.js
"use strict";
this.name        = "thargoid_wars"; 
this.author      = "eric walch"; 
this.copyright   = "� 2008 Murgh."; 
this.description = "script that brings the war to normal space"; 
this.version     = "4.6"; 

// N.B. Works only with 1.75+.
this.startUp = function (){
    if (!missionVariables.thargoidwars_station_attack){
        if (!missionVariables.station_attack){ // backward compatibility with old name.
            this.initialise();
        } else {
            missionVariables.thargoidwars_station_attack = missionVariables.station_attack;
        }
    }
    this.medals = ["NONE", "BRONZE", "SILVER", "GOLD", "CRYSTAL"];
    this.medalNumber = this.medals.indexOf(missionVariables.thargoidwars_medal); // turn into number.
};

this.initialise = function (){
        missionVariables.thargoidwars_station_attack = "INITIALISE" ;
        missionVariables.thargoidwars_number = 0; 
        missionVariables.thargoidwars_medal_number = 0;
        missionVariables.thargoidwars_medal = "NONE";

        // Initialise unused variables for backward compatibility in case someone plays with both versions.
        missionVariables.thargoid_ambush = "IMPOSSIBLE";  // unused in JS
        missionVariables.thargoidwars_timer = 0; // unused in JS
        missionVariables.thargoidwars_timer_start = "NO";  // unused in JS
        missionVariables.thargoidwars_ambush_timer = -1; // unused in JS
        missionVariables.thargoidwars_ambush_timer_start = "NO"; // unused in JS
        missionVariables.thargoidwars_satellite_timer = -1;  // unused in JS
        missionVariables.thargoidwars_satellite_timer_start = "NO";  // unused in JS
};

this.shipDockedWithStation = function (station){
        this.justDocked = true;
};

this.missionScreenOpportunity = function (){
    if (player.ship.docked) this.missionOffers();
};

this.missionOffers = function (){
    if (player.ship.dockedStation.isMainStation){
        var stationAttack = missionVariables.thargoidwars_station_attack;
        var thargoidwarsNumber = missionVariables.thargoidwars_number;
        if (stationAttack === "INITIALISE" && (missionVariables.thargplans === "MISSION_COMPLETE" || galaxyNumber > 0) &&
                system.ID !== 36 && Math.random() < 0.2){
            mission.runScreen({
                title: "Thargoid Wars",
                messageKey: "thargoidwars_station_attack_inews",
                background: "thargoid_wars_iNews.png"
            });
            missionVariables.thargoidwars_station_attack = "IMPOSSIBLE" ;
        }

        if (stationAttack === "ATTACKED"){
            // the check: stationAttack === "ATTACKED" is only added to fix old saved games containing this value.
            this.anounceStationAttack();
        }
        
        if (stationAttack === "IN_PROGRESS"){
            if (!this.attackedSystem || this.attackedSystem !== system.ID){ // could happens when starting from a saved game.
                missionVariables.thargoidwars_station_attack = "IMPOSSIBLE";
                return;
            }
            var thargoidCount;
            if (0 < oolite.compareVersion("1.75")){
                thargoidCount = system.entitiesWithScanClass("CLASS_THARGOID", player.ship.dockedStation, 20E3).length;
            } else {
                thargoidCount = system.countEntitiesWithScanClass("CLASS_THARGOID", player.ship.dockedStation, 20E3); // faster code
            }
            if (thargoidCount === 0){
                missionVariables.thargoidwars_station_attack = "IMPOSSIBLE";
                if (Math.random() < 0.3) stationAttack = "POSSIBLE"; // Random chance of 2nd wave.
                missionVariables.thargoidwars_number += this.difficulty; // bonus for getting them all.
                delete this.attackedSystem;
            } else if (this.justDocked){
                mission.runScreen({
                    title: "Thargoid Wars",
                    messageKey: "thargoidwars_station_attack_unfinished",
                    music: "siren.ogg"
                });
                if (this.difficulty > 1) this.difficulty--;
                this.justDocked = false;
            }
        }
        
        if (stationAttack === "POSSIBLE" && !this.stationWillBeAttacked){
            this.stationWillBeAttacked = true;
            this.attackTimer = new Timer(this, this.stationAttack, 15 + 45 * Math.random(), 20);
        }
        
        if (thargoidwarsNumber > 5 && !missionVariables.thargoid_satellite){
            mission.runScreen({
                title: "Thargoid Wars",
                messageKey: "thargoidwars_spy_satellite",
                background: "thargoid_wars_satellite.png"
            });
            missionVariables.thargoid_satellite = "INFORMED";
            return;
        }
        
        if (thargoidwarsNumber > 9){
            player.credits += 1000;
            missionVariables.thargoidwars_number = 0;
            if (++missionVariables.thargoidwars_medal_number < 5){
                mission.runScreen({title: "Thargoid Wars", messageKey: "thargoidwars_reward"});
            } else {
                missionVariables.thargoidwars_medal_number = 0;
                this.medalNumber++;
                switch(missionVariables.thargoidwars_medal) {
                    case "NONE":    mission.runScreen({
                                        title: "Thargoid Wars",
                                        messageKey: "thargoidwars_bronze",
                                        background: "thargoid_wars_bronze.png"
                                    }); 
                                    missionVariables.thargoidwars_medal = "BRONZE";
                                    break;
                    case "BRONZE":  mission.runScreen({
                                        title: "Thargoid Wars",
                                        messageKey: "thargoidwars_silver",
                                        background: "thargoid_wars_silver.png"
                                    }); 
                                    missionVariables.thargoidwars_medal = "SILVER";
                                    break;
                    case "SILVER":  mission.runScreen({
                                        title: "Thargoid Wars",
                                        messageKey: "thargoidwars_gold",
                                        background: "thargoid_wars_gold.png"
                                    }); 
                                    missionVariables.thargoidwars_medal = "GOLD";
                                    break;
                    case "GOLD":    mission.runScreen({
                                        title: "Thargoid Wars",
                                        messageKey: "thargoidwars_crystal",
                                        background: "thargoid_wars_crystal.png"
                                    }); 
                                    missionVariables.thargoidwars_medal = "CRYSTAL";
                                    break;
                    case "CRYSTAL":
                    default:        mission.runScreen({
                                        title: "Thargoid Wars",
                                        messageKey: "thargoidwars_reward"
                                    });
                                    break;
                }
            }
        }
    }
};

this.stationAttack = function (){  // Delayed missionoffer, called by a timer
    if (guiScreen === "GUI_SCREEN_MISSION" || guiScreen === "GUI_SCREEN_REPORT" || guiScreen === "GUI_SCREEN_SAVE") return;
    this.attackTimer.stop();
    delete this.attackTimer;
    if (player.ship.docked) this.anounceStationAttack(); // docked and on a safe screen for display.
    this.stationWillBeAttacked = false;
}

this.anounceStationAttack = function (){
    this.difficulty = Math.ceil(Math.random() * 3);
    mission.runScreen({
        title: "Thargoid Wars",
        messageKey: "thargoidwars_station_attack",
        choicesKey: "thargoidwars_station_attack_yesno",
        music: "siren.ogg"
    },
    function (choice){
        if (choice === "NO_THARGOID") {
            missionVariables.thargoidwars_station_attack = "IMPOSSIBLE";
            mission.runScreen({
                title: "Thargoid Wars",
                messageKey: "thargoidwars_station_attack_coward"
            });
            missionVariables.thargoidwars_number--;
        } else {
            // choice === "YES_THARGOID" or player launched without making choice. 
            missionVariables.thargoidwars_station_attack = "IN_PROGRESS";
            this.addStationAttackThargoids(this.difficulty);
            var saved_legalstatus = player.bounty;
            player.ship.launch();
            player.bounty = saved_legalstatus; // don't penalyse a ship with illigal goods when helping the station.
        }
    });
}

this.shipExitedWitchspace = function (){
    if (system.isInterstellarSpace || missionVariables.thargoidwars_station_attack === "INITIALISE" || system.sun.hasGoneNova) return;
    
    if (Math.random() < 0.06 && missionVariables.thargoidwars_station_attack === "IMPOSSIBLE"){ // thargoid Station Attack
        missionVariables.thargoidwars_station_attack = "POSSIBLE"; 
    }
    
    if (Math.random() < 0.04 && system.countEntitiesWithScanClass("CLASS_THARGOID") === 0){
        this.setUpRewards(system.addGroupToRoute("thargoid", 3, 0.05, "wp"));
    }
    
    if (Math.random() < 0.05){ // thargoid Ambush
       var decoyOffset = 0.5 * Math.random();

        var decoy = system.addShipsToRoute("thargoid", 1, 0.88 - decoyOffset, "pw")[0];
        decoy.setScript("wombatsThargoidWarsDecoy.js");
        decoy.switchAI("dumbAI.plist");
        if (Math.random() < 5){
            this.setUpRewards(system.addGroupToRoute("thargoid", 3, 0.755 - decoyOffset, "pw"));
            system.addShipsToRoute("police", 3, 0.756 - decoyOffset, "pw");
            system.addShipsToRoute("trader", 3, 0.754 - decoyOffset, "pw");
        }
    }
    
    if (Math.random() < 0.06 && missionVariables.thargoid_satellite === "INFORMED"){  // thargoid Satellite
        system.addShips("thargoid_wars_satellite", 1, [0, 0, -20E3], 5E3);
    }
};

this.addStationAttackThargoids = function (count){
    this.attackedSystem = system.ID;
    this.setUpRewards(system.addGroup("thargoid", count, player.ship.position, 25E3));
    system.addShips("trader", 2 * count, player.ship.position, 25E3);
    if (count > 1) system.addShips("police", count-1, player.ship.position, 25E3);
};

// code below is triggered by ship scripts.
this.thargoidDecoy = function (position){
    this.decoyTimer = new Timer(this, this.$addThargoids, 15 + 30 * Math.random());
    this.decoyPosition = position;
};

this.$addThargoids = function (){
    this.setUpRewards(system.addGroup("thargoid", 3, this.decoyPosition, 2000));
};

this.thargoidSatellite = function (){
    if (Math.random() < 0.5) this.satelliteTimer = new Timer(this, this.$addThargoid, 15 + 30 * Math.random());
};

this.$addThargoid = function (){
    this.setUpRewards(system.addGroup("thargoid", 1, [0, 0, 20E3], 5E3));
};

this.setUpRewards = function (group){
    // Insert a counter in all groupmember death-actions.
    for (var i = 0; i < group.count; i++){
        var thargoid = group.ships[i];
        if (thargoid.script.shipDied) thargoid.script.thargoidWarsOriginal = thargoid.script.shipDied;
        thargoid.script.shipDied = function (who, why){ 
            if (who && who.isPlayer){
                missionVariables.thargoidwars_number++;
            }
            if (this.thargoidWarsOriginal) this.thargoidWarsOriginal(who, why);
        } 
    }
};
Scripts/wombatsThargoidWarsDecoy.js
"use strict";
this.name      = "wombatsThargoidWarsDecoy"; 
this.author    = "eric walch"; 
this.copyright = "� 2008 eric walch."; 
this.description = "Code for the decoy thargoid"; 
this.version   = "1.01";

this.shipDied = function () { 
    this.ship.commsMessage("Meet my ancestors, zebra goat!");
    worldScripts.thargoid_wars.thargoidDecoy(this.ship.position);
    
    // add some cargo to try keeping the player nearby.
    var cargo = this.ship.spawn("cargopod", 3);
    for (var i=0; i<cargo.count; i++) {
        cargo[i].setCargo("Alien Items");
    }
} 
Scripts/wombatsThargoidWarsSatellite.js
"use strict";
this.name      = "wombatsThargoidWarsSatellite"; 
this.author    = "eric walch"; 
this.copyright = "� 2008 eric walch."; 
this.description = "Code for the thargoid satelite"; 
this.version   = "1.10";

this.shipSpawned = function ()
{
    this.ship.orientation = [1,0,1,0];
    this.addThargoidTimer = new Timer(this, this.$addThargoids, 15 + Math.random()*25);
}

this.shipDied = function (who) 
{ 
    this.ship.commsMessage("Nee! Nee! Nee! ... Shh!");
    if (who && who.isPlayer) missionVariables.thargoidwars_number++;
    worldScripts.thargoid_wars.thargoidSatellite();
} 

this.entityDestroyed = function ()
{
    if (this.addThargoidTimer) {this.addThargoidTimer.stop(); delete this.addThargoidTimer};
}

this.$addThargoids = function ()
{
	// Satellite was not killed in time.
	// Inform the thargoid flees that the player is in the system.
	var count = 2 + Math.ceil(Math.random()*3);
	worldScripts.thargoid_wars.setUpRewards(system.addGroup("thargoid", count, [0, 0, 50E3], 5E3));
	count = 1 + Math.round(Math.random()*2);
	worldScripts.thargoid_wars.setUpRewards(system.addGroup("thargoid", count, this.ship.position, 15E3));
}