// *************************************************
// * N P C P H A N T O M *
// *************************************************
{
"hathor" =
{
ai_type = "stationAI.plist";
beacon = "H";
auto_ai = yes;
aft_eject_position = "0.0 13.0 0.0";
energy_recharge_rate = 4;
max_cargo = 2;
has_ecm = "true";
has_escape_pod = "true";
heat_insulation = 1.0;
has_scoop = "true";
name = "Hathor";
model = "2xhath.dat";
roles = "station hathtest";
thrust = 50;
smooth = "false";
subentities = {
"hathor_dock" = {
type = "standard";
// position = (-100.48, -138.99, -188.07);
is_dock = true;};
"hathor_power" = {
type = "standard";};
};
};
"hathor_dock" =
{
ai_type = "nullAI.plist";
name = "Hathor Dock";
model = "2xhathdock.dat";
// is_dock = true;
roles = "hath_dock";
};
"hathor_power" =
{
ai_type = "nullAI.plist";
name = "Hathor";
model = "2xhathpower.dat";
roles = "hath_power";
};
}
i banged that together from a current plist and cut/pasted Eric's subent info in Simon's Redux thread. i'm getting no syntax/log errors, but the station' genning up w/out the two subents. i've got a script to randomly place 6 of the dock subents and that works fine so it doesn't appear the models are buggered.
subentities =
(
{
subentity_key = "hathor_dock";
type = "standard";
// position = (-100.48, -138.99, -188.07);
is_dock = true;
},
{
subentity_key = "hathor_power";
type = "standard";
}
);
Each separate sub-entity is between curly brackets and identified by the subentity_key line, and overall the sub-entities are an array (surrounded by round brackets and comma separated with no trailing comma or semi-colon).
Hope that's clearer? If you want a reference look in the 1.75.2 or trunk shipdata.plist entry for the coriolis station.[/color]
Last edited by Thargoid on Wed Jun 08, 2011 8:15 pm, edited 1 time in total.
If I understand correctly, subentities is an array, not a dictionary.
Therefore it doesn't consist of entries with a name. Instead, the shipdata.plist key of the subentity has to be assigned to the subentity_key key inside the definition.
I think you also need to put everything with an underscore in it into quotation marks, and the elements of the array are separated by commas, not semicolons.
cheers all.
related to my other post about docking downa long tunnel, i was trying this to see where i'd get and how i could sort any probs. and i've found an odd one.
i genned up a station, using Thargoid's code, was fine. flew at the tunnel, died.
when i turned on bounding boxes, i had a red box indicating the dock : it's the exact dimensions of the dock.dat, but it's affixed to the underside of the actual tunnel model, therefore, from the front it looks like this :
<cac ascii art>
_
|_| <---- the actual dock model entrance _
|_| <---- the bounding box
</cac ascii art>
i flew at the bounding box, is through the wall of the station just below the tunnel mouth, and docked.
any thoughts? i've no "position" tags in the code.
ta for that, Cmdr McLane. i'll have a bit more play tonight if i have time.
i really REALLY like a better dock definition area for the game/code to make stuff easier, ie just define a dock area rather than having to have a subent, especially a sub ent that has to be made in one position and moved about to get it where you want.
especially a sub ent that has to be made in one position and moved about to get it where you want.
But isn't that the basic premise for every subentity? You create it as an independent entity and then move and rotate it to the correct position and orientation with regards to the main entity?
not for me, i model the ship as it should be and cut off the subents in place. building something elsewhere and having to put code in to move it about is ludicrous, to my mind, unless you're talking about multiple copies of one item like externally mounted missiles.
i really REALLY like a better dock definition area for the game/code to make stuff easier, ie just define a dock area rather than having to have a subent, especially a sub ent that has to be made in one position and moved about to get it where you want.
The early Oolite versions did it that way, without a dock as explicit subentity. The old way of defining a port_dimensions and port_radius is still supported in current oolite, albeit not as flexible as with a real subentity. e.g. you only can create docks at the positive z side of the station with it. And I doubt if this old method will be supported in future Oolite 2.0
That would be a shame, as you can do some tricks with it such as the dock on the Lave Academy station.
As for the other comment, doing it the current way also allows the same sub-entity to be used in multiple places (and multiple times) on a model. For example all 4 of the missiles on the external missile Cobra that Griff and I did were the same sub-ent, just repeated in different positions. Indeed the whole thing would be impossible to do if the sub-ents were made as off-centred models.