Page 1 of 1

Posted: Tue Feb 24, 2009 11:22 am
by Svengali
I think we should give here some more infos. This happened when Eric has used the Vector.
Eric Walch wrote:
But somehow the variables were not initialised correct and on docking I got the message: awarded NaN credits. means here an non-initialised variable.
The worldScript initialized a missionVariable with a value of 0.01 (or it has tried to do it), but somehow it went wrong and the value has become NaN (Not a number -> C.998753...) while init or while transferring it to a property. On my computer the variable is always right initialized, so this is maybe the same problem as Eric has reported before (older processor structures) on his MAC.

I'm pretty sure that I'll go and change it from float to integer to avoid this problem.

Posted: Tue Feb 24, 2009 1:16 pm
by Eric Walch
Svengali wrote:
I think we should give here some more infos. This happened when Eric has used the Vector.
Digging deeper on the bug I discovered it had nothing to do with mine ship adding by hand. Svengali did is also himself for Vector. But one of the mission variables in my save file that should have read 0.01, now reads: C.991592789737117e+36. This value looked familiar and gave some frustration in the past. It is probably the same JS bug that only happens with oolite version 1.72.x on G4 and G5 macs. This bug is already solved for the 1.73 release. But players that use Vector.oxp on those mac systems should be warned now to watch their credits!

On all intel macs and other systems this bug should not occur.

EDIT
Or even more precise: Conversion of floating numbers in strings goes wrong on these machines. I already noticed this on printing out floating numbers but mission variables are also written as string. So any oxp on those machines using floating numbers in mission variable could be buggy. I haven't noticed any of those things in UPS but I think I only user integer numbers as mission variables. (checked: only integers are stored in ups.)

Posted: Tue Feb 24, 2009 6:05 pm
by Svengali
For all G4 and G5 user I've updated the scripts
see https://bb.oolite.space/viewtopic.php?t=4634