homepage

DCS Dual Monitor setup, need help with lua script please

Posted By: Biggles07

DCS Dual Monitor setup, need help with lua script please - 10/17/12 04:15 PM

Greets all. Ok, decided to get off my arse and try out a dual monitor setup, with an old "Targa Visionary" 19' 1280x1024 LCD monitor gathering dust for many years, and my 'main' Samsung T240 SyncMaster 24' 1920x1200 screen. got them connected late last night but I'm having trouble. Please bear in mind this is the first time I have ever tried to setup two monitors together, I know nothing about scripts or programming, and I don't know WTF I am doing lol. smile

The 19' Targa is positioned to the direct 'lower' left, both physically and virtually in the Windows 7 'screen resolution' setup screen. I have set the option to make the left 19' 1280x1024 as my 'main display'.

What I want is to have the Left MFCD in DCS A10C on the entire 19' 1280x1024 monitor to the left (including the surrounding OSB Buttons if possible) and I want this to be static (IE no movement with TrackIR), with my entire pit on the 1920x1200 screen as it would normally be with single screen, as per usual.

Now, I read this guide @ED forums and it has just confused me more lol http://forums.eagle.ru/showthread.php?t=60815

I've managed to make a 'lua file' with 'Notepad++' (that's an impressive achievement, for me hehe) and named it, then plonked it in the Monitor setup folder. I based it on the 'Camera+LMFCD.lua' stock option. Confirm it shows up as an option, 'Samsung+Targa.lua'. I have also set my left monitor as 'main display' in the Windows 7 Control Panel 'Screen Resolution' options. When I press 'Identify', the 24' monitor is numbered '1', with the 19' to the left '2'. Here is a 'copy paste' of it.

_ = function(p) return p; end;
name = _('Samsung+Targa.lua');
Description = 'Samsung Cockpit-Targa One Left MFCD';
Viewports =
{
Center =
{
x = 0;
y = 0;
width = 1920;
height = 1200;
viewDx = 0;
viewDy = 0;
aspect = 1.6;
}
}

LEFT_MFCD =
{
x = 1280;
y = 1024;
width = 1280;
height = 1024;
}

UIMainView = Viewports.Center


'Function', 'return' and 'end' are blue, numbers entered are orange (just my bold for emphasis on forum). I know for a fact the LEFT MFCD values are completely wrong and should not be as so lol, its just to check if the structure is right for having the 'Left MFCD' on the 19' 1280x1024, or other things I am doing wrong. Can you please tell me what numbers I should have in for the setup I want?

I looked at MadTommys 'my example.lua' example in 'step 2' but they are both widescreen 1680x1050 monitors (with right and left MFCDS on the physical monitor to the right), and I do not know how he gets the y numbers '105' (though I suspect its maybe the 'virtual position' of the monitor in Windows setup when you move it?) as well as the x width coordinates. He has both MFCDS on one monitor, and has 1680 (the normal width of his monitor)coordinate in the LEFT_MFCD = section, but in the RIGHT_MFCD = 2520. Both widths combined (4200) add up to more than the combined width of the two 1680 monitors (3360), which is confusing me dizzy (easily done in my case hahaha )

I know it is required to add the combined width and use the highest monitor height (x1200 in my case). I have chose that option in DCS (3200x1200), as well as the automatically calculated aspect ratio, and also disabled full screen in DCS options as directed.

So, to recap I'd like the entire Left MFCD on the physically and virtually left 19' 1280x1024 (static, with surrounding OSB's and unaffected by TrackIR), and my whole pit as per usual on the 24' 1920x1200 to its right.

Any help is greatly appreciated, and thanks kindly. smile just had an hour and a half and was too tired to try any more last night, I will give it another go this evening. From what I have seen though potential wise, I have been daft to wait so long to do it.....It will make life a lot easier instead of squinting at zoomed MFCDS all the time hehe. Think I will try the same with BS2 once I understand how its done.

Cheers!







Posted By: JAMF

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 05:47 PM

Originally Posted By: Biggles07
I looked at MadTommys 'my example.lua' example in 'step 2' but they are both widescreen 1680x1050 monitors (with right and left MFCDS on the physical monitor to the right), and I do not know how he gets the y numbers '105' (though I suspect its maybe the 'virtual position' of the monitor in Windows setup when you move it?) as well as the x width coordinates. He has both MFCDS on one monitor, and has 1680 (the normal width of his monitor)coordinate in the LEFT_MFCD = section, but in the RIGHT_MFCD = 2520. Both widths combined (4200) add up to more than the combined width of the two 1680 monitors (3360), which is confusing me dizzy (easily done in my case hahaha )


Click to reveal..


He has both MFDs displayed on the screen, but vertically centred. That's why he shifted the MFDs down his 2nd display by 105 pixels. (105 + 840 + 105 = 1050)

His main screen is 1680 wide, but his "left" MFD is only 840 wide. That makes the starting position of the "right" MFD on the X-axis 1680 + 840 = 2520.

(Actually, I wonder if more precise starting positioning should be 1681 and 2521?)


Originally Posted By: Biggles07
So, to recap I'd like the entire Left MFCD on the physically and virtually left 19' 1280x1024 (static, with surrounding OSB's and unaffected by TrackIR), and my whole pit as per usual on the 24' 1920x1200 to its right.



In your case, the MFD starts on x=0 and y=0, but then the main view hast to start on x=1280 (and y=0)

_ = function(p) return p; end;
name = _('Samsung+Targa.lua');
Description = 'Samsung Cockpit-Targa One Left MFCD';
Viewports =
{
Center =
{
x = 1280;
y = 0;
width = 1920;
height = 1200;
viewDx = 0;
viewDy = 0;
aspect = 1.6;
}
}

LEFT_MFCD =
{
x = 0;
y = 0;
width = 1024;
height = 1024;
}

UIMainView = Viewports.Center


The blue is the starting position on the X-axis for the main view (which might need to be 1281?)
Posted By: JAMF

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 05:55 PM

Oh, if you want to centre the MFD on the left screen, make the starting position on the Y axis at pixel 128.

1280 - 1024 = 256 (Screen width minus MFD width {when MFD is square, maximum MFD width is the screen height} )
256 / 2 = 128

LEFT_MFCD =
{
x = 128;
y = 0;
width = 1024;
height = 1024;
}
Posted By: Biggles07

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 06:31 PM

Thank you very much for the explanation JAMF, yer a Star. thumbsup You have explained it very well, and I think I understand it now. I'll grab something to eat and try it later on.

Cheers again mate. cheers
Posted By: komemiute

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 06:46 PM

Can I actually put as well both consoles on my secondary monitor?
Would they be still mouse-clickable?
Posted By: JAMF

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 07:18 PM

YW Biggles. smile I don't know if it is the right code, but I think that should be correct.

Komemiute, the image above in the spoiler tags shows the example of two MFDs on one screen. In the forum post linked by Gibbles, the last "spoiler" shows code to more than just the two MFDs on the screen. Don't know about clickable. What size screens do you use?

Going from 2 FullHD screens, the code should logically be:

_ = function(p) return p; end;
name = _('Tommy_v3');
Description = 'Two monitor configuration';
Viewports =
{
Center =
{
x = 0;
y = 0;
width = screen.width /2;
height = screen.height;
viewDx = 0;
viewDy = 0;
aspect = 1.6;
}
}
LEFT_MFCD =
{
x = 1920;
y = 0;
width = 960;
height = 960;
}
RIGHT_MFCD =
{
x = 2880;
y = 0;
width = 960;
height = 960;
}
UIMainView = Viewports.Center
Posted By: komemiute

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 07:33 PM

Ok my second monitor is 1024 wide for 1280 tall ( a normal 4/3 turned sidewise).

I'll check that thread. biggrin Thanks!
Posted By: JAMF

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 08:14 PM

}
LEFT_MFCD =
{
x = 1920;
y = 0;
width = 640;
height = 640;
}
RIGHT_MFCD =
{
x = 1920;
y = 640;
width = 640;
height = 640;
}
UIMainView = Viewports.Center
Posted By: Biggles07

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 09:16 PM

Sorted, JAMF! smile It is centred but 'cropped' a bit either side, but I understand that's because it has be the square it is in the pit and not an oblong or rectangle lol....I remember that much from school heheh. Gives a very good result though, and I'm quite 'wowed' by the novelty factor of it all. yep Map is a cinch to read now, and it really helps with seeing the TAD object symbology, as well as hooked object coordinates and SADL NET info etc in better detail. Squinting at tiny zoomed MFCD's is now a thing of the past! I have no idea why I didn't do this much sooner, would have saved muchos eyestrain. hahaha Couldn't have done it without you JAMF, thanks again. biggrin

I think I understand the formula now so I'll try some other resolutions as I'm taking quite a hefty FPS hit on a GTX580 1.5mb card, (with MFCD's set at 512 in options). Unless I'm mistaken I think I once saw some screenshots where people had set up MFCD's and the MFCD's were blank and missing from the pit itself on their centre screen. Is it possible to do this for the left MFCD in the pit on my 1920 monitor to maybe help framerates, and if so do you know how?

Posted By: JAMF

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 09:51 PM

No clue. I was only translating your setup to the code. oops


BTW, you could move the MFD to the left and use the 256pixels for RDR warn.

_ = function(p) return p; end;
name = _('Samsung+Targa.lua');
Description = 'Samsung Cockpit-Targa One Left MFCD';
Viewports =
{
Center =
{
x = 1280;
y = 0;
width = 1920;
height = 1200;
viewDx = 0;
viewDy = 0;
aspect = 1.6;
}
}

LEFT_MFCD =
{
x = 0;
y = 0;
width = 1024;
height = 1024;
}
RWR_SCREEN =
{
x = 1024;
y = 0;
width = 256;
height = 256;
}
UIMainView = Viewports.Center



...or if you want the radar warn at the lower right, change it's Y-value to 1024.
Posted By: Biggles07

Re: DCS Dual Monitor setup, need help with lua script please - 10/17/12 10:00 PM

Originally Posted By: JAMF
No clue. I was only translating your setup to the code. oops


BTW, you could move the MFD to the left and use the 256pixels for RDR warn.

_ = function(p) return p; end;
name = _('Samsung+Targa.lua');
Description = 'Samsung Cockpit-Targa One Left MFCD';
Viewports =
{
Center =
{
x = 1280;
y = 0;
width = 1920;
height = 1200;
viewDx = 0;
viewDy = 0;
aspect = 1.6;
}
}

LEFT_MFCD =
{
x = 0;
y = 0;
width = 1024;
height = 1024;
}
RWR_SCREEN =
{
x = 1024;
y = 0;
width = 256;
height = 256;
}
UIMainView = Viewports.Center



...or if you want the radar warn at the lower right, change it's Y-value to 1024.


Interesting! Cheers JAMF I'll give that a try too. thumbsup
Posted By: MadTommy

Re: DCS Dual Monitor setup, need help with lua script please - 10/19/12 11:24 PM

Glad you got it sussed. smile
© 2024 SimHQ Forums