General Question Set animation from scenario file

Usually a vessel will persist its animation states (unless they're default) in the scenario files, so in general, yes. How to do it exactly depends on the particular vessel, though.
 
This is a vessel that I created.
Sometimes I'd like to start a scenario with the gear up and sometimes down.
Lua vessels don't currently save their animation states between saving and loading(at least I don't know how to do it).
I was hoping I could manually edit a scenario to do what I want.
It's easy enough to do this with the config file but with the scenario file it would be more convenient.
 
Hi @johnnymanly ,
I am not sure what exactly you mean by "a lua vessel".

If the vessel (class) itself was written in lua, there should be something like these callback methods:
C++:
    void SaveState (FILEHANDLE scn);
    bool ParseScenarioLine (const char *line);
(these are the C++ API, but names should be similar)

It has been looong time since I last visited any lua code in Orbiter, so I am not sure if such a thing (callbacks) is implemented for a lua-vessels.
To be honest, I doubt it :unsure:
 
Hi @johnnymanly ,
I am not sure what exactly you mean by "a lua vessel".

If the vessel (class) itself was written in lua, there should be something like these callback methods:
C++:
    void SaveState (FILEHANDLE scn);
    bool ParseScenarioLine (const char *line);
(these are the C++ API, but names should be similar)

It has been looong time since I last visited any lua code in Orbiter, so I am not sure if such a thing (callbacks) is implemented for a lua-vessels.
To be honest, I doubt it :unsure:
Yes the vessel class is written in Lua.
I believe the methods for saving to a scenario are not implemented.
After some thought I realize my initial question is moot anyway.
Lua vessel classes don't have "consumebufferedkey" so I'm retracting and extending the gear via altitude not keystroke.
It doesn't matter where I put the gear at the start of a scenario it will always be down below a certain altitude and up above.
 
Yes the vessel class is written in Lua.
I believe the methods for saving to a scenario are not implemented.
After some thought I realize my initial question is moot anyway.
Lua vessel classes don't have "consumebufferedkey" so I'm retracting and extending the gear via altitude not keystroke.
It doesn't matter where I put the gear at the start of a scenario it will always be down below a certain altitude and up above.

While it's true that there is no consumebufferedkey implemented in lua, you can detect pressed keys with this.
(There is v:send_bufferedkey(keycode) method which is described in the section Orbiter Scripting→Reference→Class methods→Vessel methods in the Orbiter.chm file, but you can only send keys, not detect them).
 
Last edited:
Back
Top