sharing variables between lua scripts

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Posts: 41
Joined: 27.10.2003
With us: 15 years 7 months

sharing variables between lua scripts

Post #1by astro » 15.04.2012, 15:31

Hi all,

I am trying to write a celx script or a lua hook to read data from the
socket. From this data it sets the simulation time and rate and also
some global variables that allow to compute spacecraft position and
attitude in the vicinity of the simulation time. Then scriptedOrbit
and scriptedAttitude modules should access this global variables to
compute position and attitude.

However I realised after a simple test that I cannot share global
variables between celx and scriptedOrbit. I also read somewhere on the
forum that hooks, celx and scriptedOrbit/scriptedAttitude all run in
separate Lua contexts.

But I saw this post from Chris:
which is implying that it should be possible to exchange data between
a lua hook and a scripted orbit.
But how?

Thank you very much.

Return to “Scripting”

Who is online

Users browsing this forum: 3 guests