I'm trying to make a Lua module for an object which has a ScriptedRotation. But for some reason I don't understand, Celestia tells me "Failed to load module for ScriptedRotation" every time I start.
I have my module "rtfifo.lua" in "scripts/celxx" directory, and here is my module :
Code: Select all
rtAttProto = { }
-- constructor method
function rtAttProto:new(o)
o = o or {}
setmetatable (o, self)
self.__index = self
o.period = 1
return o
end
-- orientation function
function rtAttProto:orientation(tjd)
local t = tjd
-- return a quaternion representing the orientation
w, x, y, z = fifolib.popAtt(t)
return w, x, y, z
end
function rtAtt(sscvals)
return rtAttProto:new(sscvals)
end
And here is the .scc
Code: Select all
ScriptedRotation
{
Module "rtfifo"
Function "rtAtt"
}
"fifolib" is a library I made and added to Lua. It works very well in a celx script launched with celestia, and i was asking why it does not in Lua module. But after some research, I found that the module was not even loaded.
Can someone help me with Lua Module and Scc file please ?
I already read wiki documentation, i downloaded and analyzed "flight_control" script, and i think i did the same, but it does not work for me...
Thanks !
Pierral.