Page 1 of 2

Can anybody make this docking bay work?

Posted: Sun Dec 13, 2009 9:44 pm
by pagroove

Code: Select all

{

"pagroove_tigershark_mainhull" = 
	{
		aft_eject_position = "0.0 -20.0 -67.0";
		aft_weapon_type = "WEAPON_PULSE_LASER";
		ai_type = "route1traderAI.plist";
		auto_ai = yes;
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 3;
		exhaust = ("-9.8 5.6 -78.5 10.0 10.0 8.0", "9.8 5.6 -78.5 10.0 10.0 8.0");
		forward_weapon_type = "WEAPON_MILITARY_LASER";
		fuel = 70;
		has_ecm = 0.95;
		has_escape_pod = 0.95;
		has_scoop = 0.95;
		likely_cargo = 7;
		max_cargo = 750;
		max_energy = 500;
		max_flight_pitch = 0.1;
		max_flight_roll = 0.35;
		max_flight_speed = 100;
		missile_launch_position = "0.0 -9.0 60.0";
		missiles = 7;
		model = "pagroove_tigershark_mainhull.dat";
		name = "Tigershark";
		roles = "pagroovetigershark bigTrader";
		thrust = 14;
		weapon_position_aft = "0.0 0.0 -85.0";
		weapon_position_forward = "0.0 -4.0 85.0";
		weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
	subentities = ("pagroove_tigershark_dockingbay  0 0 -995.9887 1 0 0 0");
	shaders = 
		{ 
            "pagroove_tigershark_mainhull_diffuse.png" = 
			{ 
                vertex_shader = "pagroove_tigershark.vertex"; 
                fragment_shader = "pagroove_tigershark.fragment"; 
                textures = 
						(
							"pagroove_tigershark_mainhull_diffuse.png", 
							"pagroove_tigershark_mainhull_normal.png"
						);
				uniforms =
						{
						uColorMap = { type = texture; value = 0; };
						uNormalMap = { type = texture; value = 1; };
						uTime = "universalTime";
						nearly_dead = "throwingSparks";	
						isHostile = "hasHostileTarget";						
						hull_heat_level = "hullHeatLevel";
						PaintColor1 = {type = "randomUnitVector"; scale = 0.25;};					
						}; 	
			}; 
		}; 
	};

"pagroove_tigershark_dockingbay" = 
	{
	ai_type = "dumbAI.plist";
	model = "pagroove_tigershark_dockingbay-192x64x250.dat"; 
	name = "Tigershark";
	roles = "docking-slit";
	shaders = 
		{ 
            "pagroove_tigershark_dockingbay_diffuse.png" = 
			{ 
                vertex_shader = "pagroove_tigershark_dockingbay.vertex"; 
                fragment_shader = "pagroove_tigershark_dockingbay.fragment"; 
                textures = ("pagroove_tigershark_dockingbay_diffuse.png"); 
			}; 
		}; 
	};
}
ATM it doesn't work. Can anybody help and maybe teach us how to make docks.?

Posted: Sun Dec 13, 2009 9:54 pm
by pagroove
It's for this ship.

Image

Posted: Mon Dec 14, 2009 12:33 am
by aegidian
It's been a while but perhaps you also need

Code: Select all

isCarrier = yes;

Posted: Mon Dec 14, 2009 7:17 am
by Killer Wolf
i put my dock findings in the "things i wish i knew..." thread, might be of help.

Posted: Mon Dec 14, 2009 12:01 pm
by DaddyHoggy
pagroove wrote:
It's for this ship.

Image
BTW, I wanted to say - a very nice looking ship!!!

Posted: Mon Dec 14, 2009 1:18 pm
by Frame
What the master and commander wrote..

you can also include carrier into the role set

"role1 role2 carrier"...

Posted: Mon Dec 14, 2009 8:41 pm
by Eric Walch
One other important thing is that the string "dock" must be part of the dock-name in the old way of defining subentities. Oolite looks for this string to determine if a subentity is a dock. In the new system of subentities introduced with version 1.73 (See the wiki) any name can be used.

Posted: Tue Dec 15, 2009 9:40 pm
by pagroove

Code: Select all


"pagroove_tigershark_mainhull" = 
	{
		aft_eject_position = "0.0 -20.0 -67.0";
		aft_weapon_type = "WEAPON_PULSE_LASER";
		ai_type = "route1traderAI.plist";
		auto_ai = yes;
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 3;
		exhaust = ("-9.8 5.6 -78.5 10.0 10.0 8.0", "9.8 5.6 -78.5 10.0 10.0 8.0");
		forward_weapon_type = "WEAPON_MILITARY_LASER";
		fuel = 70;
		has_ecm = 0.95;
		has_escape_pod = 0.95;
		has_scoop = 0.95;
		likely_cargo = 7;
		max_cargo = 750;
		max_energy = 500;
		max_flight_pitch = 0.1;
		max_flight_roll = 0.35;
		max_flight_speed = 100;
		missile_launch_position = "0.0 -9.0 60.0";
		missiles = 7;
		model = "pagroove_tigershark_mainhull.dat";
		name = "Tigershark";
		roles = "pagroovetigershark bigTrader";
		thrust = 14;
		weapon_position_aft = "0.0 0.0 -85.0";
		weapon_position_forward = "0.0 -4.0 85.0";
		weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
	subentities = ("pagroove_tigershark_dockv1  0 0 -995.9887 1 0 0 0");
	shaders = 
		{ 
            "pagroove_tigershark_mainhull_diffuse.png" = 
			{ 
                vertex_shader = "pagroove_tigershark.vertex"; 
                fragment_shader = "pagroove_tigershark.fragment"; 
                textures = 
						(
							"pagroove_tigershark_mainhull_diffuse.png", 
							"pagroove_tigershark_mainhull_normal.png"
						);
				uniforms =
						{
						uColorMap = { type = texture; value = 0; };
						uNormalMap = { type = texture; value = 1; };
						uTime = "universalTime";
						nearly_dead = "throwingSparks";	
						isHostile = "hasHostileTarget";						
						hull_heat_level = "hullHeatLevel";
						PaintColor1 = {type = "randomUnitVector"; scale = 0.25;};					
						}; 	
			}; 
		}; 
	};

"pagroove_tigershark_dockv1" = 
	{
	ai_type = "dumbAI.plist";
	model = "pagroove_tigershark_dockv1-192x64x250.dat"; 
	name = "Tigershark";
	roles = "dock";
      is_dock = yes;
      isCarrier = yes;
      shaders = 
		{ 
            "pagroove_tigershark_dockingbay_diffuse.png" = 
			{ 
                vertex_shader = "pagroove_tigershark_dockingbay.vertex"; 
                fragment_shader = "pagroove_tigershark_dockingbay.fragment"; 
                textures = ("pagroove_tigershark_dockingbay_diffuse.png"); 
			}; 
		}; 
	};
}
Tried some things.

- Tried to use the word dock
- Tried to use roles l

no luck

But can't get it to work. Anyone want to have the ship to try? The advantage is that you get an interesting preview of the ship.
Sorry, I'm more of a creative type than a coder. :cry:

Posted: Tue Dec 15, 2009 10:18 pm
by JensAyton
Try putting the isCarrier in the carrier rather than the dock. :-)

Posted: Tue Dec 15, 2009 10:19 pm
by Eric Walch
pagroove wrote:
Tried some things.

- Tried to use the word dock
- Tried to use roles l

no luck. :cry:
Try putting:

Code: Select all

isCarrier = yes; 
into the carrier itself instead of in the dock. :roll:

Posted: Tue Dec 15, 2009 11:10 pm
by pagroove
Eric Walch wrote:
pagroove wrote:
Tried some things.

- Tried to use the word dock
- Tried to use roles l

no luck. :cry:
Try putting:

Code: Select all

isCarrier = yes; 
into the carrier itself instead of in the dock. :roll:
Ok will try tommorow.

Posted: Sat Dec 19, 2009 12:23 pm
by pagroove
pagroove wrote:
Eric Walch wrote:
pagroove wrote:
Tried some things.

- Tried to use the word dock
- Tried to use roles l

no luck. :cry:
Try putting:

Code: Select all

isCarrier = yes; 
into the carrier itself instead of in the dock. :roll:
Ok will try tommorow.
Still no luck.

Posted: Sat Dec 19, 2009 1:36 pm
by Svengali
You can try a few things to make it easier for Oolite.

For the main entity
- Rename the carrier from "pagroove_tigershark_mainhull" to "pagroove_tigershark_carrier"
- Give Oolite some more hints (equipment_price_factor, equivalent_tech_level, has_npc_traffic, hasShipyard, is_carrier, ...)
- Set frangible = false;
- Set roles "pagroove_tigershark_carrier"
- Take a look at the quaternion in the subent-declaration, rotate it for your needs, but keep in mind that the positions for X and Y have to be 0
For the subent
- Rename the subent to "pagroove_tigershark_dock"
- Set ai_type = "nullAI.plist";
- Set roles = "pagroove_tigershark_dock";

Some time ago I have started to write a small tutorial for dockable entities http://wiki.alioth.net/index.php/OXP_ho ... e_stations
It's not finished, but some usefull hints are there if you watch the source code mostly the comments (not visible in the normal view).

CheeriO

Posted: Sat Dec 19, 2009 2:05 pm
by pagroove
Svengali wrote:
You can try a few things to make it easier for Oolite.

For the main entity
- Rename the carrier from "pagroove_tigershark_mainhull" to "pagroove_tigershark_carrier"
- Give Oolite some more hints (equipment_price_factor, equivalent_tech_level, has_npc_traffic, hasShipyard, is_carrier, ...)
- Set frangible = false;
- Set roles "pagroove_tigershark_carrier"
- Take a look at the quaternion in the subent-declaration, rotate it for your needs, but keep in mind that the positions for X and Y have to be 0
For the subent
- Rename the subent to "pagroove_tigershark_dock"
- Set ai_type = "nullAI.plist";
- Set roles = "pagroove_tigershark_dock";

Some time ago I have started to write a small tutorial for dockable entities http://wiki.alioth.net/index.php/OXP_ho ... e_stations
It's not finished, but some usefull hints are there if you watch the source code mostly the comments (not visible in the normal view).

CheeriO

Hey that looks comprehensive. I never saw the tutorial. Thanx!

Posted: Sat Dec 19, 2009 3:34 pm
by Killer Wolf
what exactly is the "doesn't work" aspect? is it placing the dock correctly but just not allowing you to dock, or what?
have you tried viewing w/ bounding boxes, the dock (if it's identifying one) will appear as red (ta to Commander McLane for that tip!)