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

Expansion The Classic SuperPythons

Content

Warnings

  1. Unknown key 'upload_date' at https://wiki.alioth.net/img_auth.php/4/48/Classic_SuperPythons.oxz!manifest.plist

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description This expansion adds updated versions of Aegidian's Python Class Cruiser and the Python Eunectes Turbo. Suitable for Oolite v1.80 upwards with high resolution graphics and updated code. This expansion adds updated versions of Aegidian's Python Class Cruiser and the Python Eunectes Turbo. Suitable for Oolite v1.80 upwards with high resolution graphics and updated code.
Identifier oolite.oxp.smivs.classicSuperPythons oolite.oxp.smivs.classicSuperPythons
Title The Classic SuperPythons The Classic SuperPythons
Category Ships Ships
Author Smivs Smivs
Version 1.0 1.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Classic_Super-Pythons n/a
Download URL https://wiki.alioth.net/img_auth.php/4/48/Classic_SuperPythons.oxz n/a
License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
File Size n/a
Upload date 1610873290

Documentation

Also read http://wiki.alioth.net/index.php/The%20Classic%20SuperPythons

readMe.txt

The Classic SuperPythons

This expansion adds two large freighters to the game, the Python Class Cruiser and the Python Eunectes Turbo. These are updated versions of Aegidian's original ship OXPs. 
The graphics have been brought up to date and some of the coding (eg ship roles) has been brought in line with Oolite v1.80 and above. The original models have been used and new engine sub-entities have been added. The texture designs are firmly based on the originals and the specifications have remained unchanged from the old OXP versions.

This expansion forms part of The Classic Ships suite of OXPs, but is fully self-contained and can be installed by anyone - there are no dependancies on or requirement for any other 'Classic Ship' expansions to be installed.

Licence:-

This work is Licenced under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported Licence. 
To view a copy of this Licence, send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

Author and credits:-

The Classic Super-Pythons expansion was developed by Smivs. The main models, designs and specifications are based on the original OXPs by Giles Williams (Aegidian).

Equipment

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

Ships

Name
classicShipsEngine1
classicShipsEngine2
classicShipsEngine3
classicShipsGun
classic_python-cc
classic_python-cc-player
classic_python-cc_pirate
Python Class Cruiser
classic_python-et
classic_python-et_pirate
classic_python-et_player
Python-ET.

Models

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

Scripts

Path
Scripts/classicSuperPythonsScript.js
"use strict"; 

// Standard attributes 
this.name           = "classicSuperPythonsScript.js"; 
this.author         = "Smivs"; 
this.copyright	    = "© Smivs"; 
this.licence        = "Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License"; 
this.version        = "1.0"; 
this.description    = "Script to render ship derelict upon ejection of pilot, and to slightly shorten service intervals of PCC." 

//  - PCC only - reduce serviceLevel by 1 after approximately 50% of witchjumps to reflect higher frequency servicing requirements of older ships
this.shipExitedWitchspace = function()
{
  this.serviceIntervalVariable = Math.random();
  if(player.ship.name === "Python Class Cruiser" && serviceIntervalVariable < 0.6)
    {
      return;
    }
  if (player.ship.name === "Python Class Cruiser" && serviceIntervalVariable >= 0.6)
    {
      player.ship.serviceLevel = player.ship.serviceLevel -=1; 
    }
}
// Ship_going_derelict functions
this.shipLaunchedEscapePod = function()
{
  this.switchFlashersAITimer = new Timer(this, this.$switchFlashersOff,8); // timer to switch off flashers after 8 seconds
  this.switchHullTexTimer = new Timer(this, this.$switchHullTex,12); // timer to switch off hull lights emission map after 12 seconds
  this.rotateDerelictTimer = new Timer(this, this.$rotateDerelict,25); // timer to start derelict rotation after 25 seconds
  this.switchEngineTexTimer = new Timer(this, this.$switchEngineTex,35); // timer to switch engines textures to derelict version after 35 seconds
}
this.$switchFlashersOff = function()
{
  this.ship.lightsActive = false; // turns flashers off
}
this.$switchHullTex = function()
{
// use scriptInfo key to build ship's default texture names
  var $classicShipsTexture1 = this.ship.scriptInfo.classicShipsTexture1; 
  var $classicShipsTexture2 = this.ship.scriptInfo.classicShipsTexture2; 
  var $classicShipsTexture3 = this.ship.scriptInfo.classicShipsTexture3;
// use scriptInfo key to build ship's diffuse_map names
  var $classicShipsDiffuse1 = this.ship.scriptInfo.classicShipsDiffuse1; 
  var $classicShipsDiffuse2 = this.ship.scriptInfo.classicShipsDiffuse2;
  var $classicShipsDiffuse3 = this.ship.scriptInfo.classicShipsDiffuse3;
// use scriptInfo key to build ship's emission_map names
  var $classicShipsLighting1 = this.ship.scriptInfo.classicShipsLighting1;
  var $classicShipsLighting2 = this.ship.scriptInfo.classicShipsLighting2;
  var $classicShipsLighting3 = this.ship.scriptInfo.classicShipsLighting3;
// use scriptInfo key to build ship's normal_map names
  var $classicShipsNormal1 = this.ship.scriptInfo.classicShipsNormal1; 
  var $classicShipsNormal2 = this.ship.scriptInfo.classicShipsNormal2;
  var $classicShipsNormal3 = this.ship.scriptInfo.classicShipsNormal3;
// use scriptInfo key to build ship's specular_map names
  var $classicShipsSpecular1 = this.ship.scriptInfo.classicShipsSpecular1; 
  var $classicShipsSpecular2 = this.ship.scriptInfo.classicShipsSpecular2;
  var $classicShipsSpecular3 = this.ship.scriptInfo.classicShipsSpecular3;
// use scriptInfo key to build derelict emission_map names
  var $classicShipsDerelict = this.ship.scriptInfo.classicShipsDerelict;
// declare variables 
  var material1 = new Object(); 
  var material2 = new Object(); 
  var material3 = new Object(); 
// set up material entries
  material1[$classicShipsTexture1] = {diffuse_map:$classicShipsDiffuse1, emission_map:$classicShipsDerelict, normal_map:$classicShipsNormal1, specular_map:$classicShipsSpecular1}; 
  material2[$classicShipsTexture2] = {diffuse_map:$classicShipsDiffuse2, emission_map:$classicShipsDerelict, normal_map:$classicShipsNormal2, specular_map:$classicShipsSpecular2};
  material3[$classicShipsTexture3] = {diffuse_map:$classicShipsDiffuse3, emission_map:$classicShipsDerelict, normal_map:$classicShipsNormal3, specular_map:$classicShipsSpecular3};
// apply material
  this.ship.setMaterials(material1, material2, material3); 
}
this.$rotateDerelict = function()
{
  this.rotateVector = Vector3D.randomDirection(); // creates a random axis of rotation.
  this.rotateSpeedFactor = (Math.random() * (0.05) + 0.05); // creates a random rotate speed factor between 0.05 and 0.1 - 0.1 will result in a rotation speed of approx 1 full rotation every 63 seconds, 0.05 in a rotation speed of approx 1 full rotation every 126 seconds.
  this.rotateDerelictCallBack = addFrameCallback(this.rotateFunction.bind(this)); // create FrameCallback
}
this.rotateFunction = function(delta) // delta is the time in game seconds since the last frame.
{
  if (!this.ship.isValid){removeFrameCallback(this.rotateDerelictCallback);delete this.rotateDerelictCallback;return;} // end FrameCallback if ship has died;
  if (delta === 0){return;} // do nothing if game is paused;
  var newOrientation = this.ship.orientation.rotate(this.rotateVector,delta*this.rotateSpeedFactor); // calculates new orientation, using delta as a factor so that rotation speed is constant across varying frame rates. delta*this.rotateSpeedFactor is a value in radians. There are approx 6.3 radians in a full rotation.
  this.ship.orientation = newOrientation; // applies new orientation;
}
this.$switchEngineTex = function()
{
  var $onTexture; // declare variable
  var $offTexture; //declare variable
  var material = new Object(); // declare variable
  var subents = this.ship.subEntities; // create array of subents
  var counter = 0; // set up loop to check if subent is an engine and if so change texture to derelict version
  var subentsLength = subents.length;
  for (counter = 0; counter < subentsLength;counter++)
    {
      if (subents[counter].scriptInfo.engineOnTexture)
	{
	  $onTexture = subents[counter].scriptInfo.engineOnTexture; // uses scriptInfo key to build engine texture name
	  $offTexture = subents[counter].scriptInfo.engineOffTexture; // uses scriptInfo key to build derelict engine texture name
	  material[$onTexture] = {emission_map:$offTexture}; // set up material entry
	  subents[counter].setMaterials(material); // sets material
	}
    }
}
this.entityDestroyed = function()
// stop timers if ship is destroyed
{
  if(this.switchFlashersAITimer)
    {
      if (this.switchFlashersAITimer.isRunning) 
        {
          this.switchFlashersAITimer.stop();
          delete this.switchFlashersAITimer;
        }
     }
  if(this.switchHullTexTimer)
     {
       if (this.switchHullTexTimer.isRunning) 
         {
           this.switchHullTexTimer.stop();
           delete this.switchHullTexTimer;
         }
     }
  if(this.rotateDerelictTimer)
     {
       if (this.rotateDerelictTimer.isRunning) 
         {
           this.rotateDerelictTimer.stop();
           delete this.rotateDerelictTimer;
         }
      }
  if(this.switchEngineTexTimer)
     {
       if (this.switchEngineTexTimer.isRunning) 
         {
           this.switchEngineTexTimer.stop();
           delete this.switchEngineTexTimer;
         }
      }
}