Back to Index Page generated: Dec 1, 2024, 3:15:25 AM

Expansion Deep Space Dredgers Facelift

Content

Warnings

  1. http://wiki.alioth.net/index.php/Deep%20Space%20Dredgers%20Facelift -> 404 Not Found
  2. High hanging fruit
  3. Required Expansions mismatch between OXP Manifest and Expansion Manager at character position 0071 (DIGIT ZERO vs LATIN SMALL LETTER N)
  4. No version in dependency reference to oolite.oxp.EricWalch.DeepSpaceDredger:null

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Updates the look of the Deep Space Dredgers. Updates the look of the Deep Space Dredgers.
Identifier oolite.oxp.phkb.DeepSpaceDredgers_Facelift oolite.oxp.phkb.DeepSpaceDredgers_Facelift
Title Deep Space Dredgers Facelift Deep Space Dredgers Facelift
Category Retextures Retextures
Author phkb phkb
Version 1.2 1.2
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
  • oolite.oxp.EricWalch.DeepSpaceDredger:0
  • oolite.oxp.EricWalch.DeepSpaceDredger:
  • Optional Expansions
    Conflict Expansions
    Information URL https://wiki.alioth.net/index.php/Deep_Space_Dredgers_Facelift n/a
    Download URL https://wiki.alioth.net/img_auth.php/2/2f/DeepSpaceDredgers_Facelift_1.2.oxz n/a
    License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
    File Size n/a
    Upload date 1716502212

    Documentation

    readme.txt

    Deep Space Dredgers Facelift
    by phkb
    
    Overview
    ========
    This mod updates the look of the Deep Space Dredger ships, giving them new diffuse, normal and specular maps. Also, some ship replacements have been performed to better align the look of the ships with the standard game models and textures:
    1. A Griff Orbital Shuttle replaces the Dredger Shuttle.
    2. A Staer9 Python Class Cruiser replaces the Dredger Trader.
    3. A Griff Sidewinder Escort replaces the Fury.
    
    Requirements
    ============
    This mod requires the Deep Space Dredgers OXP.
    
    License
    =======
    All ships by Sabre. Scripting by Eric Walch. Messages by Little Bear. Original textures by Captain Berf.
    
    This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/
    
    Version History
    ===============
    1.2
    - Small fixes to shipdata-overrides.plist.
    
    1.1
    - Added condition script to limit number of dredgers that can be spawned in any given system to 1.
    - Tweaks to the conditions used to spawn derelicts in and notify player.
    
    1.0
    - Initial release

    Equipment

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

    Ships

    Name
    Dredger Trader engine
    Deep Space Dredger
    Super Dredger

    Models

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

    Scripts

    Path
    Config/script.js
    "use strict";
    this.name = "DeepSpaceDredgers_Facelift";
    this.author = "phkb";
    this.license = "CC-BY-NC-SA 3.0";
    
    this.startUp = function () {
        log(this.name, "Monkey-patching Deep Space Dredgers spawning routines");
        var ws = worldScripts.deep_space_dredger;
        delete ws.shipExitedWitchspace;
        ws.addDredger = this.new_addDredger;
        ws.systemWillPopulate = this.new_systemWillPopulate;
        ws.isSystemAtWar = this.new_isSystemAtWar;
    }
    
    this.startUpComplete = function () {
        // update Vimana-X with the changes to models
        var vx = worldScripts.VimanaX_HUD;
        if (vx) {
            vx._gameShips["Dredger Shuttle"] = "orbital_shuttle";
            vx._gameShips["Dredger Trader"] = "python_cruiser";
            vx._gameShips["Sidewinder Fury"] = "sidewinder_escort";
        }
    }
    
    
    this.new_addDredger = function () {
        var orientation = player.ship.orientation;
        var forwardPosition = player.ship.position.add(orientation.vectorForward().multiply(300E3));
        var dr = system.addShips("dredgers", 1, forwardPosition, 1);
        // only add the extra if we successfully spawned a dredger
        if (dr && dr.length > 0 && Math.random() < 0.5) {
            system.addShips("asteroid", Math.ceil(Math.random() * 3), forwardPosition, 10E3);
            system.addShips("miner", Math.ceil(Math.random() * 3), forwardPosition, 10E3);
        }
    }
    
    this.new_systemWillPopulate = function () {
        if (this.salvageList) { delete this.salvageList; delete this.salvageNameList };
        if (system.isInterstellarSpace || system.sun.hasGoneNova) return;
        this.dredger = false;
        if (system.techLevel > 8) {
            if (Math.random() < 0.5) {
                if (Math.random() < 0.2) {
                    system.addShipsToRoute("dredgertrader", 1, Math.random(), "pw");
                }
                this.dredger = true; // dredger can be added to this system.
            } else {
                if (Math.random() < 0.05 && !worldScripts["bigShips_populator"]) {
                    system.addShipsToRoute("dredgers", 1, Math.random() * 0.5, "pw");
                }
            }
        }
    
        if (player.ship.isInSpace && (system.description.indexOf("civil war") != -1 || this.isSystemAtWar()) && system.government < Math.random() * 7) { // more chance in "civil war" systems
            if (Math.random() < 0.1) this.addDerelict(0.1 + Math.random() * 0.8, 1);
            if (Math.random() < 0.02) {
                var location = Math.ceil(Math.random() * 5);
                this._msgkey = "";
                switch (location) {
                    case 1:
                        this.addDerelict(0.97, 5);  // 20%
                        this._msgkey = "salvage_drone_battle_station";
                        break;
                    case 5:
                        this.addDerelict(0, 5);  // 20%
                        this._msgkey = "salvage_drone_battle_witchpoint";
                        break;
                    default:
                        this.addDerelict(0.2 + Math.random() * 0.7, 5);  // 60%
                        this._msgkey = "salvage_drone_battle_spacelane";
                        break;
                }
                this._msgTimer = new Timer(this, function(){var wpb = system.shipsWithRole("buoy-witchpoint")[0]; if (wpb) wpb.commsMessage(expandDescription("[" + worldScripts.deep_space_dredger._msgkey + "]"), player.ship);}, 3, 0);
                this.dredger = true;
            }
        }
    }
    
    this.new_isSystemAtWar = function() {
        var de = worldScripts.DayDiplomacy_010_Systems;
        if (!de) return false;
        var we = worldScripts.DayDiplomacy_040_WarEngine;
        var id = de.$retrieveActorFromSystem(galaxyNumber, system.ID).id;
        var warlist = we.$getAlliancesAndWars()[id];
        return (Object.keys(warlist).length > 0);
    }
    Scripts/dsd_conditions.js
    "use strict";
    this.name = "DSD_Condition_Script";
    this.author = "phkb";
    this.copyright = "2024 phkb";
    this.license = "CC BY-NC-SA 4.0";
    
    //----------------------------------------------------------------------------------------
    this.allowSpawnShip = function(shipKey) {
        if (system.countShipsWithRole("dredgers") > 0) return false;
        return true;
    }