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

Expansion Cougar ST

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds the legendary ship found in some versions of 8 bit Elite. Adds the legendary ship found in some versions of 8 bit Elite.
Identifier oolite.oxp.captsolo.cougar_st1.5 oolite.oxp.captsolo.cougar_st1.5
Title Cougar ST Cougar ST
Category Ship Ship
Author CaptSolo CaptSolo
Version 1.5 1.5
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Cougar_ST_OXP n/a
Download URL https://wiki.alioth.net/img_auth.php/1/1a/Cougar_ST1.5.oxz n/a
License CC-BY-SA 3.0 CC-BY-SA 3.0
File Size n/a
Upload date 1610873240

Documentation

Also read http://wiki.alioth.net/index.php/Cougar%20ST

Cougar_St_ReadMe.txt

Cougar ST OXP by Captain Solo

Credits: 
Model modified from original, SimonB's Neolite Companion OXP for the Cat.
Paw decal borrowed from SimonB's Cat diffuse texture.
Main hull texture's, under-wing subent gun models and texturing, and Cougar AI by the author. 
Cougar Ship Script by Commander McLane, originally coded for Smivs' Contractor ZZ1.

Cougar Ship Roles:
1) Cougar ST custom hunter role. Approximately 20% chance of appearing in anarchy and feudal systems. Offender player beware.
2) Alternate Cougar with Oolite 1.80 roles: escort-medium pirate-medium-fighter pirate-interceptor pirate-aegis-raider assassin-medium.
3) Player Cougar.

Play Testers: 
Cody and the author 

Requirements:
Minimum requirement is Oolite 1.80. No dependencies.

Manual Installation:
Move or copy the file, "Cougar_ST1.5.oxz" into your AddOns folder. Where that resides depends on the location of your Oolite installation. 

License:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 3.0.

Version 1.5 changes:
Fixed errors in shipdata.plist

Equipment

This expansion declares no equipment.

Ships

Name
Cougar
Cougar Subent
Cougar
Cougar Subent
Cougar ST
Cougar ST
Cougar ST

Models

This expansion declares no models.

Scripts

Path
Scripts/cougar-ship-script.js
/*

cougar-ship-script.js

Ship script for the Cougar Bounty Hunter.


Oolite
Copyright © 2004-2010 Giles C Williams and contributors

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.


cbh.oxp
Copyright � 2010 "Smivs"

This work is licensed under the Creative Commons
Attribution-Noncommercial-Share Alike 3.0 Unported License.

To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.

*/

"use strict";
this.name			= "cougar-ship-script.js";
this.author			= "Commander McLane";
this.copyright		= "� 2009 Commander McLane";
this.license		= "CC-by-nc-sa 3.0";
this.description	= "Scan script for the Cougar Bounty Hunter";
this.version		= "5.0";

this.shipDied = function(who, cause)
{
	log("cougar-ship-script", "The Cougar ST was killed by "+who+" because of "+cause);
}
this.$scanForPrey = function()
{
	// log("cougar-ship-script", "Cougar ST scanning for prey.");
	// one scan for anything with a bounty should actually be enough, but just to be safe we also include the primary role of "pirate" as a criterion; note that ships like the renegade pirates (primary role "hardpirate") will not be found through their role
	// we use the JS function "system.filteredEntities", because there is no direct function for finding ships by bounty, like "system.shipsWithPrimaryRole" for primary role
	// "system.filteredEntities" calls a self-defined function, in this case "isOffender(entity)", which returns all entities that match the criteria specified behind the "return" command
	// the filtered (= found) entities are returned in an array, sorted by proximity; the closest is the first in the array
	function isOffender(entity)
	{
		// the entity must be a ship, have either a bounty or primary role "pirate",     must not be cloaked,      must not be a derelict           and must not be an asteroid (because
		//                                                                              (normal AI scans don't                                      asteroids have small bounties)
		//                                                                              find anything cloaked)
		return entity.isShip && (entity.bounty > 0 || entity.primaryRole == "pirate") && !entity.isCloaked && entity.scanClass !== "CLASS_CARGO" && entity.scanClass !== "CLASS_ROCK"
	}
	// the self-defined function is called and the result put in the variable "nextTarget"
	// the function has to filter and find all entities matching its criteria in a radius of 25600 meters around the calling ship, which equals the scanner range
	var nextTarget = system.filteredEntities(this, isOffender, this.ship, 25600);
	// if something was found, and the first element of the array is therefore not undefined..
	if(nextTarget[0])
	{
		// the found entity is made the current target...
		this.ship.target = nextTarget[0];
		// again the logging can be activated by deleting the leading "//" in the next line
		// log("cougar-ship-script", "Cougar found some scum. Attacking a " + this.ship.target.displayName + " with a bounty of " + this.ship.target.bounty + ".");
		// and the message "TARGET_FOUND" is sent to the Cougar's AI, which causes the methods connected with that message in the current AI state to be executed
		this.ship.reactToAIMessage("TARGET_FOUND");
	}
	// and this is the end of the scan
	// note that, if there is more than one pirate in the vicinity, the Cougar will always go after the closest ship
	// a more sophisticated algorithm for choosing among many targets could be devised, for instance attacking the one with the biggest bounty first
	// if nothing is found, the next scan will be performed in the next "UPDATE" of the AI
}
Scripts/spawncougar-script.js
// Standard attributes 
this.name           = "Spawn Cougar ST"; 
this.author         = "another_commander"; 
this.copyright      = "This script is hereby placed in the public domain."; 
this.version        = "1.15"; 
this.description    = "Script to occasionally add a Cougar ST."; 

this.shipWillExitWitchspace = function()
{
	if (system.government < 2 && Math.random() >= 0.80)
	{
		var hitship = system.addShipsToRoute("cougar_st", 1, 0.25, "wp");
	}
};