Missing Subents

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Missing Subents

Post by Killer Wolf »

Okay, what's the obvious mistake here :

Code: Select all

//  *************************************************
//  *            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.

TIA.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Missing Subents

Post by Thargoid »

The syntax is wrong, and the list of subentites should be a comma-separated array rather than in curly brackets and separated by semi-colons.

Basically replace

Code: Select all

subentities = {
      "hathor_dock" = {
         type = "standard";
//         position = (-100.48, -138.99, -188.07);
         is_dock = true;};
      "hathor_power" = {
      type = "standard";};
      };
with

Code: Select all

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.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Re: Missing Subents

Post by Killer Wolf »

edit, you ninja'd me w/ a retype!
that worked, many thanks for the fast reply bud :-)
Last edited by Killer Wolf on Wed Jun 08, 2011 8:17 pm, edited 1 time in total.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Missing Subents

Post by Thargoid »

Sorry, revised my earlier post, as noticed the individual sub-entity entries are wrong in the array too. See my other post for the corrected version.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Missing Subents

Post by Commander McLane »

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.

Not this:

Code: Select all

	subentities = {
		"hathor_dock" = {
			type = "standard";
//			position = (-100.48, -138.99, -188.07);
			is_dock = true;};
		"hathor_power" = {
		type = "standard";};
		};
but this:

Code: Select all

	subentities = (
				{
			"subentity_key" = "hathor_dock";
			type = "standard";
//			position = (-100.48, -138.99, -188.07);
			"is_dock" = true;
			},
				{
			"subentity_key" = "hathor_power";
			type = "standard";
			}
		);
EDIT: too slow. duh! :roll:
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Re: Missing Subents

Post by Killer Wolf »

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.

TIA
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Missing Subents

Post by Commander McLane »

Killer Wolf wrote:
i've no "position" tags in the code.
This may already be the answer. No position tag equals position = 0, 0, 0
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Re: Missing Subents

Post by Killer Wolf »

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.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Missing Subents

Post by Commander McLane »

Killer Wolf wrote:
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?
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Re: Missing Subents

Post by Killer Wolf »

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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Missing Subents

Post by Eric Walch »

Killer Wolf wrote:
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
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Missing Subents

Post by Thargoid »

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.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Re: Missing Subents

Post by Killer Wolf »

well that's exactly what i said.

off-centred and moved subents each have their place, but IMO moved subents for a stationary construction is silly.
Post Reply