Code: Select all
JavaScript exception (oolite-populator 1.81): TypeError: lead is null
There is no crash or obvious in-game problem.
Moderators: winston, another_commander, Getafix
Code: Select all
JavaScript exception (oolite-populator 1.81): TypeError: lead is null
Code: Select all
Ship.keysForRole("pirate");
Ship.keysForRole("pirate-light-freighter");
Ship.keysForRole("pirate-medium-freighter");
Ship.keysForRole("pirate-heavy-freighter");
Code: Select all
log(this.name,Ship.keysForRole("pirate").toSource());
log(this.name,Ship.keysForRole("pirate-light-freighter").toSource());
log(this.name,Ship.keysForRole("pirate-medium-freighter").toSource());
log(this.name,Ship.keysForRole("pirate-heavy-freighter").toSource());
startUp
will do.Code: Select all
["gecko", "python", "cobra3-pirate", "ferdelance", "mamba", "adder", "moray", "cobramk1", "cobramk1-alt", "sidewinder", "krait"]
["cobra3-alternate", "python", "moray", "cobramk1-alt"]
["cobra3-alternate", "boa-pirate", "python-blackdog"]
["boa-pirate", "boa-mk2-pirate", "anaconda-pirate", "python-blackdog"]
Code: Select all
0:29:09.616 [IST_masterScript]: ["eagle2", "cobramk1", "ferdelance3Pirate", "mw-asp", "sidewinder", "anaconda", "adck_eagle_two_a", "cobra3M2-pirate", "adck_eagle_two_b", "adck_eagle_two_c", "adck_eagle_two_d", "adck_eagle_two_e", "adck_eagle_two_f", "adck_eagle_two_g", "cobra3M2-alternate", "ferdelance3+T_HardPiratePoliceDecomissioned", "ringhals", "adck_eagle_three_a", "adck_eagle_three_b", "adck_eagle_three_c", "adck_eagle_three_d", "adck_eagle_three_e", "adck_eagle_three_f", "adck_eagle_three_g", "kraitM2", "staer9_cobra2x", "drake", "staer9_iguana", "ferdelance2a", "cobramk1M2", "ferdelance2f", "pythonM2-blackdog", "kirin-xm", "cobra3-trader", "ferdelance2t", "drakemk2", "python-blackdog", "mamba-escort", "ferdelance3+HardPirate", "staer9_sidewinder-x", "reduxvampirate", "purgwolftrader", "werewolftrader", "viper3-renegade", "adck_eagle_one", "staer9_python-cruiser", "aphid-re2dux", "reduxmk1vampirate", "ferdelance3PirateKing", "mussurana", "rogue-frigate", "dragon-an", "cobra3-pirate", "aspmk1", "morayM2", "staer9_python-x", "xarik", "blackcobra4", "cobramk1-alt", "reduxmark1goldvampirate", "reduxpurgvampirate", "asp", "adder", "wolfmk2M2", "impcourier", "moray", "superSidewinderPirate", "cobra4", "superSidewinderHarderPirate", "morayMED", "pythonM2", "mambaM2", "geckoM2", "adck_eagle_four", "excalibur-pirate", "Falcon", "adck_eagle_two", "wolfmk2SE", "ferdelanceM2", "basilisk", "asp_explorer", "krait", "hydra1", "hydra2", "cobra3rapier-pirate", "rhs_mark_gecko_shipset", "smivsShieldTail", "dragon-se", "sbwolf-re2dux", "ferdelance", "gecko", "smivsPurpleHaze", "staer9_cat", "cobra3-alternate", "Kestrel", "ferdelance3PirateVariant", "adck_imp_trader", "cobra3courier", "sidewinderM2", "ferdelance3HardPirateVariant", "rattle", "remorse_of_conscience_pirate", "aspM2", "Falcon-E", "Falcon-S", "ferdelance3HardPirate", "mamba", "paladin-pirate", "cobra3rapier", "sidewinder-escort", "boa", "staer9_mw-asp", "wolfmk2-alt", "python-trader", "adck_eagle_four_a", "adck_eagle_four_b", "adck_eagle_four_c", "adck_eagle_four_d", "adck_eagle_four_e", "adck_eagle_four_f", "adck_eagle_four_g", "python", "dragon-m", "cividom", "adck_wyvern_explorer-pirate", "worm_missionary03", "cobra3courier-pirate", "adck_eagle_three", "kirin-cv", "adck_imp_courier-pirate", "adck_eagle_one_a", "adck_eagle_one_b", "adck_eagle_one_c", "adck_eagle_one_d", "adck_eagle_one_e", "python-cruiser", "adck_eagle_one_f", "adck_eagle_one_g", "adck_imp_trader-pirate", "ferdelance3+T_HardPirate", "boa-mk2", "anarchies-renegade_viper", "copperhead-pirate", "impcourier-navy", "staer9_mussurana", "phoenix-pirate", "civipurg", "cobramk1M2-alt", "wolfmk1", "wolfmk2"]
00:29:09.616 [IST_masterScript]: ["rhs_big_boss_vamppurg_spacelane_shipset", "rhs_big_boss_iguana_spacelane_shipset", "rhs_big_boss_cobra4_spacelane_shipset", "rhs_big_boss_supercobra_spacelane_shipset", "rhs_big_boss_pitviper_spacelane_shipset", "rhs_big_boss_impcourier_spacelane_shipset", "rhs_big_boss_wolfmk2SE_spacelane_shipset"]
00:29:09.616 [IST_masterScript]: ["boa-pirate", "rhs_mark_pythonet_shipset", "rhs_mark_python_shipset"]
00:29:09.616 [IST_masterScript]: ["boa-pirate", "anaconda-pirate", "rhs_mark_pythonet_shipset", "rhs_mark_imptrader_shipset", "rhs_mark_pcc_shipset", "rhs_big_boss_imptrader_spacelane_shipset", "rhs_mark_python_shipset", "boa-mk2-pirate"]
Code: Select all
00:32:31.246 [IST_masterScript]: ["rhs_mark_gecko_shipset", "hydra1", "hydra2", "ferdelance", "adder", "krait", "cobramk1", "basilisk", "kirin-xm", "moray", "smivsPurpleHaze", "sbwolf-re2dux", "cobramk1-alt", "cobra3-pirate", "rattle", "gecko", "sidewinder", "kirin-cv", "mamba", "python", "smivsShieldTail", "aphid-re2dux"]
00:32:31.247 [IST_masterScript]: ["rhs_big_boss_wolfmk2SE_spacelane_shipset", "rhs_big_boss_impcourier_spacelane_shipset", "moray", "rhs_big_boss_vamppurg_spacelane_shipset", "cobramk1-alt", "cobra3-alternate", "rhs_big_boss_supercobra_spacelane_shipset", "rhs_big_boss_iguana_spacelane_shipset", "rhs_big_boss_pitviper_spacelane_shipset", "rhs_big_boss_cobra4_spacelane_shipset", "python"]
00:32:31.247 [IST_masterScript]: ["rhs_mark_pythonet_shipset", "python-blackdog", "boa-pirate", "rhs_mark_python_shipset", "cobra3-alternate"]
00:32:31.247 [IST_masterScript]: ["rhs_mark_pcc_shipset", "rhs_mark_pythonet_shipset", "python-blackdog", "boa-pirate", "anaconda-pirate", "rhs_mark_python_shipset", "rhs_big_boss_imptrader_spacelane_shipset", "boa-mk2-pirate", "rhs_mark_imptrader_shipset"]
If you're using the nightly builds, you can skip that step, as they come with the Debug OXP anyway.UK_Eliter wrote:Debug OXP for Oolite 1.77.1'
cim wrote:What are you doing within the IS populator?
Code: Select all
/*
=============================
OVERVIEW OF HOW THE SCRIPT WORKS
Ordered by event, in time order.
=============================
(1) this.shipWillLaunchFromStation [Oolite event handler]
On, only, the *first* run of this routine, my code does various things including making array of any OXP worldscripts that contain populator scripts and an array of any that contain repopulator scripts.
(2) this.playerWillEnterWitchspace [Oolite event handler]
If in INTERSTELLAR space, then decide the following, to be acted upon on later:
Will we tweak the jump?
If yes, will we do the new or the modified scenario?
If we will do the modified scenario, determine which type (onlyBugs, onlyNavy, extraNavy) of it we will do.
(3) this.interstellarTweaks_customInterstellarPopulator [Setup via planetinfo.plist. Runs immediately before this.shipWillExitWitchspace.]
If doing tweak of the 'modified' type - or indeed doing no tweak at all - then run all worldscipts and inbuilt populators that would normally run. Or rather do so under certain conditions . .
If doing tweak of the 'new type', run none of the above populators.
NB: My code does no population, strictly defined, i.e. does not use 'system.setPopulator'. That is because it seems feasible (at least while few expansion packs use that method) only to remove various ships - and, after that, add ships - later on.
(4) this.shipWillExitWitchspace [Oolite event handler]
If in NORMAL space, then - sometimes - do various things . .
If in INTERSTELLAR space, start a timer ('this.interstellarPostWillExit_Timer') to run routine 'this.$interstellarWillExitTimed'.
(I have this on a timer because one thing that the routine does is to move the player and moving the player immediately crashes Oolite - or at least Oolite < 1.79.)
(5) this.$interstellarWillExitTimed [my timed routine]
If in INTERSTELLAR space, actually start to implement the various tweaks.
In case of all tweaks save extraNavy, this involves clearing (or parially clearing) space, moving the player (temporarily in all cases except newScenario) and populating it
(6) this.shipExitedWitchspace [Oolite event handler]
If doing any modification except extraNavy, set a timer (this.timerForReturnEtc) which will run a routine (this.returnEtcTimed) described below.
(Have this on timer in order to (1) have something closer to the final word on population, (2 ) keep player away from changes until they are finished.)
(7) this.returnEtcTimed [my timed routine]
Does any final clearing, and - except for when doing the newScenario, returns the player.
There is also
(8) this.interstellarTweaks_customInterstellarRePopulator [Setup via planetinfo.plist. Runs every 20 seconds in interstellar space.]
This sometimes adds various ships directly, and sometimes runs both Oolite's inbuilt interstellar repopulator and OXP interstellar repopulators.
*/
Thanks cim.cim wrote:If you add logging to each function to note when it's called, presumably the error occurs between steps 3 and 4? Are you definitely calling the IS populators of the other worldscripts, and not their normal ones?
Okay, that's interesting. It makes much more sense as a place for the error, but Interstellar Tweaks doesn't change the normal system populator at all, does it? Might be worth doing the usual OXP-halving test since it might not be your OXP at all that's doing this.UK_Eliter wrote:The problem occurs - when it does occur, which is about half the time - after my script's this.startUp and before this.shipWillLaunchFromStation. And it occurs irrespective of whether I load a saved ship file or not.