Here are the scripts I have used (this time in Jscript).
Script global section:
Code: Select all
function init() {
acf = HIDMacros.GetXplVariable("sim/aircraft/view/acf_ICAO");
HIDMacros.Debug("Aircraft: " + acf);
}
function log_view() {
HIDMacros.Debug("Current view:");
HIDMacros.Debug("X: " + HIDMacros.GetXplVariable("sim/graphics/view/pilots_head_x"));
HIDMacros.Debug("Y: " + HIDMacros.GetXplVariable("sim/graphics/view/pilots_head_y"));
HIDMacros.Debug("Z: " + HIDMacros.GetXplVariable("sim/graphics/view/pilots_head_z"));
HIDMacros.Debug("Psi: " + HIDMacros.GetXplVariable("sim/graphics/view/pilots_head_psi"));
HIDMacros.Debug("The: " + HIDMacros.GetXplVariable("sim/graphics/view/pilots_head_the"));
}
Code for overhead panel view macro:
Code: Select all
//log_view();
HIDMacros.XPLCommand("sim/view/3d_cockpit");
if (acf = "B06") {
HIDMacros.SetXplVariable("sim/graphics/view/pilots_head_x", 0.008);
HIDMacros.SetXplVariable("sim/graphics/view/pilots_head_y", 0.05);
HIDMacros.SetXplVariable("sim/graphics/view/pilots_head_z", -1.03);
HIDMacros.SetXplVariable("sim/graphics/view/pilots_head_psi", 0);
HIDMacros.SetXplVariable("sim/graphics/view/pilots_head_the", 90);
}