I've got a JS-question: Is there a way to check in a ship-script for the distance between the calling ship and the witchpoint? Note: I am specifically asking not about the witchpoint beacon, but about the witchpoint (wpm 0 0 0).
Is it for instance possible to use this.ship.position.distanceTo("wpm", [0, 0, 0])? I guess not, because according to the wiki distanceTo() expects only a vector expression, not a preceding coordinate system string.
However, is there an alternative way?
checking for distance to witchpoint
Moderators: winston, another_commander
- Commander McLane
- ---- 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:
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: checking for distance to witchpoint
I think not. The buoy is put at exactly the 0,0,0 coordinate in the wpm system. But that needs the buoy to be present. In absolute coordinates the withchpoint is positioned at a random location of half a scanner range around the abs 0,0,0 coordinate.Commander McLane wrote:I've got a JS-question: Is there a way to check in a ship-script for the distance between the calling ship and the witchpoint?
No idea why that random deviation as a player never can see the difference.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
A rather clunky way would be to spawn something at [0,0,0], check the distance to that and then remove it again.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Commander McLane
- ---- 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:
- Lestradae
- ---- E L I T E ----
- Posts: 3095
- Joined: Tue Apr 17, 2007 10:30 pm
- Location: Vienna, Austria
...
Couldn't you spawn a super-small "special beacon" at wpm 0 0 0 just for the check in any case and immediately remove it after the check?
That way, no player would notice anything of the procedure even if near the W beacon, and there is no error if the actual beacon has been destroyed prior to the check.
L
That way, no player would notice anything of the procedure even if near the W beacon, and there is no error if the actual beacon has been destroyed prior to the check.
L
Clunkier still, look for the witchpoint buoy, and if not found, create a splinter at wpm 0 0 0 read its position & then destroy it! I did something similar to that for my first version of hotrods as that was the only way to determine the Witchpoint for my crude wpm2abs function. Ah, those were the days, we didn't have a fancy 'abs' system way back then...Thargoid wrote:A rather clunky way would be to spawn something at [0,0,0], check the distance to that and then remove it again.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: checking for distance to witchpoint
Just to be clear here, wpm (0 0 0) is where the witchspace beacon is spawned. I’m not entirely clear on why this point is slightly offset to the origin (and all ships entering, including the player, are also slightly offset from the origin) – it’s probably a thinko or misunderstanding.Commander McLane wrote:I've got a JS-question: Is there a way to check in a ship-script for the distance between the calling ship and the witchpoint? Note: I am specifically asking not about the witchpoint beacon, but about the witchpoint (wpm 0 0 0).
In fact, as far as I can see, there would be no problem at all in removing the offset and just putting the beacon (and “w” reference point) at the origin. Thoughts?
E-mail: [email protected]
- Commander McLane
- ---- 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:
Probably it is just for adding some randomness? Like the wpm-system is spawned within the abs-system via a addShipsAt instead of a addShipsAtPrecisely (if you get the picture)?
In my opinion the witchpoint could easily be placed exactly at the origin. I don't see any downsides (and no upsides of the current placement).
Ah here could be one: Could it be that internally the difference between addShipsAt (somewhere close to the specified coordinates) and addShipsAtPrecisely (exactly at the specified coordinates) is created by using the internal system for addShipsAt (which will result in a slight offset from the wpm or whatever coordinate specified)? So placing the beacon exactly at the origin would effectively destroy the difference between addShipsAt and addShipsAtPrecisely?
----------
By the way: another offset that still bugs me is the ca. 16° offset of the rotational axis of planets from the plane. And of course the fact that this offset is completely fixed and not influencable via script or plist. (The orientation-setting in planetinfo.plist only changes how the texture is wrapped around the planet, not the actual rotational angle of the planet.)
In my opinion the witchpoint could easily be placed exactly at the origin. I don't see any downsides (and no upsides of the current placement).
Ah here could be one: Could it be that internally the difference between addShipsAt (somewhere close to the specified coordinates) and addShipsAtPrecisely (exactly at the specified coordinates) is created by using the internal system for addShipsAt (which will result in a slight offset from the wpm or whatever coordinate specified)? So placing the beacon exactly at the origin would effectively destroy the difference between addShipsAt and addShipsAtPrecisely?
----------
By the way: another offset that still bugs me is the ca. 16° offset of the rotational axis of planets from the plane. And of course the fact that this offset is completely fixed and not influencable via script or plist. (The orientation-setting in planetinfo.plist only changes how the texture is wrapped around the planet, not the actual rotational angle of the planet.)