Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion Teretrurus

Content

Warnings

  1. License not specified

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description the Teretrurus is a chopped Cobra MkIII, available with two colourful paint-jobs, the Purple Haze and the Shield-Tail. Both are player-buyable, and will appear as NPCs from time to time. the Teretrurus is a chopped Cobra MkIII, available with two colourful paint-jobs, the Purple Haze and the Shield-Tail. Both are player-buyable, and will appear as NPCs from time to time.
Identifier oolite.oxp.smivs.teretrurus oolite.oxp.smivs.teretrurus
Title Teretrurus Teretrurus
Category Ships Ships
Author Smivs Smivs
Version 3.0 3.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Teretrurus_Mk.I n/a
Download URL https://wiki.alioth.net/img_auth.php/8/89/Teretrurus_v3.0.oxz n/a
License
File Size n/a
Upload date 1610873355

Documentation

Also read http://wiki.alioth.net/index.php/Teretrurus

Teretrurus v3.0 readme

Teretrurus v3.0 ReadMe

An update of Dr Nil's Teretrurus Mk.1 OXP.

The Teretrurus is a 'chopped' Cobra Mk III and is available in two styles, The 'Purple Haze' and the 'Shield Tail'. They are identical except for their brash and shiny paintjobs. Both are player-buyable and they also feature in-game occassionally in variouis roles. 

This is a major revision of this expansion. Version 3.0 adds player-buyable Fuel Scoops which were absent before, and brings further improvements to the graphics. Several significant under-the-hood improvements have also been made to tidy up the OXZ.

If an NPC is severely damaged in battle and the pilot ejects the ship will progressively become derelict. The ship loses power and the navigation strobes will stop, then the lights and engine glow fade, and finally the derelict is left gently tumbling in space. 

The original models have been retained and the ships are unchanged from the original spec's in the Wiki, other than some detail changes for Oolite v1.80. 
The code has been updated from XML to openStep and some minor tweaks have been made to shipdata to ensure compliance with Oolite v1.80 such as expanding the 'roles' set. A few detail changes have also been made to ensure the OXP is balanced, and is consistant with the Wiki page.
Shipdata 'Accuracy' has been set to 6 so the pilots will be better than average, but not too lethal.

OXP compiled and developed by Smivs
Original OXP by Dr Nil
Scripting based on an original script by Capt. Murphy
Thanks also to Spara, for suggesting I did this!

Licence:- Creative Commons Attribution - Non-Commercial - Share Alike 4.0 license

Version requirements:- Requires Oolite v1.80

Equipment

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

Ships

Name
smivsPurpleHaze-player
smivsPurpleHaze_npc
smivsShieldTail-player
smivsShieldTail_npc
Teretrurus

Models

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

Scripts

Path
Scripts/smivsTeretrurusScript.js
"use strict"; 

// Standard attributes 
this.name           = "smivsTeretrurusScript.js"; 
this.author         = "Smivs"; 
this.copyright	    = "© Smivs"; 
this.licence        = "Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License"; 
this.version        = "3.0"; 
this.description    = "Script to render ship derelict upon ejection of pilot." 


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 secondsnds
}
this.$switchFlashersOff = function()
{
  this.ship.lightsActive = false; // turns flashers off
}
this.$switchHullTex = function()
{
  var $smivsTeretrurusTexture = this.ship.scriptInfo.smivsTeretrurusTexture; // uses scriptInfo key to build ship's default texture name
  var $smivsTeretrurusDiffuse = this.ship.scriptInfo.smivsTeretrurusDiffuse; // uses scriptInfo key to build ship's diffuse_map name
  var $smivsTeretrurusLighting = this.ship.scriptInfo.smivsTeretrurusLighting; // uses scriptInfo key to build ship's emission_map name
  var $smivsTeretrurusDerelict = this.ship.scriptInfo.smivsTeretrurusDerelict; // uses scriptInfo key to build derelict emission_map name
  var $smivsTeretrurusNormal = this.ship.scriptInfo.smivsTeretrurusNormal; // uses scriptInfo key to build ship's normal_map name
  var $smivsTeretrurusSpecular = this.ship.scriptInfo.smivsTeretrurusSpecular; // uses scriptInfo key to build ship's specular_map name
  var material = new Object(); // declare variable
  material[$smivsTeretrurusTexture] = {diffuse_map:$smivsTeretrurusDiffuse, emission_map:$smivsTeretrurusDerelict, normal_map:$smivsTeretrurusNormal, specular_map:$smivsTeretrurusSpecular}; // set up material entry
  this.ship.setMaterials(material); // apply material
}
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 is 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.entityDestroyed = function()
// stop timers
{
  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;
         }
      }
}