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

Expansion Distant Suns

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Distant Suns tweaks the appearance of every star individually. Every star has its colour set. Cooler red stars have their habitable planets close by and are easy to skim for fuel. Super-luminous blue-white stars are far removed from their habitable zone and sun-skimming is impractical. Some stars are named. Distant Suns tweaks the appearance of every star individually. Every star has its colour set. Cooler red stars have their habitable planets close by and are easy to skim for fuel. Super-luminous blue-white stars are far removed from their habitable zone and sun-skimming is impractical. Some stars are named.
Identifier oolite.oxp.Wildeblood.distant_suns oolite.oxp.Wildeblood.distant_suns
Title Distant Suns Distant Suns
Category Ambience Ambience
Author Wildeblood Wildeblood
Version 0.5.1 0.5.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Distant_Suns n/a
Download URL https://wiki.alioth.net/img_auth.php/a/af/Distant_Suns_0.5.1.oxz n/a
License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
File Size n/a
Upload date 1610873410

Documentation

Also read http://wiki.alioth.net/index.php/Distant%20Suns

Equipment

This expansion declares no equipment.

Ships

This expansion declares no ships.

Models

This expansion declares no models.

Scripts

Path
Config/script.js
"use strict";

this.name    = "Stars";
this.version = "0.5.1";

/* ====================================================================================
			SPECTROSCOPE

	Converts values set in planetinfo.plist and found in system.info.sun_color 
	into descriptive text strings. These are not computed values, so...
	Setting sun_color = "1.0 0.0 0.0" in planetinfo.plist returns null, even though 
	it creates the same colour star in the game as setting sun_color = "redColor".
======================================================================================= */

this.$spectroscope = function(colour)
	{
	if (!colour) colour = system.info.sun_color;
	if (!colour) return false;
	switch (colour)
			{
			case "magentaColor":
			case "redColor":    colour = "class M star"; break;
			case "orangeColor": colour = "class K star"; break;
			case "yellowColor": colour = "class G star"; break;
			case "whiteColor":  colour = "class F star"; break;
			case "cyanColor":   colour = "class A star"; break;
			case "blueColor":   colour = "class B star"; break;
			default:            colour = null;
			}
	return colour;
	}

/* ====================================================================================
			EXAMPLE USE - ADD LINE TO SYSTEM DATA SCREEN
======================================================================================= */

this.guiScreenChanged = function()
	{
	if (guiScreen === "GUI_SCREEN_SYSTEM_DATA")
		{
		var info = System.infoForSystem(galaxyNumber, player.ship.targetSystem);
		if (info.sun_gone_nova) return;
		
		var name    = info.name;
		var sunName = info.sun_name;
		var colour  = info.sun_color;
		if (colour) var colourText = this.$spectroscope(colour);

		if (colourText && sunName) mission.addMessageText("The planet " + name + " orbits the " + colourText + " " + sunName + ".");
		else if (colourText) mission.addMessageText("The planet " + name + " orbits a " + colourText + ".");
		else if (sunName) mission.addMessageText("The planet " + name + " orbits the star " + sunName + ".");
		}
	}

/* ====================================================================================
			THE END
======================================================================================= */