I'm having a similar problem, Linux verses Windows. My code works fine on Linux, but on Windows things start to screw up.
I've patched in my Vector and Matrix classes using ToLua. In my demo hovercraft script I create an array of vectors for the thruster positions. I call the Lua function OnApplyForceAndTorque, during which I do the necessary calculations with the thruster positions and forces/torques. On Linux, all is fine and floaty, but on Windows I get the Lua error 'Table contains a nil' every time I reference an array item.
Here's a relevant extract:
-- Craft sizeSize = SYM_VECTOR3(20, 10, 40)-- Thruster placementThrusters = { SYM_VECTOR3( Size.x * 0.6, Size.y * 0.1, Size.z * 0.6), SYM_VECTOR3(-Size.x * 0.6, Size.y * 0.1, Size.z * 0.6), SYM_VECTOR3( Size.x * 0.6, Size.y * 0.1, 0.0), SYM_VECTOR3(-Size.x * 0.6, Size.y * 0.1, 0.0), SYM_VECTOR3( Size.x * 0.6, Size.y * 0.1, -Size.z * 0.6), SYM_VECTOR3(-Size.x * 0.6, Size.y * 0.1, -Size.z * 0.6)}...function oOnApplyForceAndTorque(GeomName) if GeomName == "HCraft" then -- Get matrix Matrix = getmatrix("HCraft") -- Get hovercraft omega Omega = getomega("HCraft") -- Get force direction in global space ThrusterDir = Matrix:UnrotateVector(SYM_VECTOR3(0, 1, 0)) TotalForce = GravityForce TotalTorque = SYM_VECTOR3(0, 0, 0) -- Loop through thrusters for i = 1,6 do -- **ERROR OCCURS HERE** io.write(Thrusters.x.." "..Thrusters.y.." "..Thrusters.z.."\n") -- Get thruster position in global space ThrusterPos = Matrix:TransformVector(Thrusters)...
I've had all sorts of fine suggestions from the #Lua crew on Freenode, like accidentally linking Lua 5.0 with Tolua 5.1, but nothing that helps this problem.
If you find any clues or solutions Disanti, please post.