player.ship.speed is wrong

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

player.ship.speed is wrong

Post by Eric Walch »

player.ship.speed has a bug. When not moving is gives 0 but any other speed is wrong and return very strange numbers.
I typed in the console:

Code: Select all

> player.ship.speed
-0.000000000000000000000000000000000000000000026815622292052967
> player.ship.speed
00002.0000004782923786
> player.ship.speed
00000000000000000002.0000004792236576
> player.ship.maxSpeed
312
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 »

That is weird. I’m not sure what would cause those leading zeroes to be there, for a start.

Unfortunately (?), it works for me.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

It is not always wrong. When I launch from a station and don't change speed it returns the correct value. But as soon as i lower or raise speed and than ask for speed I get the strange results. Even more strange: if I round the value it returns a correct speed:

Code: Select all

> player.ship.speed
156
(increase throttle)
> player.ship.speed
-0.00000000000000000000000000000000000000000000000000000020000004798785067
> Math.round(player.ship.speed)
196
Maybe it is just in the console? But it is always correct direct after launch with an unchanged speed.
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 »

Well, that clearly marks it as a display issue. I really don’t know what’s happening, though.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ahruman wrote:
Well, that clearly marks it as a display issue. I really don’t know what’s happening, though.
It's not only cosmetic. I just got the following error in the log:

Code: Select all

Oolite [script.javaScript.exception.206] ReportJSError (OOJavaScriptEngine.m:136): ***** JavaScript exception: Error: System.legacy_addShipsAt: Invalid arguments ("derelict2_ptt", "wpu", 1, [0,0,-M.415457530940974e+140]) -- expected role, positive count no greater than 64, coordinate scheme and coordinates.
This ship was always added without a problem. Now it does not recognise the z coordinate that was calculated with a random value. I tried it in the console and I got:

Code: Select all

> Math.random()
-;.334326032427297e-223
> Math.random()
-?.568205105111486e-16
> Math.random()*2
6.968427634158886e+223
Strange values.
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 »

Eric Walch wrote:
It's not only cosmetic. I just got the following error in the log:

Code: Select all

Oolite [script.javaScript.exception.206] ReportJSError (OOJavaScriptEngine.m:136): ***** JavaScript exception: Error: System.legacy_addShipsAt: Invalid arguments ("derelict2_ptt", "wpu", 1, [0,0,-M.415457530940974e+140]) -- expected role, positive count no greater than 64, coordinate scheme and coordinates.
That’s because you’ve got the count and coordinate scheme the wrong way around.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ahruman wrote:
That’s because you’ve got the count and coordinate scheme the wrong way around.
You are right, I was just fixated on the M in the z-coordinate. Than it's still a cosmetic bug.
Post Reply