Running the original version on Oolite v.1.77.1 on my AppleMac
The latest.log reads
Code: Select all
13:39:50.245 [script.javaScript.exception.notFunction] ReportJSError (OOJavaScriptEngine.m:198): ***** JavaScript exception (personalities 0.9): TypeError: system.systemNameForID is not a function
13:39:50.245 [script.javaScript.exception.notFunction] ReportJSError (OOJavaScriptEngine.m:209): /Users/accountname/Library/Application Support/Oolite/AddOns/Personalities.oxp/Scripts/personalities.js, line 41.
line 41 reads as follows:
Code: Select all
this.startUp = this.reset = function()
{
missionVariables.personalities_commander_name = expandDescription("[commander_name]");
missionVariables.personalities_systemname = system.systemNameForID(Math.floor(Math.random() * 256)); <-- Line 41
}
The entire js file reads
Code: Select all
/*
personalities.js
Script to make special personalities appear in the Ooniverse.
Oolite
Copyright © 2004-2009 Giles C Williams and contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
*/
this.name = "personalities";
this.author = "Commander McLane";
this.copyright = "� 2009 Commander McLane";
this.description = "Script for spawning of special personalities";
this.version = "0.9";
this.logging = false;
this.startUp = this.reset = function()
{
missionVariables.personalities_commander_name = expandDescription("[commander_name]");
missionVariables.personalities_systemname = system.systemNameForID(Math.floor(Math.random() * 256));
}
this.spawnPersonality = function()
{
system.legacy_addShips("personalities", 1);
delete this.waitUntilSpawn;
}
this.shipWillExitWitchspace = function()
{
if(system.isInterstellarSpace) return;
missionVariables.personalities_systemname = system.systemNameForID(Math.floor(Math.random() * 256));
if(system.countShipsWithRole("personalities") > 0) return;
if(galaxyNumber == 0 && system.ID == 147 && Math.random() < 0.5)
{
system.legacy_addShipsWithinRadius("personalities_daddyhoggy", 1, "wpu", [0, 0, ((Math.random() * 0.6) + 0.2)], 20000);
return;
}
this.personalitiesAppearance = Math.random();
if(this.personalitiesAppearance < 0.25)
{
this.waitUntilSpawn = new Timer(this, this.spawnPersonality, ((Math.random() * 7) + 5));
}
else if(this.personalitiesAppearance < 0.4)
{
system.legacy_addShips("personalities", 1);
}
else if(this.personalitiesAppearance < 0.65)
{
system.legacy_addShipsWithinRadius("personalities", 1, "wpu", [0, 0, ((Math.random() * 0.6) + 0.2)], 20000);
}
}
this.shipWillLaunchFromStation = function(station)
{
if(!station.isMainStation || system.countShipsWithRole("personalities") > 0) return;
if(galaxyNumber == 0 && system.ID == 147)
{
this.personalitiesAppearance = Math.random();
if(this.personalitiesAppearance < 0.3)
{
system.legacy_addSystemShips("personalities_daddyhoggy", 1, 1);
}
else if(this.personalitiesAppearance < 0.5)
{
system.legacy_addSystemShips("personalities_dh_launch_helper", 1, 1);
}
return;
}
this.personalitiesAppearance = Math.random();
if(this.personalitiesAppearance < 0.25)
{
system.legacy_addSystemShips("personalities_launch_helper", 1, 1);
}
else if(this.personalitiesAppearance < 0.5)
{
system.legacy_addSystemShips("personalities", 1, 1);
}
else if(this.personalitiesAppearance < 0.65)
{
system.legacy_addShipsWithinRadius("personalities", 1, "wpu", [0, 0, ((Math.random() * 0.6) + 0.2)], 20000);
}
}
this.shipWillDockWithStation = function()
{
if(this.hesperusCaptured)
{
player.addMessageToArrivalReport(expandDescription("[personalities-hesperus-captured]"));
player.credits += 132;
delete this.hesperusCaptured;
}
}
this.shipBeingAttacked = function(whom)
{
if(!whom) return;
if(whom.hasRole("personalities"))
{
whom.script.hitcounter--;
if(whom.script.hitcounter < 1)
{
whom.script.broadcastMessage("hitting");
whom.script.hitcounter = Math.ceil(Math.random() * 10) + 10;
}
}
}
this.shipDestroyedTarget = function(target)
{
if(target.hasRole("personalities") && !missionVariables.personalities_killed_name)
{
if(target.hasRole("personalities_privateer") && Math.random() < 0.5) return;
missionVariables.personalities_killed_name = target.scriptInfo.displayName;
}
}
this.alertConditionChanged = function(newCondition, oldCondition)
{
if(newCondition == 3 && oldCondition != 3)
{
system.shipsWithRole("personalities", player.ship, 25600).forEach(function(ship){ship.script.alertConditionChanged(newCondition, oldCondition)});
}
}
The wiki currently says this:
Static Methods
infoForSystem
...
systemIDForName
...
systemNameForID
function systemNameForID(systemID : Integer) : String
Returns the name of a system in the current galaxy based on the given ID number.
And back in 2009 it said exactly the same about "systemNameForID".
Can anybody help?