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

Expansion Imperial Astrofactory

Content

Warnings

  1. http://wiki.alioth.net/index.php/Imperial%20Astrofactory -> 404 Not Found
  2. Description mismatch between OXP Manifest and Expansion Manager string length at character position 0
  3. Information URL mismatch between OXP Manifest and Expansion Manager string length at character position 0

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description
Identifier oolite.oxp.spara.ImperialAstrofactory oolite.oxp.spara.ImperialAstrofactory
Title Imperial Astrofactory Imperial Astrofactory
Category Dockables Dockables
Author spara, phkb, gsagostinho spara, phkb, gsagostinho
Version 2.4 2.4
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL n/a
Download URL https://wiki.alioth.net/img_auth.php/a/a9/Astrofactory.oxz n/a
License CC-BY-SA 3.0 CC-BY-SA 3.0
File Size n/a
Upload date 1610873406

Documentation

imperial_astrofactory_readme_&_license.txt

Imperial Astrofactory OXP ver 2.4 (17-10-2017)

Author: spara (Mika Spåra)

_Description_

This oxp Griffifies the Astrofactory station from Dictators oxp by Ramirez.

It works as a standalone station or if Dictators oxp is installed substitutes the old astrostation.

_Credits_

Original model and textures by Ramirez. New rock texture, normalmap and custom shader by Griff. Dome texture, other normalmaps and emissions by spara.

_Install_

Install the OXP by copying Audible_docking_clearance.oxp to your AddOns-folder.

------

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/

2.4
- Corrected more errors in shipdata.plist.

2.3
- Corrected errors in shipdata.plist.
- Changed category to "Dockables" rather than "Ships".

2.2 update by gsagostinho
- new textures, including new asteroid normal map
- uses new logo, matching the new textures of Dictators version 2.1
- added Astrofactory to the Ship Library

2.1 update by phkb
- Updated shipdata.plist to use newer subentity definitions.
- Added manifest.plist file
- Packaged as OXZ

Equipment

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

Ships

Name
Imperial AstroFactory
dfl_factorydock

Models

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

Scripts

Path
Config/script.js
"use strict";
this.name = "dfl_imperial_astrofactory";
this.author = "Spara";
this.copyright = "2013 Mika Spåra";
this.licence     = "CC BY-NC-SA 3.0";
this.description = "Add astrofactory to dictatorship systems";
this.version = "2.1";

this.startUp = function() {
	if (worldScripts["dictators.js"]) {
		delete this.systemWillPopulate;
	}
}

this.systemWillPopulate = function() {
	if (system.government === 3 && system.economy < 3 && system.countShipsWithRole("astrofactory") === 0) {
		if (worldScripts.station_validator && (worldScripts.station_validator.$deaths("astrofactory").length !== 0)) return;
		system.addShipsToRoute("astrofactory", 1, 0.3 , "wp");
		system.addShipsToRoute("asteroid", 30, 0.3 , "wp");
	}
}
Scripts/dfl_astrofactory_market.js
"use strict";
this.name = "dfl_astrofactory_market";
this.author = "spara";
this.copyright = "2014 spara";
this.license     = "CC BY-NC-SA 4.0";

this.$originalDefs = {
      "food" : [0, 0, 19, -2, 0, 1, 1, 1, 0],
      "textiles" : [0, 0, 12, -1, -1, 5, 3, 3, 0],
      "radioactives" : [0, 0, 65, -3, -3, 2, 7, 7, 0],
      "slaves" : [0, 0, 100, -1, -1, 10, 3, 3, 0],
      "liquor_wines" : [0, 0, 93, -5, -5, 251, 15, 15, 0],
      "luxuries" : [0, 0, 196, 8, 8, 2, 3, 3, 0],
      "narcotics" : [0, 0, 235, 29, 29, 8, 90, 90, 0],
      "computers" : [0, 0, 134, 14, 14, 90, 2, 1, 0],
      "machinery" : [0, 0, 98, 6, 6, 100, 2, 1, 0],
      "alloys" : [0, 0, 90, 1, 1, 2, 31, 31, 0],
      "firearms" : [0, 0, 100, 13, 13, 0, 0, 0, 0],
      "furs" : [0, 0, 20, -9, -9, 0, -1, -1, 0],
      "minerals" : [0, 0, 42, -1, -1, 12, 3, 3, 0],
      "gold" : [0, 0, 107, -1, -1, 5, 20, 20, 1],
      "platinum" : [0, 0, 191, -2, -2, 5, 21, 21, 1],
      "gem_stones" : [0, 0, 55, -1, -1, 250, 15, 15, 2],
      "alien_items" : [0, 0, 10, 0, 0, 0, 0, 0, 0]
};

this.updateLocalCommodityDefinition = function(goodDefinition) {
	var commodity = goodDefinition.key;
	var oldDefs = this.$originalDefs[commodity];
	//old style definition found for the good. calculate it the old way
	if (oldDefs) {
		var market_base_price = oldDefs[2];
		var market_eco_adjust_price = oldDefs[3];
		var market_eco_adjust_quantity = oldDefs[4];
		var market_base_quantity = oldDefs[5];
		var market_mask_price = oldDefs[6];
		var market_mask_quantity = oldDefs[7];
		var market_rnd = Math.floor(Math.random() * 256);

		var economy = system.economy;

		var price = (market_base_price + (market_rnd & market_mask_price) + (economy * market_eco_adjust_price)) & 255;
		price *= 0.4;

		var quantity = (market_base_quantity + (market_rnd & market_mask_quantity) - (economy * market_eco_adjust_quantity)) & 255;
		if (quantity > 127) quantity = 0;
		quantity &= 63;

		goodDefinition.price = price * 10;
		goodDefinition.quantity = quantity;
	}
	//no definition found. nullify the goods.
	else {
		goodDefinition.price = 0;
		goodDefinition.quantity = 0;
	}
	return goodDefinition;
};