Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion Long Way Round

Content

Warnings

  1. 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 Long Way Round mission in Galaxy 1 Long Way Round mission in Galaxy 1
Identifier oolite.oxp.aegidian.LongWayRound oolite.oxp.aegidian.LongWayRound
Title Long Way Round Long Way Round
Category Missions Missions
Author aegidian aegidian
Version 2.1 2.1
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/2/20/LongWayRound.oxz n/a
License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
File Size n/a
Upload date 1623127797

Documentation

Also read http://wiki.alioth.net/index.php/Long%20Way%20Round

readme.txt

The LongWay OXP
by aegidian
version 2.0

To start the LongWay mission go to Biarge in galaxy 1.

INSTALLATION
------------
To install The LongWay OXP, unzip the package and drag it into your Oolite AddOns folder.

VERSION INFO
------------
2.1
- Tweak to the runScreen method to make compatible with XenonUI.

2.0
- Converted plist script file to JavaScript.
- Updated ship model to Griff-based version.
- Converted XML-based plist files to OpenStep format.

1.1
Made the code more compatible with other oxp's. 
- Internal names more unique.
- Added code to prevent mission offering clashes.

1.0
Original release

Equipment

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

Ships

Name
Qubeenian Rebel Fighter

Models

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

Scripts

Path
Config/script.js
"use strict";
this.name        = "LongWayRound";
this.author      = "aegidian, phkb";
this.copyright   = "2018 phkb";
this.description = "Script for Long Way Round mission - original script by aegidian, JS script by phkb.";
this.licence     = "CC BY-NC-SA 3.0";

this._counter = 0;
this._timer = null;

this.startUp = function() {
    if (missionVariables.longwayround === "MISSION_COMPLETE") {
        delete this.missionScreenOpportunity;
        delete this.shipExitedWitchspace;
        delete this.startUp;
    }
}

this.missionScreenOpportunity = function() {
    if (player.ship.dockedStation.isMainStation && galaxyNumber === 0) {
        if (!missionVariables.longwayround && system.ID === 3) {
            // show mission screen
            mission.runScreen(
                {
                    screenID: "longwayround",
                    title: "Incoming Message",
                    exitScreen: "GUI_SCREEN_STATUS",
                    messageKey: "long_way_round_Biarge_briefing"
                } 
            );
            missionVariables.longwayround = "STAGE1";
            mission.markSystem({system:248, name:this.name});
            mission.setInstructionsKey("em1_short_desc1", this.name);
            return;
        }
        if (missionVariables.longwayround === "STAGE1" && system.ID === 248) {
            // show mission screen
            mission.runScreen(
                {
                    screenID: "longwayround",
                    title: "Incoming Message",
                    exitScreen: "GUI_SCREEN_STATUS",
                    messageKey: "long_way_round_Soladies_briefing"
                } 
            );
            missionVariables.longwayround = "STAGE2";
            player.credits += 500;
            player.consoleMessage("You have been awarded 500cr.");
            mission.unmarkSystem({system:248, name:this.name});
            mission.markSystem({system:233, name:this.name});
            mission.setInstructionsKey("em1_short_desc2", this.name);
            return;
        }
        if (missionVariables.longwayround === "STAGE2" && system.ID === 233) {
            // show mission screen
            mission.runScreen(
                {
                    screenID: "longwayround",
                    title: "Incoming Message",
                    overlay: "loyalistflag.png",
                    exitScreen: "GUI_SCREEN_STATUS",
                    messageKey: "long_way_round_Qubeen_briefing"
                } 
            );
            missionVariables.longwayround = "MISSION_COMPLETE";
            player.credits += 2000;
            player.consoleMessage("You have been awarded 2000cr.");
            mission.unmarkSystem({system:233, name:this.name});
            mission.setInstructionsKey(null, this.name);
            delete this.shipExitedWitchspace;
            delete this.missionScreenOppportunity;
            return;
        }
    }
}

this.shipExitedWitchspace = function() {
    if (galaxyNumber === 0 && system.ID === 233 && missionVariables.longwayround === "STAGE2") {
        this._counter = 0;
        this._timer = new Timer(this, this.$addExtraShips, 1, 1);
        system.addShips("longWay_rebel", 2);
    }
}

this.$addExtraShips = function $addExtraShips() {
    if (player.ship.isValid === false || player.ship.isInSpace === false) {
        this._timer.stop();
        return;
    }
    this._counter += 1;
    if (this._counter < 60) {
        if (system.countShipsWithPrimaryRole("longWay_rebel") < 5) {
            if (Math.random() < 0.5) {
                system.addShips("longWay_rebel", 1);
            }
        }
    } else {
        this._timer.stop();
    }
}