Back to Index Page generated: Dec 20, 2024, 7:22:10 AM

Expansion Nuit Space Station

Content

Warnings

  1. http://wiki.alioth.net/index.php/Nuit%20Space%20Station -> 404 Not Found
  2. Low hanging fuit: Information URL exists...

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description A large space station which in some advanced systems with stable governments could be found next to the main planet. For more details please check the wiki page. A large space station which in some advanced systems with stable governments could be found next to the main planet. For more details please check the wiki page.
Identifier oolite.oxp.zzz.Montana05.KillerWolf.nuit_station oolite.oxp.zzz.Montana05.KillerWolf.nuit_station
Title Nuit Space Station Nuit Space Station
Category Dockables Dockables
Author Killer Wolf, Griff, Montana05, phkb Killer Wolf, Griff, Montana05, phkb
Version 2.3 2.3
Tags station, ships station, ships
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/Nuit_Space_Station_OXP n/a
Download URL https://wiki.alioth.net/img_auth.php/3/33/Nuit_Station_2.3.oxz n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1707362701

Documentation

read_me.txt

Overview
========

The Nuit Space Station was originally designed by Isis Interstellar and Griff Industries as part of a GalCop project 
intended to find alternatives to the Coriolis and Icosahedron stations. When the project was suddenly cancelled the 
decission was made to finish the production of the prototype and after successful space trials, the Nuit was brought 
online as an opulent, high class spaceport.

Following the unprecedented success of the station, Isis Interstellar has moved to full production status and we are 
extremely proud to offer now these stations for sale. 

Locations
=========

Nuit Space Stations could be found in tech-level 10+ systems with a Dictatorship, a Confederacy, a Democracy 
or a Corporate State government. In rich industrial systems the Nuit is based close to the main station, 
in all other systems on the other side of the planet. 

Credits
=======

Thanks a lot to Killer Wolf for making this station available to the Oolite community.

Killer Wolf (concept, model, original textures)
Griff (shaders)

Remarks
=======

* While 4 safe docking points for oversize freighters are mentioned there is no mechanic to use them, they merely exist
  for optics.
* Beginning with V 1.50 the station is using Vampire Mark II-B fighters as defenders, these combat crafts are added as 
  GalCop police as well.
* With V 1.51 the hull paint of the station is a darker blue, the structures are more visible. 


Dependencies
============

Oolite V 1.88 or higher. Since the entire package is using shaders your graphics card need to be able to manage them.

Details
=======

For additional details, please read the attached 'Sales Brochure' or check the wiki-page: https://wiki.alioth.net/index.php/Nuit_Space_Station_OXP

License
=======

This work is licensed under Creative Commons Attribution Non-Commercial Share Alike 4.0 International (CC BY-NC-SA 4.0).
To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0

Strictly non-commercial, while you are free to use this OXP in Oolite you may not resell it,
or include it in a compilation disc for sale.

Version History
===============

V 1.00 / 2009-11-11 / Killer Wolf
beta release

V 1.10 / 2022-02-26 / Montana05
added market and a populator script

V 1.50 / 2022-02-28 / Montana05
* refactored and improved the entire package
* added 2 ships from Isis Interstellar, 1 as individual station defender and 1 as GalCop police
* included shiplibrary.plist

V 1.51 / 2022-03-01 / Montana05
* modified the diffuse and normal maps
* smoothed some parts of the station

V 2.0 / 2024-01-31 / phkb
* Fixed issue with docking tunnel where the walls of the dock would disappear before the docking sequence starts.
* Added link to Docking Fees (if installed).
* Added some docked liners (if Liners is installed).
* Added external docking port facility (if External Dock System is installed).
* Switched to using default Oolite shaders, and added specular maps.
* Tweaked textures a bit. Added numbers to external docking ports.

V2.1 / 2024-02-02 / phkb
* Added external dock visual effects to station models.
* Tweaked interface code with EDS.

V2.2 / 2024-02-04 / phkb
* Removed external docking lights when NPC ships are docked.
* Updated interface to EDS to latest specification.

V2.3 / 2024-02-08 / phkb
* Fixed issue where timer is not reset correctly when jumping to new system.

Equipment

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

Ships

Name
nuit_docked_anaconda
nuit_docked_aurora
nuit_docked_boa2
nuit_docked_emerald
nuit_docked_orisis
nuit_docked_smivs
nuit_docked_tigershark
External dock lights
Nuit Station Base
Nuit Station Dock
Nuit Space Station
nuit_station_hangar_liners
Nuit Station Ring
Nuit Station Ring
Nuit Station Structure
Nuit Station Structure
Nuit Station Structure
Nuit-Sec Vampire Mark II-B/F
Vampire Mark II-B Gun
Vampire Mark II-B Gun
Vampire Mark II-B Hull Plate
Vampire Mark II-B Reactor
Vampire Mark II-B Reactor
Vampire Mark II-B Sensor
Vampire Mark II-B Sensor
Vampire Mark II-B Tail
Vampire Mark II-B Tail
GalCop Vampire Mark II-B/N
Vampire Mark II-B Gun
Vampire Mark II-B Gun
Vampire Mark II-B Hull Plate
Vampire Mark II-B Reactor
Vampire Mark II-B Reactor
Vampire Mark II-B Sensor
Vampire Mark II-B Sensor
Vampire Mark II-B Tail
Vampire Mark II-B Tail

Models

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

Scripts

Path
Scripts/nuit_GalCop_vampire_mark_IIBN_conditions.js
"use strict";
this.name = "nuit_GalCop_vampire_mark_IIBN_conditions";
this.author = "Montana05";
this.description = "condition script for the GalCop Vampire Mark II-B/N (Nuit Space Station)";
this.version = "1.51";
this.copyright = "2022 Montana05";
this.licence = "CC BY-NC-SA 4.0";

this.allowSpawnShip = function (shipKey) {
	var systemGov = system.government;

	// only advanced systems with stable governments
	if (system.isInterstellarSpace || system.sun.isGoingNova || system.sun.hasGoneNova ||
		system.techLevel < 10 || systemGov < 3) {
		return false;
	};

	// Dictators OXP and Commies OXP got their own police force
	if ((systemGov == 3 && worldScripts["dictators.js"]) || (systemGov == 4 && worldScripts["communist_population"])) {
		return false;
	};

	// different to the Nuit Space Station the GalCop ships will also show up at Confederacies
	return true;
};
Scripts/nuit_space_station_populator.js
"use strict";
this.name = "nuit_space_station_populator";
this.author = "Montana05";
this.description = "Populator for Nuit Space Stations";
this.version = "2.0";
this.copyright = "2022 Montana05";
this.license = "CC BY-NC-SA 4.0";

this._externalDockNotification = false;
this._portNotification = false;
this._timer = null;
this._setStation = null;
this._externalDockFee = 100; // amount to charge for use of external dock
this._noAegisSpawn = true;

//----------------------------------------------------------------------------------------
this.startUpComplete = function () {
	// add docking fees
	if (worldScripts["Docking Fees"]) {
		worldScripts["Docking Fees"].$addFee("nuit_space_station", { messageKey: "dockfee_short" });
	}
}

//----------------------------------------------------------------------------------------
this.systemWillPopulate = function () {
	var systemGov = system.government;
	if (!this._setStation || !this._setStation.isValid) {
		if (this._timer && this._timer.isRunning) this._timer.stop();
	}

	// advanced systems with a Dictatorship, Confederacy, Democracy or Corporate State government
	if (system.isInterstellarSpace || system.sun.isGoingNova || system.sun.hasGoneNova ||
		system.techLevel < 10 || systemGov < 3 || systemGov == 4 || systemGov == 5 ||
		system.countShipsWithRole("nuit_space_station") > 0) {
		return;
	} else {
		// in rich industrial systems the Nuit Space Station is located close to the main station
		if (system.economy == 0 && this._noAegisSpawn == false) {
			system.setPopulator("nuit",
				{
					callback: function (pos) {
						var key = "nuit_space_station";
						// check if liners is installed
						if (worldScripts["liners_populator_script.js"]) key = "nuit_space_station_liners";

						var nuit_station = system.addShips(key, 1, pos, 0)[0];
						nuit_station.orientation = [1, 0, 1, 0];
						// add a ve to mask the issue of the walls of the dock disappearing when you enter
						var ve = system.addVisualEffect("nuit_dock_ve", nuit_station.position.add(nuit_station.vectorRight.multiply(-11)).add(nuit_station.vectorUp.multiply(3004)).add(nuit_station.vectorForward.multiply(419)));
						ve.scale(1.01);
						ve.orientation = nuit_station.orientation;

						worldScripts["nuit_space_station_populator"].$populateExternalDocks(nuit_station);
						if (worldScripts.ExternalDockSystem) worldScripts["nuit_space_station_populator"].$registerExternalDocks(nuit_station);

					}.bind(this),
					location: "STATION_AEGIS",
					locationSeed: 112,
					deterministic: true
				});
		} else {
			// in all other systems it could be found on the other side of the planet
			system.setPopulator("nuit",
				{
					callback: function (pos) {
						var key = "nuit_space_station";
						// check if liners is installed
						if (worldScripts["liners_populator_script.js"]) key = "nuit_space_station_liners";

						var pos = Vector3D(0.0, 0.0, -0.2).fromCoordinateSystem("pwu");
						var nuit_station = system.addShips(key, 1, pos, 0)[0];
						nuit_station.orientation = [1, 0, 1, 0];
						// add a ve to mask the issue of the walls of the dock disappearing when you enter
						var ve = system.addVisualEffect("nuit_dock_ve", nuit_station.position.add(nuit_station.vectorRight.multiply(-11)).add(nuit_station.vectorUp.multiply(3004)).add(nuit_station.vectorForward.multiply(419)));
						ve.scale(1.01);
						ve.orientation = nuit_station.orientation;

						worldScripts["nuit_space_station_populator"].$populateExternalDocks(nuit_station);
						if (worldScripts.ExternalDockSystem) worldScripts["nuit_space_station_populator"].$registerExternalDocks(nuit_station);
					}.bind(this),
					location: "COORDINATES",
					locationSeed: 112,
					deterministic: true
				});
		};
	};
};

//----------------------------------------------------------------------------------------
this.$externalDockNotification = function $externalDockNotification() {
	if (!this._setStation || !this._setStation.isValid) {
		this._timer.stop();
		return;
	}
	if (this._externalDockNotification == false) {
		if (this._setStation.position.distanceTo(player.ship) < player.ship.scannerRange * 0.85) {
			this._setStation.commsMessage(expandDescription("[nuit_external_docks]", { fee_amt: formatCredits(this._externalDockFee, true, true) }), player.ship);
			this._externalDockNotification = true;
		}
	} else if (this._externalDockNotification == true && this._portNotification == false) {
		var areis = "are";
		if (this._setStation._externalDocks.length == 1) areis = "is";
		this._setStation.commsMessage(expandDescription("[nuit_external_available]", { available_ports: this._setStation._externalDocksAvailable, are_is: areis }), player.ship);
		this._portNotification = true;
	} else {
		this._timer.stop();
	}
}

//----------------------------------------------------------------------------------------
this.guiScreenChanged_hold = function (to, from) {
	// after all docking processes have finished, do the post dock functions
	if ((to == "GUI_SCREEN_REPORT" && from == "GUI_SCREEN_STATUS") ||
		(to == "GUI_SCREEN_STATUS" && from == "GUI_SCREEN_MAIN") ||
		(to == "GUI_SCREEN_STATUS" && from == "GUI_SCREEN_REPORT")) {
		this.$postDockSetup(player.ship.dockedStation);
		delete this.guiScreenChanged;
	}
}

//----------------------------------------------------------------------------------------
// works out which docks will have ships docked in them
this.$populateExternalDocks = function (station) {
	// docked ship subents are from index 11
	var num = parseInt(system.scrambledPseudoRandomNumber(clock.days) * 3); // number of ships to have docked (between 0 and 2) 
	var check = 0;
	var last = station.subEntities.length - 1; // index of the last entry
	var variations = parseInt(((last - 11) + 1) / 4);

	station._externalDocks = [];

	for (var i = 0; i <= 3; i++) { // number of external docking positions
		if (system.scrambledPseudoRandomNumber(clock.days * 2 + i) > 0.5 && check < num) {
			// only keep one in each position
			var keep = parseInt(system.scrambledPseudoRandomNumber(clock.days * 3 + i) * variations);
			var counter = 0;
			for (var j = (last - (i * variations)); j >= (last - (i * variations) - variations) + 1; j--) {
				if (counter != keep) {
					station.subEntities[j].remove();
				}
				counter += 1;
			}
			check += 1;
		} else {
			// we're removing all in this position
			for (var j = (last - (i * variations)); j >= (last - (i * variations) - variations) + 1; j--) {
				station.subEntities[j].remove();
			}
			station._externalDocks.push(i);
		}
	}

	// build text for dock number notification
	if (station._externalDocks.length > 0) {
		var txt = "";
		var add = ", ";
		for (var i = 0; i < station._externalDocks.length; i++) {
			if (i == station._externalDocks.length - 1) add = " and ";
			txt += (txt == "" ? "" : add) + "0" + (station._externalDocks[i] + 1);
		}
		station._externalDocksAvailable = txt;
	}

	// remove the flashers if eds is not installed.
	var eds = worldScripts.ExternalDockSystem;
	if (!eds) {
		station.subEntities[10].remove();
		station.subEntities[9].remove();
		station.subEntities[8].remove();
		station.subEntities[7].remove();
	}
}

//----------------------------------------------------------------------------------------
// registers our external docks with the eds
this.$registerExternalDocks = function (station) {
	var eds = worldScripts.ExternalDockSystem;
	this._setStation = station;

	// set up the timer to let the player know about the docks
	if (station._externalDocks.length > 0) this._timer = new Timer(this, this.$externalDockNotification, 2, 2);
	var docks = station._externalDocks.length;

	var dockmax = 4;
	// dock 0 - index 10
	if (station._externalDocks.indexOf(0) >= 0) {
		eds.$addExternalDock({station:station, position:[2400, 40, -20], scale:1, allowLaunch:true, launchSubEntityIndex:(10 - (dockmax - docks)), preDockCallback:this.$preDockSetup.bind(this)});
	} else station.subEntities[10].remove();

	// dock 1 - index 9
	if (station._externalDocks.indexOf(1) >= 0) {
		dockmax = 4;
		if (station._externalDocks.indexOf(0) == -1) dockmax -= 1;
		eds.$addExternalDock({station:station, position:[-2400, 40, -20], scale:1, allowLaunch:true, launchSubEntityIndex:(9 - (dockmax - docks)), preDockCallback:this.$preDockSetup.bind(this)});
	} else station.subEntities[9].remove();

	// dock 2 - index 8
	if (station._externalDocks.indexOf(2) >= 0) {
		dockmax = 4;
		if (station._externalDocks.indexOf(0) == -1) dockmax -= 1;
		if (station._externalDocks.indexOf(1) == -1) dockmax -= 1;
		eds.$addExternalDock({station:station, position:[0, -3290, 2390], scale:1, allowLaunch:true, launchSubEntityIndex:(8 - (dockmax - docks)), preDockCallback:this.$preDockSetup.bind(this)});
	} else station.subEntities[8].remove();
	
	// dock 3 - index 7
	if (station._externalDocks.indexOf(3) >= 0) {
		dockmax = 4;
		if (station._externalDocks.indexOf(0) == -1) dockmax -= 1;
		if (station._externalDocks.indexOf(1) == -1) dockmax -= 1;
		if (station._externalDocks.indexOf(2) == -1) dockmax -= 1;
		eds.$addExternalDock({station:station, position:[0, -3290, -2410], scale:1, allowLaunch:true, launchSubEntityIndex:(7 - (dockmax - docks)), preDockCallback:this.$preDockSetup.bind(this)});
	} else station.subEntities[7].remove();
}

//----------------------------------------------------------------------------------------
// switches docking fees over to the external dock fee
this.$preDockSetup = function (station) {
	if (worldScripts["Docking Fees"]) {
		var df = worldScripts["Docking Fees"];
		delete df._fees["nuit_space_station"];
		df.$addFee("nuit_space_station", { fee: this._externalDockFee, messageKey: "nuit_external_dock_fee" });
	} else {
		var fee = this._externalDockFee;
		if (fee > player.credits) fee = player.credits;
		player.credits -= fee;
		player.addMessageToArrivalReport(expandDescription("[nuit_external_dock_fee]", {
			fee_amt: formatCredits(fee, true, true)
		}));
	}
	this.guiScreenChanged = this.guiScreenChanged_hold;
}

//----------------------------------------------------------------------------------------
// switches docking fees back to standard
// can only do this once all docking processes have finished (rather than using the callback as part of the external dock setup)
this.$postDockSetup = function (station) {
	if (worldScripts["Docking Fees"]) {
		var df = worldScripts["Docking Fees"];
		delete df._fees["nuit_space_station"];
		this.startUpComplete();
	}
}