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

Expansion Cargo Wrecks Teaser

Content

Warnings

  1. License not specified
  2. XML script list found
  3. Unknown key 'licence' at https://wiki.alioth.net/img_auth.php/d/d1/Cargo_wrecks_teaser_1.7.2.oxz!manifest.plist

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds diffent models of cargopods to the universe Adds diffent models of cargopods to the universe
Identifier oolite.oxp.ArexackHeretic.CargoWreck oolite.oxp.ArexackHeretic.CargoWreck
Title Cargo Wrecks Teaser Cargo Wrecks Teaser
Category Ambience Ambience
Author Arexack Heretic Arexack Heretic
Version 1.7.2 1.7.2
Tags Cargopods Cargopods
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Cargo_Wreck_Teaser_OXP n/a
Download URL https://wiki.alioth.net/img_auth.php/d/d1/Cargo_wrecks_teaser_1.7.2.oxz n/a
License
File Size n/a
Upload date 1610873478

Documentation

Also read http://wiki.alioth.net/index.php/Cargo%20Wrecks%20Teaser

readmeifyouplease_wrex.txt

Wrex-teaser2 OXP.

Created by Arexack as part of an ongoing project to insert greater variety into the wonderfull Ooniverse. 
These files are part of the game Oolite and are subject to the Creative Commons Licence.
(Or whatever licence the Oolite comunity operates under at this point)

Contains new cargopods, fuelpods and other riches to be 'found' in the depths of space.
To use this OXP, unzip this package (or for mac users: drag/drop the folder named "Cargo_wrecks_teaser.oxp") into your C:/../Oolite/Addons/ folder



Changelog:
Revised: August 1 2006 
-explosiveAI.plist fixed and altered. (thanks Ahruman)
-texturenames fixed.
-Shipdata slightly altered to include a small_debris model.

Version 1.2: 
august 11 2006
-Fixed several bugs and typo's. 
-Included descriptions that were missing from v1.1
-added treasuroid easteregg.
March 22 2007
-Note: on OOsat2 the version is pre-v1, check the wiki for recent versions.
-Changed cargo_type of treasuroid in shiplist to RANDOM.

Version 1.3: 
27 september 2007
-In v1.2 shipdata was somehow moved to topfolder, replaced in config.
-fixed typo in descriptions.plist. (thanks Eric!) 
-altered script.plist to be functional instead of a test script, 
  -treasuroid is now ingame. Including comms-messages.
-Added extra code to scripted pods to check for player. (thanks Eric!)
-removed dependency on nubarrel.dat from Aegidian's X-ships.OXP.
-switched to consolemessage. yay! :D
-Altered AI, then changed it differently. more comms too.
-treasuroids still not working properly.

version 1.3.1
5 oktober 2007
-added lots of special-cargo descriptions.
-Some changes to explosiveAI, fixed capital CommsMessage typo.
todo: 
-treasuroids are still spawned without cargo inside.
-Free_missile pod not able to check/compare player.missiles and playership.max_missiles. 
 When possible change to check and award 1TC firearms if no pylons are available.

Version 1.3.2
15 may 2008
-fixed bugs in weaponpods (thanks Eric Walch/Cmdr James)
-model name barrel_AH.dat to barrel_ah.dat.
-dysfunctional CARGO_FIREARMS changed to CARGO_CARRIED.
-added 0.1 chance of gem-pirapod spawning.
-some custom messages were not using hardcoded 'wildcards' properly "[%i1] cargo" (hoopy)
-added new descriptions to fix this. [i1]+[i2]+[i3]+[i4] = [species] 
-added some more descriptions. 
-added [special-trumble].  
-added trumblepod
 todo: borrow model for trumblepod from Aegidian.

Version 1.3.3
22 august 2008
-fixed messages of fuelpods (since oolite 1.71 normal canisters can't broadcast messages in the old way). Did it by explicit adding a pilot (character) to the pods. With this fix it will work both on 1.65 and 1.72+ Oolite

Version 1.3.4
27 august 2008
-fixed code for red fuelpod scooped by NPC ship. (rare event)
-changed explosiveAI script-name to a less obvious name to prevent possible name conflicts
-"Quirium" now spells correct.
-Changed "[d100_number] lessthan 75" into d100_number lessthan 75. (2 locations in shipdata.plist)

Version 1.4
14 april 2009
-replaced the script_action in shipdate.plist by js scripts with similar function. This made it easier to randomise quantities. script_action  now will only be used when running Oolite 1.65. Newer Oolites will use the js barrel scripts. NB most barrels in this oxp don't use scripts at all.
-trumblepod model now borrowed from aegidian. It only will give trumbles when the player has in the past bought the trumbles from the original trumble offer. It won't spoil this internal "mission" by giving trumbles first.
-renamed several files to more unique names to avoid future name conflicts. e.g. all descriptions start now with "ah_"

Version 1.5
8 october 2009
- Changed the way cargo is added in accordance to the new rules for Oolite versions after 1.73.

Version 1.5.1
11 october 2009
- Changed all quantity definitions in script_info from string into number.

Version 1.5.2
17 october 2009
- added extra roles for specific cargo. e.g. goldpod, alienpod firearmspod etc, to be used by external oxp's.

version 1.5.3
21 october 2009
- merged the two line messages into one single line. e.g. "1 ton of grapes scooped." instead of  "1 ton of grapes" + "cargopod scooped.". This only works with the newer Oolite versions after 1.70. For old Oolite 1.65 the old messages remain.

version 1.6.0
10 february 2010
- Added specular/shiny maps to all barrels to get selective surface reflection.

version 1.6.2
29 May 2010
- Version adapted to new scripting in Oolite 1.74. When used with this Oolite version, the scripted barrels stay in game after scooping (like the normal barrels always did)

version 1.6.3
5 Oktober 2010
- Changed some roles of scripted barrels from "cargopod" into "commodity". This allows Oolite to select those pods that match the availability at the local marked instead of just a random one.

version 1.6.4
9 January 2011
- Changed "System" to "system" in scripts so it will work after Oolite 1.74.2

version 1.6.5
31 January 2011
- The trumblepod did not show its scoop messages when fur was scooped.

version 1.7
11 February 2012
- Raised minimum Oolite to 1.74.
- Removed old code no longer needed.
- Converted XML plists to open-step.
- Added a 'cargopod(0)' role to all cargo for other scripts to check.
- Colliding with the fuelpod without scooping is now dangerous.

version 1.7.1
7 October 2012
- Changed a few strings that will give problems after Oolite 1.76

version 1.7.2
23 November 2012
- Found another string in shipdata that won't work correctly with Oolite 1.77

Equipment

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

Ships

Name
alien_cargo2_ah
Alien cargo
Metal fragment
Cargo container
Cargo container
container_blue
container_green
Cargo container
emptypod_type1
emptypod_type2
Cargo cannister
Cargo cannister
Cargo crate
Cargo container
foodpod_type5
foodpod_type6
foodpod_type7
Fuel cannister
fuelpod2_ah
Cargopod
Cargo crate
Shiny cargopod
Cargo Cannister
Secure Container
Cargo Container
Cargo container
hexapod_b
hexapod_c
Cargo crate
Cargo crate
Cargo crate
Cargo crate
Cargo crate
Container
Trigonal Container
Container
Cargopod
Cargo container
Cargo container
Cargo container
Cargo container
Red crate
Green crate
Blue crate
small_debris_ah
trumblepod_ah
Cargo crate
Cargo Container
Cargo Container
Cargo Container
Cargo Container

Models

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

Scripts

Path
Scripts/cargoWreckBarrel.js
"use strict";
this.name			= "cargoWreckBarrel";
this.author			= "Arexack Heretic (oxp) & Eric Walch (js script)";
this.copyright		= "Share alike";
this.description    = "Code for a generic pod";
this.version		= "1.7.2";


/* 
    "this.shipSpawned" is in rare occasions skipped in Oolite 1.73 or older, because in some occasions
    the splinter is scooped before the this.shipSpawned is triggered. (This could for example happen when
    the player rams the target to death and barrels fly directly into the scoop.
    But, once scooped, "this.shipSpawned" will never trigger again! (fixed in Oolite 1.74)
    Initialising on scooping now, to also have less code to execute during the explosion itself.
*/
this.initialise = function ()
{
    this.message = this.ship.scriptInfo.message;
    this.cargotype = this.ship.scriptInfo.cargotype;
    this.quantity = parseInt(this.ship.scriptInfo.quantity);
    // use parseInt for open step plists or you will be awarding wrong quantities.
    if (isNaN(this.quantity)) {this.quantity = 1; log(this.name, "Detected a NaN quantity for: "+this.cargotype)};
    if (this.quantity < 0) this.quantity = Math.ceil(Math.random()*(-this.quantity));
    if (this.quantity > 1) this.message = this.message.replace("gram ", "grams ");
    if (this.quantity > 0 && this.cargotype) this.ship.setCargo(this.cargotype, this.quantity);
    this.message = this.quantity + " " + expandDescription(this.message);
    this.init = true;
};


this.shipWasScooped = function (scooper)
{
    if (!this.init) this.initialise();
    if (scooper.isPlayer)
    {
        player.consoleMessage(this.message);
    }
};
Scripts/cargoWreckFuel.js
"use strict";
this.name			= "cargoWreckFuel";
this.author			= "Arexack Heretic (oxp) & Eric Walch (js script)";
this.copyright		= "Share alike";
this.description	= "fuel pod";
this.version		= "1.7";

this.shipDied = function ()
{
    delete this.shipDied;
    this.ship.AIState = "EXPLODE"; // make sure the ship explodes with doing damage, even when collided or shot at.
}


this.shipWasScooped = function (scooper)
{
     var hasFuel = this.ship.scriptInfo.awardFuel;
     if (hasFuel === "NO") hasFuel = false; // test needed in case the code is in open-step plist. "NO" is interpreted as true by js.
     
     if (scooper.isPlayer)
	 {
		if (hasFuel)
		{
			if(player.ship.fuel <= 6)
			{
				player.ship.fuel += 1;
				player.consoleMessage("1.0 LY Fuel Transfered!");
			}
			else
			{
				var fuel = Math.round(70 - player.ship.fuel*10)/10;
				player.consoleMessage(fuel+" LY Fuel Transfered!");
				player.ship.fuel += fuel;
			}
		}
		else
		{
			player.ship.fuel += 1;
			player.consoleMessage("FuelPod Failure!");
			player.ship.fuelLeakRate = 2.5;
		}
	 }
	 else  // NPC ship scooped pod
	 {
		if (hasFuel)
		{
			scooper.fuel += 1;
		}
		else
		{
			// scooper becomes a q-bomb when scooping up a bad fuelpod.
			scooper.commsMessage(expandDescription("[ah_last-words]"));
			scooper.switchAI("explosiveCWreckAI.plist");
			scooper.AIState = "DETONATE";
		}
	}
}
Scripts/cargoWreckMissile.js
"use strict";
this.name			= "cargoWreckMissile";
this.author			= "Arexack Heretic (oxp) & Eric Walch (js script)";
this.copyright		= "Share alike";
this.description	= "firearms pod";
this.version		= "1.7";


this.shipWasScooped = function (scooper)
{
    if (scooper.missiles.length < scooper.missileCapacity)
    {
        var missile = Math.random()>0.1 ? "EQ_MISSILE" : "EQ_HARDENED_MISSILE";
        scooper.awardEquipment(missile);
        this.ship.displayName = "A free missile";
    }
    else
    {
        // no check for free storage as scooping success already means there was 1 ton of free cargo space.
        this.ship.setCargo("firearms");
    }
     delete this.shipWasScooped; // we don't want to run this script again when it is scooped a second time.
}

this.shipDied = function ()
{
	delete this.shipDied; // prefent recursion.
    this.ship.switchAI("missileAI.plist");
	this.ship.AIState = "DETONATE";
}
Scripts/cargoWreckTeaser.js
/*

cargoWreckTeaser
Copyright © 2006-2009 Arexack Heretic 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.

For a copy of the GNU General Public License write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

*/


"use strict";
this.name			= "Cargo_Wreck_Teaser";
this.author			= "Arexack Heretic (oxp) & Eric Walch (js script)";
this.copyright		= "Share alike";
this.description	= "WorldScript for cargo_wreck_teaser";
this.version		= "1.7.1";

this.shipExitedWitchspace = function ()
{
    if(!system.isInterstellarSpace && system.government < 4 && Math.random() < 0.15 && system.countShipsWithPrimaryRole("rockhermit") > 1)
    {
        this.addPirateStash();
    }
}

this.addPirateStash = function ()
{
    /*
    Just transform a plain asteroid into a stash. This avoids the problem of the treasuroid
    being completely different than other asteroids when asteroid replacing oxps are used.
    */
    var stash = system.addGroupToRoute("asteroid", 9).ships[0];
    stash.displayName = "Treasuroid";
    stash.setScript("cargoWreckTreasuroid.js");
}
Scripts/cargoWreckTreasuroid.js
"use strict";
this.name			= "cargoWreckTreasuroid";
this.author			= "Arexack Heretic (oxp) & Eric Walch (js script)";
this.copyright		= "Share alike";
this.description	= "Treasuroid asteroid";
this.version		= "1.7";
// this script is attached to a selected asteroid by the worldScript.


this.shipDied = function ()
{
    var stashGroup = new ShipGroup("Treasuroid Group");
    var asteroids = this.ship.group.ships;
    for (var i = 0; i<asteroids.length; i++)
    {
        var pirate = asteroids[i].spawnOne("pirate");
        stashGroup.addShip(pirate);
        pirate.group = stashGroup;
        
        if (asteroids[i] == this.ship)
        {
            pirate.commsMessage(expandDescription("[ah_stash-message]"));
        }
        else
        {
            asteroids[i].explode(true);
        }
    }
	delete this.shipDied;
}
Scripts/cargoWreckTrumble.js
"use strict";
this.name			= "cargoWreckTrumble";
this.author			= "Arexack Heretic (oxp) & Eric Walch (js script)";
this.copyright		= "Share alike";
this.description	= "trumble pod";
this.version		= "1.7.2";


this.shipWasScooped = function (scooper)
{
	 if (!this.message) this.message = expandDescription("1 ton [ah_trumble-furs]")
	 if (scooper.isPlayer)
	 {
		// only give player trumbles when he already did the trumblemission in the past.
        if (missionVariables.trumbles === "TRUMBLE_BOUGHT" && (Math.random() < 0.25 || player.trumbleCount > 0))
		{
            if (player.trumbleCount === 0)
			{
				scooper.awardEquipment("EQ_TRUMBLE");
				player.consoleMessage(this.message);
			}
			else
			{
				if (player.trumbleCount === 1) player.consoleMessage("Your trumble is exited about a scooped friend.", 6);
				else player.consoleMessage("Your trumbles are exited about a scooped mate.", 6);
			}
		}
		else
		{
            player.consoleMessage(this.message);
            this.ship.setCargo("furs");
		}
	 }
     else // scooped by npc
     {
        this.ship.setCargo("furs");
     }
     //delete this.shipWasScooped;
}