Jump to content

How to script flight control commands?


bolek

Recommended Posts

Hi,

 

I am writing some scripts that need to control player's aircraft (not AI), like rudder or throttle. In essence, I would like to do in a Lua script the equivalent of "SET COMMAND" or "SET COMMAND WITH VALUE" that are available in trigger actions.

 

This seems simple enough but I cannot figure it out :-) I tried to search existing information but all I could find was references to export scripts (like for Tacview), but this is not what I need. I need this to be available in a script callable from mission editor, so it has access to all the mission state.

 

Thanks

 

Bolek

Link to comment
Share on other sites

Try "a_set_command_with_value", it's what the mission editor seems to use (create a mission with the trigger, then look at the generated mission file with a text editor).

 

I can't seem to find the function using introspection, so I am not sure in what context exactly it is available, but it's worth a shot.

Link to comment
Share on other sites

Thanks, but I already tried this and it seems that these generated scriptlets from the "mission" file are not run in the same enviroment as the user trigger actions. In fact the generated mission scripts call a_do_script() to run the user scripts for the trigger actions. This must modify the environment somehow.

 

In any case, I cannot find a_set_command_with_value() in any context available to trigger action scripts, as you have discovered too.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...