Save situation

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
Detlef
Posts: 303
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Save situation

#1 Post by Detlef »

Hi,

I used to have a button on my panel, saving the flight/situation. I found no direct solution for that in Airmanager. Instead I found, I can generate an X-Plane command per FlyWithLua Script. And then have Airmanager call that command ("FlyWithLua/save_this_situation") when pressing a button on a game controller. This is the FlyWithLua Script. It generates a situation file last_flight.sit which I use as a default on X-Plane start, and a file with the aircraft name in it, that I can use at later times when I flew other airplanes in between. I like to continue flights where they stopped last.

Code: Select all

-- FlyWithLua not Airmanager:
dataref("AircraftDescription", "sim/aircraft/view/acf_descrip", "readonly") -- assumed readonly

function SaveSituation()
  local path = "C:\\XP11\\XPlane11\\Output\\situations\\"
  save_situation(path .. "last_flight.sit") -- use this as default flight at X-Plane 11 start
  save_situation(path .. "last_" .. AircraftDescription .. ".sit")
end

create_command("FlyWithLua/save_this_situation",
  "Save this situation",
  "SaveSituation()",
  "",
  "")
Is there a direct way to do that in AM?

Thank you
Detlef

Post Reply