- corrects the ids for the commodities Liquior&Wines and Alien Items, so those commodities will load into HyperCargo;
- added some log messages so the log shows some of what is happening in HyperCargo.
If anybody has trouble understanding diff's output (diff -Nur <original dir> <modified dir>) drop me a PM
Code: Select all
diff -Nur hyperCargo_1.10.orig/Config/script.js hyperCargo_mods/Config/script.js
--- hyperCargo_1.10.orig/Config/script.js 2012-11-25 21:21:58.000000000 -0200
+++ hyperCargo_mods/Config/script.js 2020-02-09 20:27:19.000000000 -0300
@@ -1,13 +1,13 @@
-this.name = "HyperCargo";
-this.author = "Thargoid";
+this.name = "HyperCargo";
+this.author = "Thargoid";
this.copyright = "Creative Commons: attribution, non-commercial, sharealike with clauses - see readme.txt";
this.description = "Cargo space compression";
this.version = "1.10";
this.startUp = function()
{
- this.cargoNameArray = ["food", "textiles", "radioactives", "slaves", "liquor/wines", "luxuries", "narcotics", "computers", "machinery", "alloys", "firearms", "furs", "minerals", "alien items"];
- this.cargoDisplayNameArray = ["Food", "Textiles", "Radioactives", "Slaves", "Liquor & Wines", "Luxuries", "Narcotics", "Computers", "Machinery", "Alloys", "Firearms", "Furs", "Minerals", "Alien Items"];
+ this.cargoNameArray = ["food", "textiles", "radioactives", "slaves", "liquor_wines", "luxuries", "narcotics", "computers", "machinery", "alloys", "firearms", "furs", "minerals", "alien_items"];
+ this.cargoDisplayNameArray = ["Food", "Textiles", "Radioactives", "Slaves", "Liquor/Wines", "Luxuries", "Narcotics", "Computers", "Machinery", "Alloys", "Firearms", "Furs", "Minerals", "Alien Items"];
this.storedArray = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]; // the array of stored cargo amounts (don't store gold, platinum or gems)
this.defaultCommodities = [
[ "Food", 0, 0, 19, -2, -2, 6, 1, 1, 0 ],
@@ -37,6 +37,7 @@
if(!missionVariables.hyperCargoMemory || missionVariables.hyperCargoMemory == "EMPTY")
{ // if this is the first run of the OXP, or if there is nothing in storage from the last save game we don't need to restore anything
+ log(this.name, "HyperCargo System empty");
missionVariables.hyperCargoMemory = "EMPTY";
return;
}
@@ -45,7 +46,10 @@
let setupCounter = 0 ; // reset the counter
for(setupCounter = 0;setupCounter<14;setupCounter++)
- { this.storedArray[setupCounter] *= 1; } // to swap value from string to number
+ {
+ log(this.name, "HyperCargo has " + this.storedArray[setupCounter] + "t of " + this.cargoNameArray[setupCounter]);
+ this.storedArray[setupCounter] *= 1; // to swap value from string to number
+ }
}
this.checkNCVersion = function()
@@ -83,6 +87,7 @@
for(cargoCounter = 0;cargoCounter<14;cargoCounter++)
{
this.cargoItem = this.cargoNameArray[cargoCounter];
+ log(this.name, "unloading "+String(this.storedArray[cargoCounter]) + "t of " + this.cargoItem);
manifest[this.cargoItem] += this.storedArray[cargoCounter];
this.storedArray[cargoCounter] = 0;
}
@@ -108,6 +113,7 @@
var price = Math.floor(((commodity[3]+(Math.floor(256*system.scrambledPseudoRandomNumber(23))&commodity[7])+(system.economy*commodity[4]))&255) * 0.4);
this.cargoItem = this.cargoNameArray[cargoCounter];
this.subTotal += this.storedArray[cargoCounter] * price;
+ log(this.name, "Transfering "+ String(this.storedArray[cargoCounter]) + "t of " + this.cargoItem + "for Cr" + String(this.storedArray[cargoCounter] * price));
this.storedArray[cargoCounter] = 0;
}
@@ -146,6 +152,7 @@
{
this.cargoItem = this.cargoNameArray[loadCounter];
this.storedArray[loadCounter] = manifest[this.cargoItem];
+ log(this.name, "Loading "+ String(manifest[this.cargoItem]) + "t of " + this.cargoItem);
missionVariables.hyperCargoMemory = missionVariables.hyperCargoMemory + manifest[this.cargoItem] + ":";
manifest[this.cargoItem] = 0;
}