Page 2 of 2

Re: :twisted: I'm evil...

Posted: Sun Sep 13, 2015 1:41 am
by Alex
MSA-S23 wrote:
How do you put turrets on your ship?
My ship already had turrets so I just added the extra lines of code with the coordinates for position changes required.
I'm not sure where it get's the code to tell it what a turret actually is?
And make sure it is the 'Player version' of the ship you modify.

This is done in the ships oxp -> config -> Shipdata.plist

WARNING! WARNING!
DO NOT use windows Note pad to edit code.

Windoze adds an extra extension to save file and stops it working!
I use Notepad++
It is a Free download.

** ALSO, Really, I mean Really, use a copy of the addon code to mess around with. **

These are the code for my turrets.
red, blue and green numbers are the x,y and z coordinates to place turret on ship.
x,y and z are the axis for any 3d map.
Generally on a ship x = side to side y = up and down z = along the length
The next 4 digits of -1, 0 an 1's. Im not a hundred % sure but think they give direction of fire.

<key>subentities</key>
<array>
<string>cenginea -4.5 -0.5 -60.5 1 0 0 0</string>
<string>cengineb 4.5 -0.5 -60.7 1 0 0 0</string>
<string>cmount 0.0 -2.6 26.0 0 0 0 0</string>
<string>cmount 0.0 -2.6 13.0 0 0 0 0</string>
<string>cmount 0.0 -2.6 0.0 0 0 0 0</string>

<string>caduceusturret 8.0 -2.7 26.0 1 0 -1 0</string>

<string>caduceusturret 8.0 -2.7 13.0 1 0 -1 0</string>
<string>caduceusturret 8.0 -2.7 0.0 1 0 -1 0</string>
<string>caduceusturret -8.0 -2.7 26.0 1 0 1 0</string>
<string>caduceusturret -8.0 -2.7 13.0 1 0 1 0</string>
<string>caduceusturret -8.0 -2.7 0.0 1 0 1 0</string>
<string>caduceusturret 0.0 -4.0 -60.0 0 -1 -1 0</string>
<string>caduceusturret -7 -4.0 -61.0 0 -1 -1 0</string>
<string>caduceusturret 7 -4.0 -61.0 0 -1 -1 0</string>
<string>zeroturret -0.198 -7.8 -32.0 1 -1 0 0</string>
<string>zeroturret 0.0 1.4 -14.8 1 1 0 0</string>
</array>

Hope this helps.

Messing with the placement coordinates can be fun.
I once put a turret about 30 feet in front of my forward view, just floating there and working. :lol:

Re: :twisted: I'm evil...

Posted: Sun Sep 13, 2015 4:06 am
by Diziet Sma
Alex wrote:
WARNING! WARNING!
DO NOT use windows Note pad to edit code.

Windoze adds an extra extension to save file and stops it working!
Notepad does more than that.. it also adds invisible characters inside the file itself, which breaks things. Wordpad, however, does not mangle things.

However, Notepad++ is one of the best text editors around, for windows. (It also runs under Wine on Linux)

Re: :twisted: I'm evil...

Posted: Sun Sep 13, 2015 4:53 am
by MSA-S23
[Aww, shaddup about all of that Windows Jazz!]

Ahem.

I'm runnin' a Mac, if you didn't notice from the awfully rude comment above that I totally didn't write. I'm familiar with shipdata.plist. To all Mac Users, I use xCode. Awesome interface, free from App Store. TextEdit works fine as well, but xCode is better.

Cheers,


MSA-S23

Re: :twisted: I'm evil...

Posted: Sun Sep 13, 2015 10:12 am
by Norby
Please use New-style subentity definition to prevent deprecation warnings in the log.

For example my "Carriers with turrets" define custom turrets:

Code: Select all

	"carriers-turret" =
	{
		like_ship = "ballturret";
		energy_recharge_rate = 0;
		laser_color = "redColor";
		max_energy = 128;
		name = "Carrier Turret";
		roles = "carriers-turret";
		script = "carriers-turret.js";
	};
	
	"carriers-mainturret" =
	{
		like_ship = "carriers-turret";
		laser_color = "orangeColor";
		name = "Main Turret"; //checked in carriers-turret.js
		roles = "carriers-mainturret";
		max_energy = 256;
		script_info = {
			hardarmour = 5; //used if HardShips OXP is installed
		};
	};
Then I put these into the ship:

Code: Select all

		"subentities" =
		(
			{	type = "ball_turret";	subentity_key = "carriers-mainturret";
				position = (0, 0, 120);	orientation = (1, 0, 0, 0);//forward
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 7500;	},
			{	type = "ball_turret";	subentity_key = "carriers-turret";
				position = (0, -10, 90.5);	orientation = (-0.7071, 0.7071, 0, 0);//front down
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 5000;	},
			{	type = "ball_turret";	subentity_key = "carriers-turret";
				position = (0, -15, -85.5);	orientation = (-0.7071, 0.7071, 0, 0);//aft down
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 5000;	},
			{	type = "ball_turret";	subentity_key = "carriers-turret";
				position = (-90, 0, -104.85);	orientation = (1, 0, 1, 0);//left
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 5000;	},
			{	type = "ball_turret";	subentity_key = "carriers-turret";
				position = (90, 0, -104.85);	orientation = (0, 1, 0, 1);//right
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 5000;	},
			{	type = "ball_turret";	subentity_key = "carriers-turret";
				position = (-90, 0, -116);	orientation = (0, 1, 0, 0);//aft left
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 5000;	},
			{	type = "ball_turret";	subentity_key = "carriers-turret";
				position = (90, 0, -116);	orientation = (0, 1, 0, 0);//aft right
				fire_rate = 1;	weapon_energy = 25;	weapon_range = 5000;	}
		);

Re: :twisted: I'm evil...

Posted: Sun Sep 13, 2015 4:11 pm
by MSA-S23
Ok, thanks. I'll experiment this week.

Re: :twisted: I'm evil...

Posted: Mon Sep 14, 2015 7:22 pm
by Alex
Ye,
Thanks guys.
Seems like every time I blink in Oolite I have to learn a new code lingo!
But the game goes on and gets better every blink.

Re: :twisted: I'm evil...

Posted: Tue Sep 15, 2015 4:06 pm
by MSA-S23
There's a good phrase!

Re: :twisted: I'm evil...

Posted: Tue Sep 15, 2015 10:18 pm
by Alex
MSA-S23 wrote:
There's a good phrase!
Which one?
Blink and miss it?
or
Oops I blinked and missed it?
Press space :D :roll: :lol:

Re: :twisted: I'm evil...

Posted: Tue Sep 15, 2015 10:59 pm
by avder
Cruise liners? 500 per escape pod? Sitting ducks?

I need to download this and ruin some rich chumps cruise!

Re: :twisted: I'm evil...

Posted: Tue Sep 15, 2015 11:02 pm
by Alex
"Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied"

Noo that is a good phrase.
Stolen from some one that stole it from someone
And I unashamedly stole it again

Re: :twisted: I'm evil...

Posted: Thu Sep 17, 2015 2:19 pm
by MSA-S23
Soooooo true. :D