Jump to content

Recommended Posts

Posted

Have a two monitor setup that I am trying to get working with a new lua file. Its two 1920x1080 with primary right. Want MFDs on left and AMPCD displayed when in Hornet. The new lua file is not showing in the monitor drop down in the settings page. I have edited AMPCD_init.lua with

 

dofile(LockOn_Options.common_script_path.."ViewportHandling.lua")
try_find_assigned_viewport("F18_AMPCD")

 

 

File MultiMonTest.lua saved to c:/users/USERNAME/SavedGames/DCS.openbeta/Config/MonitorSetup and also in the config/monitor folder on the install. The game is showing the many sample luas included which are in the main install path. I am doing something wrong, difficulty in figuring out what/where. Code and file below, if someone can help point out my error.

 

 

_  = function(p) return p; end;
name = _('MultiMonTest');
Description = 'Variable output of MFD to secondary (left hand) display'

	if unit_type == "FA-18C" then

		Viewports =
		{
			LEFT_MFCD =
			{
				x = 190;
				y = 0;
				width = 675;
				height = 540;
					aspect = 1027/768;
			}
			
			RIGHT_MFCD =
			{
				x = 1056;
				y = 0;
				width = 675;
				height = 540;
					aspect = 1024/768;
			}

			F18_AMPCD = 
			{
				x = 641;
				y = 541;
				width = 675;
				height = 540;
				aspect = 1024/768;
			}

			Center = 
			{
				x = 1921;
				y = 0;
				width = 1920;
				height = 1080;
				viewDx = 0;
				viewDy = 0;
				aspect = 1920/1080;
			}
		}

	else 
			Viewports =
		{
			LEFT_MFCD =
			{
				x = 0;
				y = 0;
				width = 960;
				height = 718;
					aspect = 1027/768;
			}
			
			RIGHT_MFCD =
			{
				x = 961;
				y = 0;
				width = 960;
				height = 718;
					aspect = 1024/768;
			}
			
			Center = 
			{
				x = 1921;
				y = 0;
				width = 1920;
				height = 1080;
				viewDx = 0;
				viewDy = 0;
				aspect = 1920/1080;
			}
		}
	end


UIMainView = Viewports.Center
GU_MAIN_VIEWPORT = Viewports.Center

 

MultiMonTest.lua

Posted (edited)

You forgot your commas |,| after your viewport definitions. This small error happens to me often.
I have not tested the actual functionality of your lua. It does appear now though.

spacer.png

 

MultiMonTestFail.lua

Edited by Bailey
Posted

Certainly cleared that up. It lists properly, at least.

 

First note was I have my primary on the right. So i had to change MFD address to -1920 etc. Still wont display anything on left panel though. Primary functions correctly. Will continue the trouble shooting from there. Thanks for the help, would have taken me ages to spot that missing comma.

Posted

A negative x-value doesn't look right. Your leftmost viewport should have x = 0 or a little more for a border. If your primary monitor is the rightmost one, its x-value must be a t least = the sum of all the width values of the other viewports that are side-by side. In order to validate your .lua, it's necessary to know the pixel size (e.g. 1440 x 1080) of the individual monitors, their location in the multimonitor setup, plus the allocation of viewports to monitors and the placement of the viewports on their monitors.
A drawing is the best way to communicate the layout and the positions of the various monitors and viewports.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

The windows assigned primary monitor is given X0 Y0, and for me its on my right. Looks like I will need to reassign primary/secondary monitor, dcs requires primary be leftmost.

Posted

Have everything setup. Mostly. Running into an issue with my IF / ELSE. Is this function no longer supported?

 

function  reconfigure_for_unit(unit_type)

 

If I include the function call the lua will not load and be seen by dcs. If I exclude it the conditional statement will not return true, and it falls back to ELSE. Wouldn't that make the alternative modifying each aircraft init file to have a differently named MFCD to deconflict screen space, since they are not all same size/shape/number?

Posted

"Running into an issue with my IF / ELSE. Is this function no longer supported? If I include the function call the lua will not load and be seen by dcs."
I am running into a similar issue. Idk how to use the function.

 

"Wouldn't that make the alternative modifying each aircraft init file to have a differently named MFCD to deconflict screen space, since they are not all same size/shape/number?" Yes, this is what I have done in the past.

Posted
17 hours ago, Xechran said:

The windows assigned primary monitor is given X0 Y0, and for me its on my right. Looks like I will need to reassign primary/secondary monitor, dcs requires primary be leftmost.

The primary monitor can be on the right. Code below does it on my two monitors.
It's not what I use of course as I want the primary screen directly in front of myself.

I created it only to demonstrate feasibility.
 

_  = function(p) return p; end;
name = _('Camera Right - Left + Right MFCD Left');
Description = 'Camera on 2nd Monitor at Right'
Viewports =
{
     Center = -- this viewport is for the primary DCS screen. "Center" is just a name, it can be anywhere.
     {
          x = 2560;
          y = 380;
          width  = 1680;
          height = 1050;
          viewDx = 0;
          viewDy = 0;
          aspect = 1680 / 1050;
     }
}
-- LEFT_MFCD is on top of RIGHT_MFCD
RIGHT_MFCD =
{
     x = 500;
     y = 710;
     width = 700;
     height = 700;
}

LEFT_MFCD =
{
     x = 500;
     y = 0;
     width = 700;
     height = 700;
}

UIMainView = Viewports.Center
GU_MAIN_VIEWPORT = Viewports.Center

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted (edited)

That makes the primarily used cockpit viewport appear on the right monitor, correct, and I have done so. But the windows/driver control system has to see the left most monitor as primary to assign that top left most position to 0,0. Just have to make that left hand monitor primary when entering DCS and revert when exiting. Not doing so in this example would put MFCD on the extant right hand monitor and push the cockpit view off to a non existent monitor further right of that.

 

 

Quote

"Running into an issue with my IF / ELSE. Is this function no longer supported? If I include the function call the lua will not load and be seen by dcs."
I am running into a similar issue. Idk how to use the function.

 

"Wouldn't that make the alternative modifying each aircraft init file to have a differently named MFCD to deconflict screen space, since they are not all same size/shape/number?" Yes, this is what I have done in the past.

 

 

Bummer.  Such a waste given the Devs included the function in the past.

Edited by Xechran
Posted

The forums being messed up is making this more difficult than it should be, I think.

 

 

Current issue. Have setup correctly with cockpit viewport on right hand monitor and generic left/right MFCD displayed on left monitor. Trying to setup Hornet. Have changed the size and position of Hornet MFCDs by giving them unique names in indicator viewport_config. Can not get the AMPCD to display at all. Renamed the center mfcd to Hornet_APMCD in AMPCD_viewport_config. Reverted back to Center_MFCD in both the indicator lua and the monitor lua. Is there new syntax or another file overriding this?

What stuck out to me was the extra code AMPCD has that other panels do not, including dedicated viewport definitions.

MultiMonTest.lua

Posted

Next thought. I see from google-chan that there has been discussion for years about moving the F10 map to a view port. Does not look like this was ever done? Would be handy to be able to find Lat Long coordinates marked on one screen and be able to enter that into the the Cat's CAP or Hog's CDU at the same time. Dread to think of what the perfmance hit would look like, unless the main viewport is continually rendered under the map as is?

  • Recently Browsing   0 members

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