Jump to content
The simFlight Network Forums

Can't get Lua ext.position to work ???


Recommended Posts

I may be misunderstanding the proper use of this lua code so I might be on a wild goose chase. Hope Not...

In my sim setup I have two monitors. Monitor 1 is the primary and sits above monitor 2. The primary/top monitor (1) handles my out the window view and I display an undocked Virtual Cockpit on it taking up the entire screen. The second monitor (2) is were I run FSX with a docked view of the main instrument panel.

32658063_f2st.png

I found a code sample in the Example LUA Plugins file called "TileSix" that showed how to position undocked windows and I thought this might save me having to manually drag and size my undocked virtual cockpit view each time. Based on that sample I added the code line below to a lua script I called testVCposition.lua and assigned a button to launch it. When I press the buttoin, no change to my VC view occurs.

Am I using this incorrectly, or not understanding its intended use?

here's my tesVCposition.lua file


ext.position("Main Panel", 1, 1, 99, 99, 1)
[/CODE]

here's the log from when I launch it:

[CODE]
********* FSUIPC4, Version 4.853 by Pete Dowson *********
User Name="Tom Gauvin"
User Addr="xxxx@xxxx.xxx"
FSUIPC4 Key is provided
WideFS7 Key is provided
322470 System time = 30/09/2012 00:03:54, Simulator time = 00:01:12 (04:01Z)
[Continuation log requested by user]
Running inside FSX on Windows 7
Module base=59E70000
329475 LUA.0: beginning "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules estVCposition.lua"
329475 LUA.0: ...rosoft Flight Simulator X\Modules estVCposition.lua:1
329475 LUA.0: Global: ipcPARAM = 0
329475 LUA.0: ended "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules estVCposition.lua"
614878 Sim stopped: average frame rate for last 292 secs = 18.3 fps
620619 LogOptions changed, now 00000000 00000001
[/CODE]

If I can get this to work I would like to place it in my ipcready.lua file hoping it will position and size the window for me any time the aircraft is loaded and ready to fly.

Link to comment
Share on other sites

I found a code sample in the Example LUA Plugins file called "TileSix" that showed how to position undocked windows and I thought this might save me having to manually drag and size my undocked virtual cockpit view each time. Based on that sample I added the code line below to a lua script I called testVCposition.lua and assigned a button to launch it. When I press the buttoin, no change to my VC view occurs.

Two questions:

1. Is the window you want to position actually available to be moved? i.e. is it already undocked? The facility can only work on existing top-level windows -- it cannot actually create them. FS actually creates a new window when you undock. (I wish I could ffind a way of undocking them automatically, but I can't).

2. If so, do you have the name correct? "Main Panel" is the name normally given to the main 2D instrument panel. I think the window you want is called "Virtual Cockpt - View 00". Try that. It works here.

Pete

Link to comment
Share on other sites

1. Is the window you want to position actually available to be moved? i.e. is it already undocked? The facility can only work on existing top-level windows -- it cannot actually create them. FS actually creates a new window when you undock. (I wish I could ffind a way of undocking them automatically, but I can't).

Yes

2. If so, do you have the name correct? "Main Panel" is the name normally given to the main 2D instrument panel. I think the window you want is called "Virtual Cockpt - View 00". Try that. It works here.

Sorry about the "Main Panel" in my code example above. The correct code did read "Virtual Cockpit" I copied an the wrong text into the post above.

However, having read your reply, I did find my error. It was not including the " - View 00" portion. I was under the mistaken impression that the view name had to only include the view's title and did not realize the it also required the numeric view identifier. All is working now.

Thanks!

Tom G.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.