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

Expansion Constitution Class Heavy Cruiser Fix

Content

Warnings

  1. Unknown key 'requires_oxp' at https://wiki.alioth.net/img_auth.php/9/9c/Oolite.oxp.zzz.Montana05.GalTech_constitution_class_heavy_cruiser_Fix_V051.OXZ!manifest.plist

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Update of Constitution Class Heavy Cruiser: Fixes problems and adjusts to later Oolite versions Update of Constitution Class Heavy Cruiser: Fixes problems and adjusts to later Oolite versions
Identifier oolite.oxp.zzz.Montana05.GalTech_constitution_class_heavy_cruiser_Fix oolite.oxp.zzz.Montana05.GalTech_constitution_class_heavy_cruiser_Fix
Title Constitution Class Heavy Cruiser Fix Constitution Class Heavy Cruiser Fix
Category Ships Ships
Author Montana05 Montana05
Version 0.51 0.51
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://aegidian.org/bb/viewtopic.php?f=2&p=271897#p271897 n/a
Download URL https://wiki.alioth.net/img_auth.php/9/9c/Oolite.oxp.zzz.Montana05.GalTech_constitution_class_heavy_cruiser_Fix_V051.OXZ n/a
License CC BY-NC-SA 4.0 CC BY-NC-SA 4.0
File Size n/a
Upload date 1610873391

Documentation

Also read http://wiki.alioth.net/index.php/Constitution%20Class%20Heavy%20Cruiser%20Fix

read_me.txt

Overview
========

Shipbuilders Constitution Class Heavy Cruiser is based on the Constitution-class Refit of Star Trek.
Further information's of the original ship could be found at https://memory-alpha.fandom.com/wiki/Constitution_class

This package is fixing some bugs, upgrades to features from later versions of Oolite and, inspired by Shipbuilders original
message "Whilst you are free (and encouraged) to re-use any of the scripting, models or texturing in this OXP", includes some
new features, all of them to be removed if Shipbuilder disagrees.

Fixes
=====

changed "rear_weapon_type" to "aft_weapon_type" (shipdata.plist)

included the missing "exhaust", following the Star Trek design (shipdata.plist)

included "explosive_shrapnel" which is used in "death_actions" but not part of the OXP (shipdata.plist)

relocated some flashers and used "colors = " instead of "color = "  (shipdata.plist)

added shiplibrary.pist to replace the obsolete demoships.plist

some small modifications at the model

Upgrades
========

changed fore lasers to "multiply" to be similar to the Star Trek concept (shipdata.plist)

changed "death_actions" to a ship-script:
The scrip is handling messages, death actions (including escape pods), and some new features

included a normal map and modified the diffuse map slightly to work better with the normal map (and to fix some problems)

included "gloss"

New Features
============

As mentioned above this are not part of the original OXP and will be removed if Shipbuilder disagrees:

added 2x port and 2x starboard weapons (same as in the Star Trek movies NPC's hardly use them)

based on Star Trek individual names for the ships (script)

based on Star Trek ranks for rescued crew members (script)

assigned GalTech escape pods to the ships (a bit redesigned to fit Starfleet)

included Class-G Shuttlecrafts to be spawned if the ship is destroyed 
The shuttles are based on the Diamond Shuttles from liners.OXP and act as the next generation of Class F Shuttlecrafts
(Star Trek). More information's could be found here: https://memory-alpha.fandom.com/wiki/Class_F_shuttlecraft

Credits
=======

original work and escape pods: Shipbuilder
Class-G Shuttlecraft: Thargoid and P.A.Groove (Diamond Shuttle, liners.OXP): 
cargo container: amah (concept) and Griff (model & original diffuse map)

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

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

V 0.51:
included "burning quirium fuel" to the ship explosions, part of Montanas Resource Pack 01 OXP (new feature)
outsourced "explosive_shrapnel" to Montanas Resource Pack 01 OXP
added another version of cargo container (new feature)
changed the assignment of cargo containers (new feature)

Equipment

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

Ships

Name
Class-G Shuttlecraft
GalTech_ufp_container_computers
UFP escape pod

Models

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

Scripts

Path
Scripts/GalTech_constitution_class.js
this.name			= "GalTech_constitution_class";
this.author			= "Montana05";
this.description	= "event handler for constitution class heavy cruiser OXP";
this.version		= "0.51";
this.copyright		= "2020 Montana05";
this.licence   		= "CC BY-NC-SA 4.0";
"use strict";

this.shipSpawned = function(ship)
{
	this.$GalTech_shipType = this.ship.dataKey;
	this.$GalTech_msgCount = 0;
	var $GalTech_shipID = " ";
	
	// individual names based on constitution class ships from Star Trek (new feature, will be removed if Shipbuilder disagrees)
	if(this.$GalTech_shipType === "constitutionclassheavycruiser")
	{
		this.$GalTech_constitution_class_name_Array = 
		["Exeter", "Essex", "Excalibur", "Lexington", "Yorktown", "Endeavor", "El Dorado", "Excelsior", "Saratoga", "Constellation", "Hornet", "Wasp", "Hood", "Lafayette", "Defiant", "Republic", "Kongo", "Enterprise", "Valiant", "Intrepid"];
		var $GalTech_constitution_class_name = $GalTech_constitution_class_name_Array[Math.floor(Math.random() * $GalTech_constitution_class_name_Array.length)];

		this.$GalTech_constitution_class_number_Array = 
		["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"];
		var $GalTech_constitution_class_number = $GalTech_constitution_class_number_Array[Math.floor(Math.random() * $GalTech_constitution_class_number_Array.length)];

		$GalTech_shipID = " " + $GalTech_constitution_class_name + " " + $GalTech_constitution_class_number;

		// if the ship got no cargo some containers are added (new feature, will be removed if Shipbuilder disagrees)
		if(this.ship.cargoSpaceUsed === 0)
		{	
			// likely_cargo = 6, cargo_carried = computers
			var dice = this.$getRndInteger(4, 8);
			this.ship.adjustCargo("computers", dice);	
		};
	};	
	
	// individual number prefixes for shuttles based on the registration system from Star Trek (new feature, will be removed if Shipbuilder disagrees)
	if(this.$GalTech_shipType === "GalTech_shuttlecraft_class_G")
	{
		$GalTech_shipID = " NCC-" + this.$getRndInteger(1000, 9999) + "/G-SC";
	};
	
	if(this.$GalTech_shipType === "GalTech_ufp_escape_pod")
	{ 
		var dice = this.$getRndInteger(1, 100);
		var $GalTech_fleetRank = " ";
		
		// adds ranks to the crew and identifies them as starfleet members (new feature, will be removed if Shipbuilder disagrees)
		if(dice >= 95)
		{
			this.$GalTech_constitution_class_ranks01_Array = ["Lt. Commander", "Commander", "Space Captain"];
			$GalTech_fleetRank = $GalTech_constitution_class_ranks01_Array[Math.floor(Math.random() * $GalTech_constitution_class_ranks01_Array.length)];
		};

		if(dice >= 85 && dice < 95)
		{
			this.$GalTech_constitution_class_ranks02_Array = ["Ensign", "Space Junior Lieutenant", "Space Lieutenant"];
			$GalTech_fleetRank = $GalTech_constitution_class_ranks02_Array[Math.floor(Math.random() * $GalTech_constitution_class_ranks02_Array.length)];
		};

		if(dice >= 70 && dice < 85)
		{
			this.$GalTech_constitution_class_ranks03_Array = ["Petty Officer 1st Class", "Chief Petty Officer", "Snr. Chief Petty Officer", "Master Chief Petty Officer"];
			$GalTech_fleetRank = $GalTech_constitution_class_ranks03_Array[Math.floor(Math.random() * $GalTech_constitution_class_ranks03_Array.length)];
		};

		if(dice < 70)
		{
			this.$GalTech_constitution_class_ranks04_Array = ["Crewman 3rd Class", "Crewman 2nd Class", "Crewman 1st Class", "Petty Officer 3rd Class", "Petty Officer 2nd Class"];
			$GalTech_fleetRank = $GalTech_constitution_class_ranks04_Array[Math.floor(Math.random() * $GalTech_constitution_class_ranks04_Array.length)];
		};

		var $GalTech_crewName = ($GalTech_fleetRank + " " + expandDescription("[nom]"));

		this.ship.setCrew
		(
			{
				name: $GalTech_crewName,
				short_description: "a crew member of a UFP starfleet ship",
				role: "police"
			}
		);
				
		// individual number prefixes for pods based on the registration system from Star Trek (new feature, will be removed if Shipbuilder disagrees)
		$GalTech_shipID = " NCC-" + this.$getRndInteger(10000, 99999) + "/EP-01";
	};

	this.ship.displayName = this.ship.name + $GalTech_shipID;
};


this.shipBeingAttacked = function(whom)
{
	// death messages adjusted to max 2 messages when being attacked 
	if(this.$GalTech_shipType === "constitutionclassheavycruiser" && this.$GalTech_msgCount < 2)
	{
		this.ship.commsMessage(expandDescription("[constitutionclassheavycruiser-plea]"), player.ship);
		this.$GalTech_msgCount += 1;
	}
	else return;	
};

this.shipDied = function(whom, why)
{
	var debrisCount = 0;
	
	if(this.$GalTech_shipType === "constitutionclassheavycruiser")
	{
		// added death message to synchronize with original OXP
		this.ship.commsMessage("This is the Captain, matter/antimatter reactor unrepairable damaged, all crew abandon ship"), player.ship;
		
		// added explosive shrapnels to support death actions
		debrisCount = this.$getRndInteger(4, 8);
		system.addShips("GalTech_effects_explosive_shrapnel", debrisCount, this.ship.position);

		// added burning fuel (new feature, will be removed if Shipbuilder disagrees)
		debrisCount = (this.ship.fuel.toFixed(0)) * 2;	
		system.addShips("GalTech_effects_burningFuel", debrisCount, this.ship.position);

		// ejects cargopods (new feature, will be removed if Shipbuilder disagrees)
		debrisCount = this.ship.cargoSpaceUsed;
		while(debrisCount > 0)
		{
			this.ship.ejectSpecificItem("GalTech_ufp_container_computers");
			debrisCount = debrisCount - 1;
		};

		// launches 2 - 4 shuttlecrafts (new feature, will be removed if Shipbuilder disagrees)
		debrisCount = this.$getRndInteger(2, 4);
		system.addShips("GalTech_shuttlecraft_class_G", debrisCount, this.ship.position);

		// launches 4 - 6 escape pods (synchronize with original OXP)
		debrisCount = this.$getRndInteger(4, 6);
		system.addShips("GalTech_ufp_escape_pod", debrisCount, this.ship.position);
	}

	if(this.$GalTech_shipType === "GalTech_shuttlecraft_class_G")
	{
		// added explosive shrapnels
		debrisCount = this.$getRndInteger(2, 4);
		system.addShips("GalTech_effects_explosive_shrapnel", debrisCount, this.ship.position);
	}
	else return;
};	

this.$getRndInteger = function(min, max)
{
	return Math.floor(Math.random() * (max - min + 1) ) + min;
};