Cholmondely wrote: ↑Thu May 22, 2025 9:46 pm
DGill wrote: ↑Thu May 22, 2025 9:17 pm
Unlikely to be Library
probably an error in feudal_mission.js or possibly planetfall 2.0 does not recognise gal 7 & 8.
If I get a chance I'll have a look
Hunh! I'd finally worked up my Jameson so that I could pledge my fealty! And now, back to being on ice. Humph!
The issue can be corrected by either of two methods:
1. Alter the script.js in Feudal_PlanetFall2.oxp
Replace line 65 with:
Code: Select all
if ((galaxyNumber == 0 && system.techLevel >= 7) || (galaxyNumber == 1 && system.techLevel >= 5) || (galaxyNumber == 2 && system.techLevel >= 7) || (galaxyNumber == 4 && system.techLevel >= 7) || (galaxyNumber == 5 && system.techLevel >= 8) || (galaxyNumber == 6 && system.techLevel >= 7) || (galaxyNumber == 7 && system.techLevel >= 7)) {
The disadvantage with this method is that it amends planetfall 2 files which I wanted to avoid.
2. Alter the feudal-mission.js file in Feudal_States_Extended.oxp
add at line 167:
Code: Select all
if (worldScripts["feudal-planetfall.js"]) {
pf.$addPrepopulationFunction("feudal-planetfall.js", "extraPopulation");
if (this.debug) log(this.name, "Monkey-patching shipWillEnterWitchspace, shipWillLaunchFromStation, and shipWillExitWitchspace functions of Feudal states PlanetFall script");
var f = worldScripts["feudal-planetfall.js"];
delete f.shipWillLaunchFromStation;
delete f.shipWillExitWitchspace;
f.extraPopulation = this.feudalstates_extraPopulation;
f.shipWillEnterWitchspace = this.feudalstates_shipWillEnterWitchspace;
}
add at original line 170 (i.e. before the function this.startUpComplete = function() { )
Code: Select all
this.feudalstates_extraPopulation = function () {
if (system.government == 1 && worldScripts.PlanetFall2) {
if ((galaxyNumber == 6 && system.techLevel >= 7) || (galaxyNumber == 7 && system.techLevel >= 7)) {
var pf = worldScripts.PlanetFall2;
var key = galaxyNumber + " " + system.ID;
// if we have a full custom setup, don't use the override method
if (pf._locationOverrides[key]) return;
worldScripts.PlanetFall2.planetFallOverride = true; // set the override, so only external OXP locations appear
}
}
}
This method is better as it does not alter planetfall 2 files - but I have not tested it for unexpected issues.