Applying Multiple Scripts to an NPC ship
Posted: Mon Sep 30, 2013 4:59 am
Hi,
I'm back to playing and attempting to mod Oolite after a hiatus caused by hectic family life. I downloaded version 1.77 over the weekend and liked a lot of what I've seen, especially some of the newer OXPs that make use of the ability to change market prices and the change to the use of the accuracy property.
One thing that is confusing me for a little OXP I'm writing is whether you can assign multiple Javascript files as script files to a NPC ship and if so how do you do that. I know that I can add multiple Javascript files to the world-scripts.plist to contain handlers for world events and that this will work for the player's ship because all events raised on the player ship are also raised as world events, however what I want to do is add events to NPC ships on shipSpawned to handle the new shipBountyChanged event.
As I read it I can add a single Javascript file containing the event handlers to the ship.script property. However I also have Griff's Alloys and Wreckage installed on my system and that is adding it's own Javascript handler for NPC ship events. I'd like to co-exist peacefully and have been trying to figure out how to do it.
Any illumination would be appreciated.
I'm back to playing and attempting to mod Oolite after a hiatus caused by hectic family life. I downloaded version 1.77 over the weekend and liked a lot of what I've seen, especially some of the newer OXPs that make use of the ability to change market prices and the change to the use of the accuracy property.
One thing that is confusing me for a little OXP I'm writing is whether you can assign multiple Javascript files as script files to a NPC ship and if so how do you do that. I know that I can add multiple Javascript files to the world-scripts.plist to contain handlers for world events and that this will work for the player's ship because all events raised on the player ship are also raised as world events, however what I want to do is add events to NPC ships on shipSpawned to handle the new shipBountyChanged event.
As I read it I can add a single Javascript file containing the event handlers to the ship.script property. However I also have Griff's Alloys and Wreckage installed on my system and that is adding it's own Javascript handler for NPC ship events. I'd like to co-exist peacefully and have been trying to figure out how to do it.
Any illumination would be appreciated.