Jump to content

Cycle through 3D, Chase and Ridealong.


Recommended Posts

Just in case some of you want to be able to access different views, using Jstick or Keyboard, without having to go to Menu.


--[[This Script will Cycle through 3D, Chase and Ridealong. To use, copy this text to a file AnyName.lua and place it into your XP11... \Resources\plugins\FlyWithLua\Scripts, Start XPlane, Go to Settings>Joystick or Keyboard and in FlyWithLua Views Cycle Views, assign a button or Key to Cycle views. Go back to XP and use the button / key to cycle through views. Tested with XP11.40 and Win10.]]


local last_view_type = 0


--define the DataRef we want to use

DataRef( "view_type", "sim/graphics/view/view_type" )

--view_type == 1017 = Chase

--view_type == 1026 = 3D

--view_type == 1023 = HUD?


function Cycle_Views()

--if view_type == 1026 = 3D switch to Chase on next Jstk press

if (( view_type == 1026 ) and ( last_view_type ~= 1026 ))

or(( view_type == 1023 ) and ( last_view_type ~= 1023 )) then

command_once( "sim/view/chase" )


--if Chase switch view/ridealong

if ( view_type == 1017 ) and ( last_view_type ~= 1017 ) then

command_once( "sim/view/ridealong" )


--switch to 3D on next Jstk press

command_once( "sim/view/3d_cockpit_cmnd_look" )






-- create a Jstk command to execute Cycle_Views

create_command("FlyWithLua/Views/Cycle Views", "Key to Cycle views", "Cycle_Views()", "", "")





Here is something Fun. It actually moves.


Edited by flytv1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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