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

Expansion Wormhole Restoration

Content

Warnings

  1. Description mismatch between OXP Manifest and Expansion Manager string length at character position 0
  2. Information URL mismatch between OXP Manifest and Expansion Manager string length at character position 0

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description
Identifier oolite.oxp.Commander_McLane.Wormhole_Restoration oolite.oxp.Commander_McLane.Wormhole_Restoration
Title Wormhole Restoration Wormhole Restoration
Category Mechanics Mechanics
Author Commander McLane Commander McLane
Version 1.2 1.2
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL n/a
Download URL https://wiki.alioth.net/img_auth.php/5/5d/Wormhole_Restoration.oxz n/a
License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
File Size n/a
Upload date 1610873308

Documentation

Also read http://wiki.alioth.net/index.php/Wormhole%20Restoration

readMe.txt

Wormhole Restoration v 1.2
by "Commander McLane"

an Expansion Pack for Oolite by Giles Williams
based on "Elite" by Ian Bell and David Braben

Introduction
------------
How do the Thargoids make your wormhole through witchspace collapse and spit you out in the middle of nowhere? It turns out that they have a device for that, and if you get stuck in interstellar space, you find yourself within a grid of four Thargoid Witchspace Jammers. These jammers keep you where you are, and also prevent you from escaping with another witchspace jump, even if you have the necessary fuel.

Destroy them and your original wormhole will re-open, allowing you to continue your journey to your original destination.

Overview
--------
Usually, after a misjump you find yourself ambushed by some viciously attacking Thargoid Warships. Sometimes you even manage to fight and kill them. You're still full of excitement and adrenalin from the epic battle when you finally find out that you're dead anyway, because you don't have enough fuel left to reach any of the surrounding systems. You're doomed to die in interstellar space. This sucks.

There are already a couple of OXPs which offer you a way out of this -- literally -- dead end. Wormhole_restoration.oxp goes another path than those existing OXPs. Its basic premise is that after you fought off the ambush in interstellar space, your original wormhole opens again and you can continue your original journey to your original destination.

To this end the OXP introduces a visible device which is supposed to have collapsed your wormhole in the first place: the Thargoid Witchspace Jammer. There are always four of them surrounding the place where you emerged from your jump. It's a spiky device that gives off an evil glow, easily recognizable. Destroy all four of them, and your original wormhole opens again. Enter it just like you would enter another ship's wormhole, and you continue your journey to your original destination without using any more witchjump fuel.

The Thargoids place their Witchspace Jammers only at the midpoints between two systems. Therefore, if you make another misjump from that midpoint, you won't encounter another set of Witchspace Jammers. Giles only knows what it was that made your jump fail again. You may still encounter Thargoids, though, and now you're depending on your own fuel.

It is only necessary to destroy the four Witchspace Jammers, so you can try to avoid the surrounding Thargoid ships and only concentrate on the jammers. However, the warships will of course still attack you, so you will still be forced to fight them off. Your ship's computer will notify you whenever one of the Witchspace Jammers is destroyed, telling you how many are still intact. It will also detect the re-formation of your original wormhole after the last Witchspace Jammer is destroyed. All you have to do then is to locate your wormhole, return to it, and enter it. If there were other ships stuck together with you, their wormholes will re-open as well, leading to their original destinations, so in this case it may be worthwhile to examine all wormholes first. You don't want to jump in the wrong direction, do you? Don't spend too much time with a thorough examination, though. The re-opened wormholes only stay open for between one and two minutes. Therefore your maxim should be: if in doubt, just head for the closest wormhole as quickly as possible.

There is a catch, though: If you (or other ships) haven't killed all Thargoids before destroying the Witchspace Jammers, the remaining Thargoid ships may follow you or any other ship through the re-opened wormhole. Therefore your successful escape may mean death and destruction for many vessels in your destination system. You may unwillingly head the Thargoid forces to an invasion of the very system where you seek refuge from them. Therefore -- if at all possible -- you should make sure that no Thargoid Warships are left in interstellar space when you re-enter your wormhole.

Technical details
-----------------
Wormhole_restoration.oxp contains the model of the Thargoid Witchspace Jammer. This model was recycled from Cataclysm.oxp. Four Thargoid Witchspace Jammers are spawned in a grid around the player's position whenever misjumping. These Witchspace Jammers have enough mass to prevent any witchspace jump inside their scanner range, therefore leaving is not possible, even with enough fuel. Killing them sends a message to the player's console. Killing the last one creates an invisible dummy entity that immediately attempts to jump out to the player's original destination. The attempts are repeated until one is successful. The wormhole stays open for about 90 seconds. Another dummy entity is created for each ship with a yellow blip. These jump out randomly to either the player's destination or the system he came from. Immediately after reaching the other side the dummy entity is removed.

The OXP also replaces the normal thargoidAI with a slightly modified version. This new thargoidAI gives Thargoid ships a one-in-four chance to follow the player through his wormhole whenever he jumps out. This is inspired by the current pirateAI, which also introduces the chance of pirates following the player, should he jump out in the middle of a fight.

Minimum Requirements
--------------------
Wormhole_restoration.oxp v 1.1 requires at least Oolite 1.75.2.

Download Location
-----------------
This OXP is available for download via the http://wiki.alioth.net/index.php/Wormhole_restoration_OXP

Installation
------------
Move or copy the file wormhole_restoration.oxp from this folder into your AddOns folder. Where that resides depends on your installation. Restart Oolite.

License
-------
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 3.0. For more information see the ReadMe of Oolite or http://creativecommons.org/licenses/by-nc-sa/3.0/

Practically this means that you may rip it apart and use whatever seems useful to you, as long as you credit the original author. It would be nice -- although by no means necessary -- to give me a note, if you intend to use parts of it.

History
-------
version 1.2 (April 10th, 2018)
- Converted XML plists to Openstep format.
- Converted RTF readme file to plain text.
- Added manifest file for OXZ publication.

version 1.1 (May 12th, 2011)
- Witchspace Jammers are now only encountered in the midpoint between systems. If you do another misjump in any direction from there, you don't get more Jammers. The Thargoids can't be sitting everywhere, after all.
- the restored wormhole now always leads to the system you were headed for
- if you were following another ship's wormhole in the first place, there is only one wormhole restored for the two of you
- deleted unnecessary logging
- requires Oolite 1.75.2

version 1.0 (April 25th, 2011)
- basically functional version 
- requires at least Oolite 1.75.1

Equipment

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

Ships

Name
Thargoid Witchspace Jammer
Wormhole

Models

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

Scripts

Path
Config/script.js
/*

wormhole-restoration.js

Script for spawning Thargoid Witchspace Jammers in interstellar space.


Oolite
Copyright © 2003-2011 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.


wormhole_restoration.oxp
Copyright © 2011 "Commander McLane"

This work is licensed under the Creative Commons
Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.

*/

"use strict";
this.name           = "wormhole-restoration";
this.description    = "Script for spawning Thargoid Witchspace Jammers";
this.author         = "Commander McLane";
this.copyright      = "© 2011 Commander McLane";
this.license		= "CC-by-nc-sa 3.0";
this.version        = "1.1";


/* event handlers */

this.shipWillEnterWitchspace = function(cause)
{
    // the player's origin system is stored
    if(!system.isInterstellarSpace)
    {
        this.originSystem = system.ID;
        this.misjumpCounter = 0;
    }
    // consecutive misjumps are counted
    this.misjumpCounter ++;
    // if the player followed an NPC's wormhole, this fact is stored
    if(cause === "wormhole") this.followedNPC = true;
}

this.shipWillExitWitchspace = function()
{
    // only works in interstellar space and only for the first misjump
    // (the Thargoids have their technology only installed in the middle between systems)
    if(!system.isInterstellarSpace || this.misjumpCounter !== 1) return;
    // the target system of the jump is established
    this.originCoordinates = System.infoForSystem(galaxyNumber, this.originSystem).coordinates;
    this.currentCoordinates = system.info.coordinates;
    this.misjumpVector = this.currentCoordinates.subtract(this.originCoordinates);
    this.jumpVector = this.misjumpVector.multiply(2);
    this.targetCoordinates = this.originCoordinates.add(this.jumpVector);
    this.targetSystem = SystemInfo.filteredSystems(this, function(other){return (other.coordinates.squaredDistanceTo(this.targetCoordinates) < 0.0000001)})[0].systemID;
    // four Witchspace Jammers are spawned around the origin
    system.addShips("wormhole_restoration_witchspace_jammer", 1, [14618.6, 8686.1, 10541.7], 0);
    system.addShips("wormhole_restoration_witchspace_jammer", 1, [-7449.9, -15359.9, 10399.8], 0);
    system.addShips("wormhole_restoration_witchspace_jammer", 1, [-14478.2, 13337.6, -3572.2], 0);
    system.addShips("wormhole_restoration_witchspace_jammer", 1, [7359.4, -6668.0, -17369.2], 0);
}
Scripts/wormhole-restoration-witchspace-jammer.js
/*

wormhole-restoration-witchspace-jammer.js

Script for the Thargoid Witchspace Jammer.


Oolite
Copyright © 2003-2011 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.


wormhole_restoration.oxp
Copyright © 2011 "Commander McLane"

This work is licensed under the Creative Commons
Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.

*/

"use strict";

this.name           = "wormhole-restoration-witchspace-jammer";
this.description    = "Script for the Thargoid Witchspace Jammer";
this.author         = "Commander McLane";
this.copyright      = "© 2011 Commander McLane";
this.license		= "CC-by-nc-sa 3.0";
this.version        = "1.1";


/* functions */

function $isStrandedShip(entity)
{
    return entity.scanClass === "CLASS_NEUTRAL" && !entity.owner && entity.primaryRole !== "generationship"
}


/* event handlers */

this.shipDied = function(whom, why)
{
    if(system.countShipsWithRole("wormhole_restoration_witchspace_jammer") > 1)
    {
        player.commsMessage("1 Thargoid Witchspace Jammer destroyed. " + (system.countShipsWithRole("wormhole_restoration_witchspace_jammer") - 1) + " still active.");
    }
    else
    {
        // a wormhole-creating object is spawned around the origin
        var wormholeCreator = system.addShips("wormhole_restoration_wormhole_creator", 1, [0, 0, 0], 5000)[0];
        wormholeCreator.script.targetSystem = worldScripts["wormhole-restoration"].targetSystem;
        // more wormhole-creating objects are spawned of there are more stranded ships
        var strandedShips = system.filteredEntities(this, $isStrandedShip).length;
        // if the player was using one of their wormholes in the first place, one wormhole less is created
        if(worldScripts["wormhole-restoration"].followedNPC)
        {
            if(strandedShips !== 0)
            {
                strandedShips --;
            }
            delete worldScripts["wormhole-restoration"].followedNPC;
        }
        for(var i=0; i<strandedShips; i++)
        {
            wormholeCreator = system.addShips("wormhole_restoration_wormhole_creator", 1, [0, 0, 0], 5000)[0];
            if(Math.random() < 0.5)
            {
                wormholeCreator.script.targetSystem = worldScripts["wormhole-restoration"].targetSystem;
            }
            else
            {
                wormholeCreator.script.targetSystem = worldScripts["wormhole-restoration"].originSystem;
            }
        }        
        // the player is notified
        player.commsMessage("The last Thargoid Witchspace Jammer was destroyed. All wormholes are restored.");
    }
}

this.shipTakingDamage = function(amount, whom, type)
{
    if(type === "cascade weapon" || amount === 1000)
    {
        this.ship.energy += amount;
    }
}
Scripts/wormhole-restoration-wormhole-creator.js
/*

wormhole-restoration-wormhole-creator.js

Script for creating a wormhole and removing the wormhole creator object.


Oolite
Copyright © 2003-2011 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.


wormhole_restoration.oxp
Copyright © 2011 "Commander McLane"

This work is licensed under the Creative Commons
Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.

*/

"use strict";

this.name           = "wormhole-restoration-wormhole-creator";
this.description    = "Script for creating a wormhole and removing the wormhole creator object";
this.author         = "Commander McLane";
this.copyright      = "© 2011 Commander McLane";
this.license		= "CC-by-nc-sa 3.0";
this.version        = "1.1";


/* functions */

this.$attemptJump = function()
{
    // attempts to jump out to the player's original target system 
    if(this.ship.exitSystem(this.targetSystem) === true)
    {
        this.jumpAttemptTimer.stop();
        delete this.jumpAttemptTimer;
    }
}


/* event handlers */

this.shipSpawned = function()
{
    this.jumpAttemptTimer = new Timer(this, this.$attemptJump, 0.1, 0.5)
}

this.shipExitedWormhole = function()
{
    // the object is removed after the jump
    this.ship.remove();
}