Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

:twisted: I'm evil...

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

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

Post 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:
LOOK OUT!!!
OOPS..
"Press Space" Commander
If you do not see "Press Space" more often than you want.. Your not trying!
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

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

Post 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)
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
MSA-S23
Above Average
Above Average
Posts: 26
Joined: Sat Aug 08, 2015 2:30 pm

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

Post 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
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

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

Post 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;	}
		);
MSA-S23
Above Average
Above Average
Posts: 26
Joined: Sat Aug 08, 2015 2:30 pm

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

Post by MSA-S23 »

Ok, thanks. I'll experiment this week.
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

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

Post 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.
LOOK OUT!!!
OOPS..
"Press Space" Commander
If you do not see "Press Space" more often than you want.. Your not trying!
MSA-S23
Above Average
Above Average
Posts: 26
Joined: Sat Aug 08, 2015 2:30 pm

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

Post by MSA-S23 »

There's a good phrase!
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

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

Post 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:
LOOK OUT!!!
OOPS..
"Press Space" Commander
If you do not see "Press Space" more often than you want.. Your not trying!
avder
Above Average
Above Average
Posts: 29
Joined: Mon Jul 27, 2015 4:39 pm

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

Post by avder »

Cruise liners? 500 per escape pod? Sitting ducks?

I need to download this and ruin some rich chumps cruise!
User avatar
Alex
---- E L I T E ----
---- E L I T E ----
Posts: 770
Joined: Mon Oct 06, 2008 10:49 pm
Location: Oz. The land of some gold but mostly rust

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

Post 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
LOOK OUT!!!
OOPS..
"Press Space" Commander
If you do not see "Press Space" more often than you want.. Your not trying!
MSA-S23
Above Average
Above Average
Posts: 26
Joined: Sat Aug 08, 2015 2:30 pm

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

Post by MSA-S23 »

Soooooo true. :D
Post Reply