Code: Select all
P = player
PS = player.ship
S = system
M = missionVariables
This was installed as part of the development release. You can add your own (like W = worldScripts) but make sure you back up this file. Any customizations will get overwritten by the next time you install a dev release.
Or, in your oxp's startUp or startUpComplete functions, you can just add
Code: Select all
console.script.W = worldScripts.Mining_Scanner_Upgrade;
You can paste a new function definition into the debug console, say you added a bunch of log statements to see what's happening. Just replace the 'this' at the start of the function with 'worldScripts.my_oxps_name'. So, given you have 'W' defined that way, you type 'W' into the debug console, paste everything after the 'this' and hit Enter! Clear as mud, huh? Suppose you have:
Code: Select all
this.$identifyRocks = function(){
//firstly check if the scanner is damaged or simply not there for some reason
if (player.ship.equipmentStatus("EQ_NS_MINING_SCANNER_UPGRADE") !=="EQUIPMENT_OK"){return;}
var $rocks; //an variable to hold an array masquerading as a rock grader
.....
}
Code: Select all
.$identifyRocks = function(){
//firstly check if the scanner is damaged or simply not there for some reason
if (player.ship.equipmentStatus("EQ_NS_MINING_SCANNER_UPGRADE") !=="EQUIPMENT_OK"){return;}
var $rocks; //an variable to hold an array masquerading as a rock grader
.....
}
BTW, the '$' or '_' prefix on variable/function names doesn't apply for variables inside your functions - sorry I wasn't clear on that. So
var rocks;
would be fine.EDIT: check out this topic, "Hints and tips for using the debug console":
https://bb.oolite.space/viewtopic.php?f=4&t=12030