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

Expansion Welcome Mat

Content

Warnings

  1. Found XML equipment list

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Information equipment to give system summary information on arrival. Information equipment to give system summary information on arrival.
Identifier oolite.oxp.Thargoid.WelcomeMat oolite.oxp.Thargoid.WelcomeMat
Title Welcome Mat Welcome Mat
Category Equipment Equipment
Author Thargoid Thargoid
Version 1.13 1.13
Tags equipment, system, OXPConfig equipment, system, OXPConfig
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Welcome_Mat_OXP n/a
Download URL https://wiki.alioth.net/img_auth.php/6/6a/Welcome_Mat_1.13.oxz n/a
License Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with clauses - see readme file Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with clauses - see readme file
File Size n/a
Upload date 1610873327

Documentation

Also read http://wiki.alioth.net/index.php/Welcome%20Mat

Welcome Mat v1.13 ReadMe & LIcense.txt

Welcome Mat OXP by Thargoid.

The Ships Systems Department of the Aquarian Shipbuilding Corporation present an expansion to the communications system to enhance the system information available on arrival from Witchspace.

The enhancement to the ships software enables communication with the witchspace beacon (after connection through the ship identification system, position the buoy in your sights and press "r"). After a connection is established (which can take anything up to 60 seconds), the system will be transferred and displayed. This facility is also available for the main station navigation buoy.

For the busy commander on the go, a small piece of add-on equipment is also offered, which automatically negotiates communications on arrival, making the information available instantly. Please note that due to the volume of traffic this only operates at the witchspace beacon only, not the main station one.

--------------------------------------------------------------

License:

This OXP is released under the Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with the following clauses:

* Whilst you are free (and encouraged) to re-use any of the scripting, models or texturing in this OXP, the usage must be distinct from that within this OXP. Unique identifiers such as (but not limited to) unique shipdata.plist entity keys, mission variables, script names (this.name), equipment identity strings (EQ_), description list arrays and entity roles must not be re-used without prior agreement. Basically if it's unique or would identify or overwrite anything in the original OXP, then you may not re-use it (for obvious compatibility reasons).
* rebundling of this OXP within another distribution is permitted as long as it is unchanged. The following derivates however are permitted and except from the above:
	* the conversion of files between XML and openStep.
	* the merging of files with other files of the same type from other OXPs.
* The license information (either as this file or merged into a larger one) must be included in the OXP.
* Even though it is not compulsory, if you are re-using any sizable or recognisable piece of this OXP, please let me know :)

--------------------------------------------------------------

Instructions:

Unzip the file, and then move the folder "Welcome Mat 1.13.oxp" to the AddOns directory of your Oolite installation. Then start the game up whilst holding down shift until you see the spinning Cobra MkIII screen.

This OXP is fully compatible with the OXPConfig.oxp game tweaking application, and the logging and messages appearing can be changed through that or via the javaScript console.

Due to the script commands involved, this OXP requires Oolite version 1.72 or higher.

--------------------------------------------------------------

Version history:

13/09/2008 - Version 1.00, Initial release (Equipment version).
14/03/2008 - Version 1.01, messaging switchable between console and comms systems (via this.audio & OXPConfig).
17/09/2008 - Version 1.02, made OXPConfig flags sticky via mission variables, and changed Galcop warning messages. Also streamlined the script and worked around the system.techLevel vs system info screen discrepancy.
18/09/2008 - Version 1.03, merging of script and equipment versions. If equipment is purchased, message is displayed immediately on arrival. If not then player must lock onto the witchspace buoy and wait for connection to be made.
22/08/2008 - Version 1.04, expanded network to include all buoys. Fixed a glitch with the flag settings too.
04/11/2008 - Version 1.05, scripting update for compatability with v1.72.
19/08/2009 - Version 1.06, update for scripting depreciation, plus to limit messages to beacon buoys. Also removed the 1.71 code.
24/05/2010 - Version 1.10, strengthened the damaged equipment checking for 1.74
13/02/2011 - Version 1.11, removal of upper limit, to allow running with 1.75
15/04/2012 - Version 1.12, script change for compatibility with Interstellar Tweaks OXP (by request of UK_Eliter).
05/02/2013 - Version 1.13, update to restore the compatibility with the new OXPConfig.

---------------------------------------------------------------

Acknowledgements:

With thanks to PAGroove for the idea of the buoy lock-on, and Eric Walch for the scenario to merge the two version OXPs.

Equipment

Name Visible Cost [deci-credits] Tech-Level
Planetary Information System yes 3000 6+

Ships

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

Models

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

Scripts

Path
Config/script.js
this.name			= "Welcome Information Script"; 
this.author			= "Thargoid"; 
this.copyright		= "Creative Commons: attribution, non-commercial, sharealike with clauses - see readme.txt";
this.description	= "Expanded information when you witchspace jump into a system."; 
this.version		= "1.13"; 

/* this.logging, this.audio, this.extraA and this.extraB are for compatability with OXPConfig.oxp.

	this.logging - Sends arrival location to stderr.txt and JSConsole (off by default).
	this.audio - Switch between console and comms messaging (on (comms) by default).
	this.extraA - General system information (on by default).
	this.extraB - System safety information (on by default).

	Set the default values up below:
*/

this.logging = false;
this.audio = true;
this.extraA = true;
this.extraB = true;

this.oxpcSettings = {
	Info: {Name:this.name,Display:this.name,InfoB:"1 - If false suppresses the general system information.\n2 - If false suppresses system safety information.\n3 - If true, log arrival locations to the console and latest.log.\n4 - If true send messages to the ships comms system, if false to the console instead."},
	Bool0: {Name:"extraA",Def:true,Desc:"General system information displayed."},
	Bool1: {Name:"extraB",Def:true,Desc:"System safety information displayed."},
	Bool2: {Name:"logging",Def:false,Desc:"Send arrival locations."},
	Bool3: {Name:"audio",Def:true,Desc:"Switch output to comms or console messaging"}
};

this.shipLaunchedFromStation = function() 
	{	
	missionVariables.welcomeLogging = this.logging;
	missionVariables.welcomeAudio = this.audio;
	missionVariables.welcomeExtraA = this.extraA;
	missionVariables.welcomeExtraB = this.extraB;
	if(this.welcomeTimer)
		{ this.welcomeTimer.start(); }
	else
		{ this.welcomeTimer = new Timer(this, this.checkForBuoy, 30, 30); }
	}


this.shipWillDockWithStation = function(station)
	{	
	missionVariables.welcomeLogging = this.logging;
	missionVariables.welcomeAudio = this.audio;
	missionVariables.welcomeExtraA = this.extraA;
	missionVariables.welcomeExtraB = this.extraB;
	this.welcomeTimer.stop();
	}

this.shipExitedWitchspace = function() 
	{
	if(system.isInterstellarSpace) { return; }
	
	if(player.ship.equipmentStatus("EQ_WELCOME_MAT") != "EQUIPMENT_OK")
		{
		player.consoleMessage("Please lock onto the beacon to initiate data connection.", 6);
		if(this.welcomeTimer)
			{ this.welcomeTimer.start(); }
		else
			{ this.welcomeTimer = new Timer(this, this.checkForBuoy, 30, 30); }
		}
	else
		{ this.displayMessage(); }	
	}


this.checkForBuoy = function()
	{
	if(player.ship.target && system.entitiesWithScanClass("CLASS_BUOY", player.ship, 25600).length) // check player has equipment and a buoy is on the scanner
		{
		if(player.ship.target.scanClass == "CLASS_BUOY" && player.ship.target.isBeacon && !player.ship.target.hasRole("welcomeMat_suppress")) 
			{ this.displayMessage(); }
		}
	}

this.displayMessage = function()
	{
	if(!system.isInterstellarSpace)
		{ 
		this.pirateCount = system.shipsWithPrimaryRole("pirate").length; // how many ships in the system which have a role of pirate
		this.policeCount = system.entitiesWithScanClass("CLASS_POLICE").length + system.entitiesWithScanClass("CLASS_MILITARY").length; // how many ships with scanClass police or military
		this.thargoidCount = system.entitiesWithScanClass("CLASS_THARGOID").length; // how many ships in the system with Thargoid scanclass
		this.systemSafety = ((this.pirateCount + this.thargoidCount) - this.policeCount); // the balance between pirate/Thargoid and police/military ships.
		if(this.logging)
			{
			log("Player in galaxy " + (galaxyNumber+1) + " at " + system.name + " (" + system.ID + ").");
			log("Pirate count - " + this.pirateCount); 
			log("Police count - " + this.policeCount); 
			log("Thargoid count - " + this.thargoidCount); 
			log("System safety figure - " + this.systemSafety);
			} 
		if(this.audio) // messages via commsMessage
			{
			if(this.extraA) 
				{ // display the information to the comms system, after the in-built system name message.
				player.commsMessage("Government - " + system.governmentDescription + ".", 6);
				player.commsMessage("Tech level - " + (system.techLevel + 1) + ".", 6); 
				player.commsMessage("Economy - " + system.economyDescription + ".", 6); 
				} 
			if(this.extraB)
				{
				if(this.systemSafety > 5) 
					{ // if there are significantly more pirates/Thargoids than police/military
					player.commsMessage("Beware, significant pirate activity has been reported in this system!", 6); 
					} 
				else
					{
					if(this.systemSafety < -5) 
						{ // if there are significantly less pirates/Thargoids than police/military
						player.commsMessage("This system has a strong police presence.", 6); 
						}
					else
						{ // if system is balanced between police/military and pirates/Thargoids
						player.commsMessage("No reports of major pirate activity.", 6);
						}
					}
				if(this.thargoidCount == 1) {player.commsMessage ("Alien vessel reported in system.", 6); };
				if(this.thargoidCount > 1) {player.commsMessage ("Alien vessels reported in system.", 6); };
				if(system.sun.isGoingNova) {player.commsMessage("The sun is going nova! Get out now!", 6); };
				}
			}
			else // messages via consoleMessage
			{
			if(this.extraA) 
				{ // display the information to the console system, after the in-built system name message.
				player.consoleMessage("Government - " + system.governmentDescription + ".", 6);
				player.consoleMessage("Tech level - " + (system.techLevel + 1) + ".", 6); 
				player.consoleMessage("Economy - " + system.economyDescription + ".", 6); 
				} 
			if(this.extraB)
				{
				if(this.systemSafety > 5) 
					{ // if there are significantly more pirates/Thargoids than police/military
					player.consoleMessage("Beware, significant pirate activity has been reported in this system!", 6); 
					} 
				else
					{
					if(this.systemSafety < -5) 
						{ // if there are significantly less pirates/Thargoids than police/military
						player.consoleMessage("This system has a strong police presence.", 6); 
						}
						else
						{ // if system is balanced between police/military and pirates/Thargoids
						player.consoleMessage("No reports of major pirate activity.", 6);
						}
					}
				if(this.thargoidCount == 1) {player.consoleMessage ("Alien vessel reported in system.", 6); }; 
				if(this.thargoidCount > 1) {player.consoleMessage ("Alien vessels reported in system.", 6); }; 
				if(system.sun.isGoingNova) {player.consoleMessage("The sun is going nova! Get out now!", 6); }; 	
				}
			}
		}
	else
		{ if(this.logging) {log("Player in interstellar space"); }; }
	}