How to set vessels position in lua

xjflcf520

Member
Joined
Feb 26, 2021
Messages
70
Reaction score
6
Points
23
Location
Chana
I want to set my vessel‘s position by lua,but I don't know how to realise it
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
As usual I would first consult the manual ;)
\Orbitersdk\doc\orbiter_lua.chm

"Vessel position" is a bit tricky to answer without knowing what exactly you would like to achieve.
For an "orbital" position something like this would do the job:
SQL:
v:set_elements ({a=4000e3, e=0, i=0, theta=0, omegab=0, L=0}, {href=oapi.get_objhandle('moon'), mjd_ref=0, frame='equ'})
With the first table being of type ELEMENTS:
  • a semi-major axis [m]
  • e eccentricity
  • i inclination [rad]
  • theta longitude of ascending node [rad]
  • omegab longitude of ascending node [rad]
  • L mean longitude at epoch [rad]
I have no example for a position on the surface of a body, but I guess there is at least one (Lua-)function or forum-member that can help ;)
 
Top