I've been playing around with a mission pack that utilitises the Black Box from cim's/spara's Rescue Stations. I've created my own custom shipdata entry for it, and can now happily spawn blackboxes to my hearts content. Here's the shipdata code for reference purposes:
Code:
"gcm-blackbox-template" = {
is_template = "yes";
ai_type = "nullAI.plist";
energy_recharge_rate = 1;
forward_weapon_type = "WEAPON_NONE";
heat_insulation = 0.3;
max_energy = 10;
max_flight_pitch = 0.5;
max_flight_roll = 0.5;
max_flight_speed = 0;
missiles = 0;
model = "gcm_blackbox.dat";
materials = {
"gcm_blackbox.png" = {
"diffuse_map" = "gcm_blackbox.png";
"emission_map" = "gcm_blackbox_emission.png";
"specular_map" = "gcm_blackbox_specular.png";
"normal_map" = "gcm_blackbox_normal.png";
"shininess" = "128";
};
};
name = "Black Box";
scan_class = "CLASS_CARGO";
thrust = 0;
weapon_energy = "0";
script_info = {
no_sc_config = 1;
};
subentities = (
{
type = "flasher";
color = { hue = 200; };
frequency = 0.1;
size = 7.5;
}
);
};
"gcm-blackbox" = {
like_ship = "gcm-blackbox-template";
cargo_type = "CARGO_CARRIED";
cargo_carried = "1 machinery";
roles = "gcm_blackbox";
unpiloted = "yes";
};
I didn't realise that Oolite keeps a track of the data key of scooped objects, because I discovered if I scoop my black box, and then eject it again, the original model is respawned, not a standard cargo container. That's really cool!
But here's the thing: there is no "shipSpawned" event in this case. I've just spent the last two hours trying to work out why my code for detecting when the player ejects cargo (using the "shipSpawned" event) wasn't working, and the reason was, the event wasn't being called at all. This is in 1.82.
I took my code to 1.83, added the new "shipDumpedCargo" event and now I could see my blackbox being spawned. But still the "shipSpawned" event didn't fire.
So I think this is a bug, but I'd appreciate any pointers if I've messed something up somewhere.