bolek Posted August 25, 2014 Posted August 25, 2014 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
FSFIan Posted August 25, 2014 Posted August 25, 2014 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. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
bolek Posted August 26, 2014 Author Posted August 26, 2014 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.
Recommended Posts