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

Expansion Imperial Astrofactory

Content

Warnings

  1. http://wiki.alioth.net/index.php/Imperial%20Astrofactory -> 404 Not Found
  2. Low hanging fuit: Information URL exists...
  3. Description 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.5.1 2.5.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL https://wiki.alioth.net/index.php/Imperial_AstroFactory n/a
Download URL https://wiki.alioth.net/img_auth.php/a/ad/AstroFactory_2.5.oxz n/a
License CC-BY-SA 3.0 CC-BY-SA 3.0
File Size n/a
Upload date 1716769823

Documentation

imperial_astrofactory_readme_&_license.txt

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

Author: spara (Mika Spåra)

_Description_

This oxp Griffifies the Astrofactory station from Dictators oxp by Ramirez. Also adds the missing AstroFarm station.

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

_Credits_

Original model and textures by Ramirez. Dome texture, other normalmaps and emissions by spara.

_Install_

Install the OXP by copying Imperial_AstroFactory.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/

Solar panel: https://www.freepik.com/free-psd/solar-power-boards-3d-realistic-render_27548594.htm Image by godesign3d on Freepik
Rock texture 1: https://www.freepik.com/free-photo/stone-texture-background_1120405.htm Image by kues1 on Freepik
Rock texture 2: https://www.freepik.com/free-photo/stone-texture_1033837.htm Image by kues1 on Freepik

2.5.1
- Small tweaks to shipdata and shipdata-overrides files.

2.5
- Switched to using the default Oolite shaders. Raised minimum Oolite version to 1.90.
- Added specular maps to all models.
- Updated asteroid texture.
- Added missing AstroFarm.
- Independent populator now allows for saving the game at AstroFactories and AstroFarms.
- Independent populator now positions AstroFactories in the same location as Dictators.
- Moved "Imperial Lictor" from Dictators to this OXP.
- Split the Lictor into two roles, one for "Imperial" dictatorships and one for "Revolutionary" dictatorships.

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
dfl_astro_template
Imperial AstroFactory
dfl_astrofactory2
Revolutionary AstroFarm
dfl_astrofarm2
dfl_factorydock
dfl_factorydock
dfl_factorydock
dfl_factorydock
dfl_solarpanel
Imperial Lictor
imp_police_lictor
Revolutionary Lictor
rev_police_lictor

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.license = "CC BY-NC-SA 3.0";
this.description = "Add astrofactory and astrofarm to dictatorship systems";

//-------------------------------------------------------------------------------------------------------------
this.startUp = function() {
	if (worldScripts["dictators.js"]) {
		delete this.systemWillPopulate;
	}
	if (worldScripts.StationDockControl) {
		var sdc = worldScripts.StationDockControl;
		sdc._shipFits["Revolutionary AstroFarm|Serpent Class Cruiser"] = 0;
		sdc._shipFits["Revolutionary AstroFarm|Hornet"] = 0;
		sdc._shipFits["Revolutionary AstroFarm|Anaconda"] = 0;
		sdc._shipFits["Revolutionary AstroFarm|Boa Class Cruiser"] = 0;
		sdc._shipFits["Revolutionary AstroFarm|Boa"] = 0;
		sdc._shipFits["Revolutionary AstroFarm|Cobra Mark IV"] = 0;
		sdc._trafficLow.push("astrofarm");
	}
}

//-------------------------------------------------------------------------------------------------------------
this.systemWillPopulate = function() {
	if (system.government != 3) return;
	var sv = worldScripts.station_validator;
	if (system.economy < 3 && system.countShipsWithRole("astrofactory") === 0) {
		if (sv && (sv.$deaths("dfl_astrofactory").length !== 0 || sv.$deaths("dfl_astrofactory2").length !== 0)) return;
		var posAF = Vector3D((system.scrambledPseudoRandomNumber(1245) * 0.30 - 0.15), (system.scrambledPseudoRandomNumber(3827) * 0.30 - 0.15), 0.3).fromCoordinateSystem("wpu");
		system.setPopulator("dictators_astrofactory", {
			location: "COORDINATES",
			coordinates: posAF,
			deterministic:true,
			callback: function(pos) {
				var rck = system.addShips("asteroid", 30, pos, 40E3);
				var key = "dfl_astrofactory";
				if (system.techLevel >= 10) key = "dfl_astrofactory2";
				var af = system.addShips("[" + key + "]", 1, pos, 0);
				if (!af || af.length === 0) log("astrofactory.populator", "OOPS! No astrofactory spawned");
			}}
		);
	}
	if (system.economy > 4 && system.countShipsWithRole("astrofarm") === 0) {
		if (sv && (sv.$deaths("dfl_astrofarm").length !== 0 && sv.$deaths("dfl_astrofarm2").length !== 0)) return;
		var posAFM = Vector3D((system.scrambledPseudoRandomNumber(2271) * 0.30 - 0.15), (system.scrambledPseudoRandomNumber(772) * 0.30 - 0.15), 0.3).fromCoordinateSystem("spu");
		system.setPopulator("dictators_astrofarm", {
			location: "COORDINATES",
			coordinates: posAFM,
			deterministic:true,
			callback: function(pos) {
				var key = "dfl_astrofarm";
				if (system.techLevel >= 6) key = "dfl_astrofarm2";
				var af = system.addShips("[" + key + "]", 1, pos, 0);
				if (!af || af.length === 0) 
					log("astrofarm.populator", "OOPS! No astrofarm spawned");
				else 
					worldScripts.dfl_imperial_astrofactory.turnStationToEntity(af[0], system.sun, -1.5, 0, 1); // get solar panel to face sun
			}}
		);
	}
}

//-------------------------------------------------------------------------------------------------------------
this.turnStationToEntity = function (station, entity, x, y, z) {
	var targetVector = entity.position.subtract(station.position).direction();
	station.orientation = targetVector.rotationTo([(!x ? 0 : x), (!y ? 0 : y), (!z ? 1 : z)]);
}
Scripts/dfl_conditions.js
"use strict";
this.name        = "AstroFactory_Conditions";
this.author      = "phkb";
this.copyright   = "2024 phkb";
this.description = "Condition script for ships and equipment.";
this.licence     = "CC BY-NC-SA 3.0";

//-------------------------------------------------------------------------------------------------------------
this.allowSpawnShip = function(shipKey) {
	if (system.government !== 3) return false;
	switch (shipKey) {
		case "dfl_astrofactory":
        case "dfl_astrofactory2":
		case "imp_lictor":
            if (system.economy < 3) return true;
            break;
        case "dfl_astrofarm":
        case "dfl_astrofarm2":
        case "rev_lictor":
            if (system.economy > 4) return true;
            break;
        case "imp_police_lictor":
			if (worldScripts["dictators.js"] && worldScripts["dictators.js"]._settings.policeShipReplace == false) return false;
            if (system.economy < 3) return true;
            break;
        case "rev_police_lictor":
			if (worldScripts["dictators.js"] && worldScripts["dictators.js"]._settings.policeShipReplace == false) return false;
            if (system.economy > 4) return true;
            break;
	}
	return false;
}