position = "x y z" in planetinfo.plist

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

Moderators: another_commander, winston

Post Reply
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:

position = "x y z" in planetinfo.plist

Post by Commander McLane »

Can anybody (perhaps Ahruman from a look into the code?) tell me which coordinate-system is used to define the position of a new planet/moon in planetinfo.plist?

It is not any of the usual ones we use to add ships to the Ooniverse.

I made some tries with adding a planet, but it won't appear where I want it to.

Examples: If I put it at

Code: Select all

position = "0 0 -1000000";
it will appear close to pwm 0 0 1500000 in my system, where the witchpoint buoy is at pwm 0 0 500000, so it seems to use a -wpm system. But it seems to be more complex. An entry

Code: Select all

position = "0 -500000 0";
moves it to a position at roughly pwm 454000 176000 485000 and

Code: Select all

position = "-500000 0 0";
has it at pwm -168000 440000 497000.

Obviously the z-axis of the position-command is close to (but not exactly on) the z-axis of pwm, but runs into the other direction. But the other two axes don't match with any axis in the system.

Now what I would like to have is an easy-to-do transformation from any given pwm-coordinates (that's the one on screen when pressing SHIFT-F) to the position-coordinates in a system where the witchpoint-buoy is located at pwm 0 0 500000. Then I could fly around, decide: "here I will place my planet", read the pwm-coords from the screen and transform them into the correct position-coordinates.

Is something like this possible? :?:
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

LB may be able to throw some light on it, he has done it successfully in Assassins
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

It was a while ago and I did it by trial and error, then flew to where the planet was to add a station / ships by pwm. Think the first is the left right position looking into the system from the witch point, where zero is dead center and - and + effect the left or right. Think second is up / down and the third is distance from the witch point. The numbers don't relate to pwm in anyway I could see. I just looked at the position in game for Murgh's moon in Lave OXP. Took that as my start position, then moved it round until it looked right!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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:

Post by Commander McLane »

LittleBear wrote:
Think the first is the left right position looking into the system from the witch point, where zero is dead center and - and + effect the left or right. Think second is up / down and the third is distance from the witch point.
Okay, I'll give it a try and do some testing along these lines. The numbers I got so far (in my above post) seem to indicate, however, that it is a x,y,z-system with the same (or very similar) z-coord, but x and y are turned by an angle of roughly 30 degrees.

I would have to dig very, very deep in the parts of my brain where all my high-school maths is stored, to come up with a transformation for a roughly 30-degree-turn of a vector. But I am just hoping somebody here on the forum is a bit closer to that and can provide me with a formula.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

If you just provide numbers, it uses absolute co-ordinates in Oolite’s internal co-ordinate system. If you provide a standard co-ordinate system string, that’s used instead.
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:

Post by Commander McLane »

Something like

Code: Select all

position = "pwm 0 0 -1000000";
?

I tried this, but then got a strange effect with the hyperspace rings when I jumped into the system, and a "Press Space Commander" a second later. I don't think that I had placed the planet exactly at the witchpoint and will try very big numbers. But it seemed Oolite didn't swallow it as I wished.

Oh, and I am talking of Oolite 1.65 here because of this.

Nope, with

Code: Select all

position = "pwm 5000000 5000000 5000000";
I get this:
Image
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Yeah, that looks like you got a planet in the face. Radius sets the size and 5000 is the size of the normal Oolite Main Planet, so if you set it to something small, that should make testing easier.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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:

Post by Commander McLane »

Well, my actual planetinfo.plist looks like this:

Code: Select all

{
	"ghosts_planetA" = {
		position = "pwm 5000000 5000000 5000000";
		radius = 2000;
		orientation = "0.0 1.0 0.0 0.0";
		texture = "ghosts_planetA.png";
		seed = "1 2 3 4 5 6";
		"polar_color_factor" = 2.5;
		"rotational_velocity" = 0.13;
	};
	"ghosts_planetB" = {
		position = "-3000000 0 812500";
		radius = 7500;
		orientation = "0.0 1.0 0.0 0.0";
		texture = "ghosts_planetA.png";
		seed = "1 2 3 4 5 6";
		"polar_color_factor" = 2.5;
		"rotational_velocity" = 0.04;
	};

	"2 22" = {
		"ambient_level" = "1.0";
		"sky_blur_alpha" = "0.85";
		"sky_blur_cluster_chance" = "0.88";
		"sky_blur_scale" = "45";
		"script_actions" = (
			"addMoon: ghosts_planetA"
		);
	};
}
(shamelessly copied from Assassins, BTW)

So the radius is 2000 (not too big) and the position should be far, far away from the witchpoint (and my face!).

I guess I am doing something wrong here (obviously), and I appreciate every enlightenment as to what.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2862
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Hmm, that is odd. Only time I blew up was when I foolishly put a Gas-Giant sized planet in the space lane where the Lave Moon is. (Assassins planetinfo code cribbed in turn from Lave.oxp :wink: ). It didn't use pwm for the planets though and used the absolute values that Murgh had used. Try using the position for Murghs Lave moon, then move it say 1000 units and see where it is now. I do remember there being some sort of logic to it, but once I had the distance right I just played around with the numbers to move the left/right and up down positions.
Last edited by LittleBear on Mon Aug 13, 2007 10:05 pm, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

It could be that one or more of the necessary reference points doesn’t exist yet. However, I remembered that there is a way to get the current absolute position of the player (or any other ship) – use key_dump_target_state.
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:

Post by Commander McLane »

Thanks, Ahruman! I'll do that.
Post Reply