I have the latest and greatest version of Oolite (1.75.3). I am working on my own OXP. I am using railgun.oxp as a base (copy 'n paste and edit job).
Instead of spawning a railgun projectile I wish to spawn a missile, so I've edited the code to look like:
Code: Select all
this.missile = player.ship.spawnOne("rmb-intercept-missile");
if(!!this.missile){
player.consoleMessage("Intercept Missile Spawned OK.", 2);
}else{
player.consoleMessage("NOT Spawned !!!!!!!!!!!!!!!!!!!!!!", 2);
}
Code: Select all
this.missile = player.ship.spawnOne("missile");
if(!!this.missile){
player.consoleMessage("Intercept Missile Spawned OK.", 2);
}else{
player.consoleMessage("NOT Spawned !!!!!!!!!!!!!!!!!!!!!!", 2);
}
This is not my first time at OXP scripting and yes I've read the Javascript manual entry for spawnOne (unfortunately the docco doesn't come with examples and I find the one line "function spawnOne(role : String) : Ship" not terribly helpful). I blatantly swiped the if(!!this.missile)... construct from a website as I want to do a NULL test (yes I can google); the language I work with on a day to day basis has a completely different way of checking for NULLs (var is null, if anyone is wondering).
Anybody any helpful suggestions?
Ta,
Lagrange