Jump to content

[How To] Export ALL Indicators like MFCD via ViewPorts


icemaker

Recommended Posts

Still no go, MFCD's are still rendering in the top left corner of the primary monitor 2"x2". CDU, CMSC and clock are large and render in the top right of the secondary monitor???

 

My files are attached

 

Monitor

 

_ = function(p) return p; end;

name = _('Phills Wide Screen V2');

Description = 'Phills Wide Screen V2'

Viewports =

{

Center =

{

x = 0;

y = 0;

width = 1920;

height = 1080;

viewDx = 0;

viewDy = 0;

aspect = 1.77777777777778;

}

}

 

RIGHT_MFCD =

{

x = 3381;

y = 627;

width = 392;

height = 392;

}

 

LEFT_MFCD =

{

x = 1985;

y = 620;

width = 392;

height = 392;

}

 

DIGIT_CLOCK_SCREEN =

{

x = 3632;

y = 410;

width = 112;

height = 112;

}

 

CMSC_SCREEN =

{

x = 2986;

y = 396;

width = 260;

height = 260;

}

 

CDU_SCREEN =

{

x = 2555;

y = 63;

width = 242;

height = 242;

}

 

UIMainView = Viewports.Center

 

CDU

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

 

indicator_type = indicator_types.COMMON

used_render_mask = "interleave.bmp"

 

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT}

 

local x_size = 1

local y_size = 1

 

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

 

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

 

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

 

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

 

update_screenspace_diplacement(0)

 

function set_full_viewport_coverage(viewport)

 

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

 

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

vp = env.CDU_SCREEN

 

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to MFCD\n")

set_full_viewport_coverage(vp)

end

end

 

 

 

 

dofile(LockOn_Options.script_path.."CDU/indicator/CDU_pages.lua")

init_pageID = id_CDU_Pages.CDU_PAGE_OFF

 

CDU_preinit_files_path = LockOn_Options.script_path.."CDU/Indicator/Preinit/"

page_subsets = {}

dofile(LockOn_Options.script_path.."CDU/indicator/CDU_subsets_init.lua")

 

----------------------

pages = {}

pages_by_mode = {}

clear_mode_table(pages_by_mode, 10, 10, 29)

 

function get_page_by_mode(master, L2, L3, L4)

return get_page_by_mode_global(pages_by_mode,init_pageID,master,L2,L3,L4)

end

 

dofile(LockOn_Options.script_path.."CDU/indicator/CDU_pages_init.lua")

 

use_parser = false

 

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

 

indicator_type = indicator_types.COMMON

used_render_mask = "interleave.bmp"

 

 

 

CMSC

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

 

indicator_type = indicator_types.COMMON

 

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT}

 

local x_size = 1

local y_size = 1

 

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

 

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

 

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

 

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

 

update_screenspace_diplacement(0)

 

function set_full_viewport_coverage(viewport)

 

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

 

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

vp = env.CMSC_SCREEN

 

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to MFCD\n")

set_full_viewport_coverage(vp)

end

end

 

 

opacity_sensitive_materials =

{

"font_CMS"

}

 

-------PAGE IDs-------

id_Page =

{

PAGE_NULL = 0,

PAGE_OFF = 1,

PAGE_MAIN = 2

}

 

id_pagesubset =

{

MAIN = 0

}

 

page_subsets = {}

page_subsets[id_pagesubset.MAIN] = LockOn_Options.script_path.."CMSC/indicator/CMSC_page.lua"

 

----------------------

pages = {}

pages[id_Page.PAGE_MAIN] = {id_pagesubset.MAIN}

 

init_pageID = id_Page.PAGE_MAIN

 

Clock

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

 

indicator_type = indicator_types.COMMON

 

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT}

 

local x_size = 1

local y_size = 1

 

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

 

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

 

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

 

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

 

update_screenspace_diplacement(0)

 

function set_full_viewport_coverage(viewport)

 

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

 

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

vp = env.DIGIT_CLK_SCREEN

 

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to MFCD\n")

set_full_viewport_coverage(vp)

end

end

 

 

 

-------PAGE IDs-------

id_Page =

{

PAGE_OFF = 0,

PAGE_MAIN = 1

}

 

id_pagesubset =

{

MAIN = 0

}

 

page_subsets = {}

page_subsets[id_pagesubset.MAIN] = LockOn_Options.script_path.."DigitalClock/Indicator/DIGIT_CLK_page.lua"

 

----------------------

pages = {}

 

pages[id_Page.PAGE_OFF] = {}

pages[id_Page.PAGE_MAIN] = {id_pagesubset.MAIN}

 

init_pageID = id_Page.PAGE_OFF

use_parser = false

 

--- master modes

A10C_DIGIT_CLK_OFF = 0

A10C_DIGIT_CLK_MAIN = 1

 

------------------------------------

pages_by_mode = {}

clear_mode_table(pages_by_mode, 1, 0, 0)

 

function get_page_by_mode(master,L2,L3,L4)

return get_page_by_mode_global(pages_by_mode,init_pageID,master,L2,L3,L4)

end

 

pages_by_mode[A10C_DIGIT_CLK_OFF][0][0][0] = id_Page.PAGE_OFF

pages_by_mode[A10C_DIGIT_CLK_MAIN][0][0][0] = id_Page.PAGE_MAIN

 

MFCD's

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

dofile(LockOn_Options.script_path.."materials.lua")

dofile(LockOn_Options.script_path.."config.lua")

 

function GetScale()

return 1

end

dofile(LockOn_Options.script_path.."MFCD/indicator/MFCD_sizes.lua")

 

if LockOn_Options.flight.easy_radar then

render_target_always = true

purposes = {render_purpose.GENERAL,render_purpose.HUD_ONLY_VIEW,render_purpose.SCREENSPACE_OUTSIDE_COCKPIT}

else

render_target_always = false

purposes = {render_purpose.GENERAL,render_purpose.HUD_ONLY_VIEW}

end

 

indicator_type = indicator_types.COMMON

used_render_mask = "interleave.bmp"

 

screenspace_scale_initial = 6;

screenspace_diplacement = {0,0}

 

local x_size = size_k

local y_size = size_k

 

function update_screenspace_diplacement(zoom_value)

screenspace_scale = screenspace_scale_initial + zoom_value;

if screenspace_scale < 1 then

screenspace_scale = 1

end

local screen_height = 2.0;

local screen_width = screen_height * LockOn_Options.screen.aspect;

local scaled_width = SelfWidth * screenspace_scale

local scaled_height = y_size * scaled_width -- for indicator all sizes is function of width

scaled_width = x_size * scaled_width

 

screenspace_diplacement = { 0.5 * screen_width - 0.5 * scaled_width,

-0.5 * screen_height + 0.5 * scaled_height}

 

if disposition == 'L' then

screenspace_diplacement[1] = -screenspace_diplacement[1]

end

 

screenspace_diplacement_arcade = {screenspace_diplacement[1],

0.5 * screen_height - 0.5 * scaled_height}

 

end

 

update_screenspace_diplacement(0)

 

 

 

function set_full_viewport_coverage(viewport)

local w = LockOn_Options.screen.width

local h = LockOn_Options.screen.height

local a = LockOn_Options.screen.aspect

local x = (-1.0 + 2.0 * (viewport.x / w)) * a

local y = 1.0 - 2.0 * (viewport.y / h)

 

local width = (viewport.width / w) * a

local height = viewport.height / h

local scl_hgt_K = y_size * SelfWidth -- size always function of SelfWidth

local scl_wdt_K = x_size * SelfWidth -- size always function of SelfWidth

 

screenspace_scale_x = 2.0 * width / scl_wdt_K

screenspace_scale_y = 2.0 * height / scl_hgt_K

screenspace_diplacement = {x + width,

y - height}

 

screenspace_diplacement_arcade = screenspace_diplacement

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

 

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

if disposition == 'L' then

vp = env.LEFT_MFCD

else

vp = env.RIGHT_MFCD

end

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to MFCD\n")

set_full_viewport_coverage(vp)

end

 

 

I changed your monitor file.

vp = env.CDU_SCREEN in the *init.lua means you have to name it CDU_SCREEN in the monitor file too. The names must be the same in both files for each instrument.

You are welcome to my DCS A-10 server "Ugly Bastards".

Link to comment
Share on other sites

OK now

 

Found the changes in 1.0.0.9

 

in init lua files you have to change the function update_screenspace_diplacement and set_full_viewport_coverage by the new ones (see spoiler below)

 

 

 

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

 

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

 

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

 

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

 

update_screenspace_diplacement(0)

 

function set_full_viewport_coverage(viewport)

 

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

 

 

You need to change the sizes of your indicators because the aspect ratio has changed too for example CMSC is now 260 x 47.

 

I will release a new version of EMC to use this new changes.

 

Thanks abbath for the solution... :thumbup:

 

Thanks guys. I was having the same issue and scratching my head all night trying to figure this out. As mentioned, I've got to resize and rescale. Looking forward to the updated EMC!

ASUS Sabertooth 990FXA MB

AMD Phenom II X4 955BE @3.6 ghz

Noctua NH-U9B CPU fan

Corsair memory - 4 x 4gb

Samsung SSD 830 128gb

Seagate 1TB 7200 x3

XFX HD6850 graphics x2

Antec Eleven Hundred case

Antec SG-850 power supply

Viewsonic VX2433 (1920 x 1080)

Viewsonic VX2431 (1920 x 1080)

LG GH-22 optical drive

Razer Black Widow Ultimate keyboard

Logitech G500 mouse

Thrustmaster Warthog HOTAS #00016

CH Flight Rudder Pedals

Logitech ClearChat USB Headset

TrackIR v5

Windows 7 Home Premium x64

Link to comment
Share on other sites

Abbath,

 

Doesn't matter what I did as far as the names were concerned, all items sit in the top left corner of primary monitor including MFD's. Spent a couple of days getting this setup the way I like a week or so ago and 1.09 breaks it!

Ryzen 9 7950X3D - MSI MAG X670E TomaHawk MB, ASUS ROG Ryujin III 360 AIO

64gig Corsair DDR5@6000, Gigabyte GeForce RTX 4090 AORUS

Winwing Super Taurus, Orion2, TO / Combat panels, Collective with Topgun MIP

Winwing Skywalker pedals, NLR Boeing Mil Edition Simpit, Trackir

Link to comment
Share on other sites

Abbath,

 

Doesn't matter what I did as far as the names were concerned, all items sit in the top left corner of primary monitor including MFD's. Spent a couple of days getting this setup the way I like a week or so ago and 1.09 breaks it!

 

Did you use your old *init.lua files?

Dont use the old ones, copy the code i posted before in the vanilla *init.lua files and you are good to go.

You are welcome to my DCS A-10 server "Ugly Bastards".

Link to comment
Share on other sites

Did you use your old *init.lua files?

Dont use the old ones, copy the code i posted before in the vanilla *init.lua files and you are good to go.

That is what I did. Full install of a10 then pasted your code into the virgin init.lua files, now all my exports are working 100%. Thanks again!

Airdog

| Asus ROG Strix Z370-E Mobo | i7 8700K @ 4.7 | 32 GB DDR4@3200mhz | Gigabyte 2080Ti OC 11GB| Samsung M.2 960 Evo 250Gb and 500Gb | Win10 Pro | Hotas Warthog #02743 | Track IR 5 | Toshiba 47" 120hz LED | Acer 23" Touchscreen | HELIOS |Oculus Rift-S|

 

http://www.blackknightssquadron.com/

Link to comment
Share on other sites

I now have my MFD's, CMSP, CMSC, RWR and the Digital clock indicating ok on my second screen using Abbath's code.

 

I can't get the UHF frequency and UHF repeater to indicate, are these the files that i need to insert Abbath's code ?.

 

repeater_init.lua

 

preset_channel_init.lua

 

common_init.lua

 

Thanks..

Win 11 Home 64Bit, i7-13700K@5.2Ghz Water Cooled, 32 Gb RAM, PNY RTX4090, HP Reverb, PICO 4, Quest 3, Realsimulator FSSB R3, Thrustmaster Warthog HOTAS, MFG Crosswind Pedals.

Link to comment
Share on other sites

Still have issues with CMSC and MFD's. Notice the MFD's in the top left of the prim monitor and the enlarged CMSC??

 

Lua files attached.

 

See screen shot....

 

helios.jpg

 

Thanks for the help so far.

Phills Wide Screen V2.lua

CMSC_init.lua

MFCD_init.lua

Ryzen 9 7950X3D - MSI MAG X670E TomaHawk MB, ASUS ROG Ryujin III 360 AIO

64gig Corsair DDR5@6000, Gigabyte GeForce RTX 4090 AORUS

Winwing Super Taurus, Orion2, TO / Combat panels, Collective with Topgun MIP

Winwing Skywalker pedals, NLR Boeing Mil Edition Simpit, Trackir

Link to comment
Share on other sites

Ok, I now have the CDU and CMSC sorted. Doing a re-read of the info above, I found that the width and height sizings are considerably smaller.

 

Now my only prob is with the MFCD's...something in the init isn't right I gather?

Ryzen 9 7950X3D - MSI MAG X670E TomaHawk MB, ASUS ROG Ryujin III 360 AIO

64gig Corsair DDR5@6000, Gigabyte GeForce RTX 4090 AORUS

Winwing Super Taurus, Orion2, TO / Combat panels, Collective with Topgun MIP

Winwing Skywalker pedals, NLR Boeing Mil Edition Simpit, Trackir

Link to comment
Share on other sites

Ok, I now have the CDU and CMSC sorted. Doing a re-read of the info above, I found that the width and height sizings are considerably smaller.

 

Now my only prob is with the MFCD's...something in the init isn't right I gather?

 

Your MFCD_init.lua file doesn't look like the vanilla 1.1.0.9 file. Use the vanilla file and it should work right out of the box.


Edited by Abbath
  • Like 1

You are welcome to my DCS A-10 server "Ugly Bastards".

Link to comment
Share on other sites

Thanks Abbath, all good now....lots of resizing but good.

Ryzen 9 7950X3D - MSI MAG X670E TomaHawk MB, ASUS ROG Ryujin III 360 AIO

64gig Corsair DDR5@6000, Gigabyte GeForce RTX 4090 AORUS

Winwing Super Taurus, Orion2, TO / Combat panels, Collective with Topgun MIP

Winwing Skywalker pedals, NLR Boeing Mil Edition Simpit, Trackir

Link to comment
Share on other sites

Please could somebody give me a hand with the UHF radio display, i don't know where to insert Abbath's code.

 

Please could somebody provide an example on how to get them working.

 

The frequency status init.lua for example is a different format :-

 

dofile(LockOn_Options.script_path.."UHF_Radio/indicator/common_init.lua")

 

dofile(LockOn_Options.script_path.."UHF_Radio/indicator/indicators.lua")

indicator = indicators.FREQUENCY_STATUS

 

Im guessing it's something to do with the "common_init.lua" file where i insert Abbath's code, but not sure how i'd go about assigning the view ports:-

 

vp = env.UHF_FREQUENCY_STATUS

 

Many thanks...

Win 11 Home 64Bit, i7-13700K@5.2Ghz Water Cooled, 32 Gb RAM, PNY RTX4090, HP Reverb, PICO 4, Quest 3, Realsimulator FSSB R3, Thrustmaster Warthog HOTAS, MFG Crosswind Pedals.

Link to comment
Share on other sites

Question

 

Did you use your old *init.lua files?

Dont use the old ones, copy the code i posted before in the vanilla *init.lua files and you are good to go.

 

Abbath,

You really did some outstanding work figuring this out. Thanks. I have a questions though - your code is quite a bit smaller than that which was replaced. Are we going to lose anything because of that? I know it's a technical question and I probably won't understand the answer but I was surprised at how much smaller your code was.

 

Icemaker,

Sure did miss your EMC. Like S-77, I'd just spent a good number of days getting my configs tweaked and your EMC made the job so much easier. Having to manually position and scale them was not fun.

 

BTW - I'm using two 24" Viewsonics side-by-side with the Center viewport on the left and Loz's Helios panel on the right.

 

I am seriously impressed with the work you guys do to add capability to A-10. Good work and it's much appreciated!

 

John

ASUS Sabertooth 990FXA MB

AMD Phenom II X4 955BE @3.6 ghz

Noctua NH-U9B CPU fan

Corsair memory - 4 x 4gb

Samsung SSD 830 128gb

Seagate 1TB 7200 x3

XFX HD6850 graphics x2

Antec Eleven Hundred case

Antec SG-850 power supply

Viewsonic VX2433 (1920 x 1080)

Viewsonic VX2431 (1920 x 1080)

LG GH-22 optical drive

Razer Black Widow Ultimate keyboard

Logitech G500 mouse

Thrustmaster Warthog HOTAS #00016

CH Flight Rudder Pedals

Logitech ClearChat USB Headset

TrackIR v5

Windows 7 Home Premium x64

Link to comment
Share on other sites

Abbath,

You really did some outstanding work figuring this out. Thanks. I have a questions though - your code is quite a bit smaller than that which was replaced. Are we going to lose anything because of that? I know it's a technical question and I probably won't understand the answer but I was surprised at how much smaller your code was.

The code was rewritten by ED. They shortened it but it does the same as before.

"My" code is in fact a part of the mfcd_init.lua. That is the whole trick. There is not a single code line i wrote because i didn't want to reinvent the wheel. It was only a copy & paste orgy ;)

 

Compare the vanilla mfcd_init.lua files of 1.1.0.8 and 1.1.0.9 and you will understand what i mean.


Edited by Abbath

You are welcome to my DCS A-10 server "Ugly Bastards".

Link to comment
Share on other sites

My UHF lua

 

Please could somebody give me a hand with the UHF radio display, i don't know where to insert Abbath's code.

 

Please could somebody provide an example on how to get them working.

 

The frequency status init.lua for example is a different format :-

 

dofile(LockOn_Options.script_path.."UHF_Radio/indicator/common_init.lua")

 

dofile(LockOn_Options.script_path.."UHF_Radio/indicator/indicators.lua")

indicator = indicators.FREQUENCY_STATUS

 

Im guessing it's something to do with the "common_init.lua" file where i insert Abbath's code, but not sure how i'd go about assigning the view ports:-

 

vp = env.UHF_FREQUENCY_STATUS

 

Many thanks...

 

Here's my updated .lua for the UHF freq_status_init.lua

 

dofile(LockOn_Options.script_path.."UHF_Radio/indicator/common_init.lua")

purposes = {render_purpose.GENERAL}

screenspace_scale_initial = 3;

screenspace_diplacement = {0,0}

local x_size = 1

local y_size = 1

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

update_screenspace_diplacement(0)

function set_full_viewport_coverage(viewport)

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

vp = env.UHF_FREQUENCY_STATUS

 

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to CDU\n")

set_full_viewport_coverage(vp)

end

end

 

dofile(LockOn_Options.script_path.."UHF_Radio/indicator/indicators.lua")

indicator = indicators.FREQUENCY_STATUS

 

Make sure the control name in your monitor config .lua corresponds to the name I've highlighted in red.

 

John

ASUS Sabertooth 990FXA MB

AMD Phenom II X4 955BE @3.6 ghz

Noctua NH-U9B CPU fan

Corsair memory - 4 x 4gb

Samsung SSD 830 128gb

Seagate 1TB 7200 x3

XFX HD6850 graphics x2

Antec Eleven Hundred case

Antec SG-850 power supply

Viewsonic VX2433 (1920 x 1080)

Viewsonic VX2431 (1920 x 1080)

LG GH-22 optical drive

Razer Black Widow Ultimate keyboard

Logitech G500 mouse

Thrustmaster Warthog HOTAS #00016

CH Flight Rudder Pedals

Logitech ClearChat USB Headset

TrackIR v5

Windows 7 Home Premium x64

Link to comment
Share on other sites

Thanks for your help jamason56, the frequency status indicator is now up and running.

 

Hopefully once i get the UHF Repeater and UHF preset working i'll have a a "full house".

 

Thankyou ::thumbup:

Win 11 Home 64Bit, i7-13700K@5.2Ghz Water Cooled, 32 Gb RAM, PNY RTX4090, HP Reverb, PICO 4, Quest 3, Realsimulator FSSB R3, Thrustmaster Warthog HOTAS, MFG Crosswind Pedals.

Link to comment
Share on other sites

I got nothing. I am pretty sure I followed directions.

 

Here is the stuff:

 

Monitor Config:

_ = function(p) return p; end;

name = _('Scooter');

Description = 'Scooter'

Viewports =

{

Center =

{

x = 0;

y = 0;

width = 5040;

height = 1050;

viewDx = 0;

viewDy = 0;

aspect = 4.8;

}

}

 

RIGHT_MFCD =

{

x = 6521;

y = 29;

width = 380;

height = 380;

}

 

LEFT_MFCD =

{

x = 5098;

y = 29;

width = 380;

height = 380;

}

 

UHF_PRESET_CHANNEL =

{

x = 5787;

y = 447;

width = 35;

height = 35;

}

 

UHF_FREQUENCY_STATUS =

{

x = 5662;

y = 495;

width = 140;

height = 140;

}

 

UHF_REPEATER =

{

x = 5719;

y = 655;

width = 94;

height = 94;

}

 

DIGIT_CLOCK =

{

x = 5566;

y = 807;

width = 100;

height = 100;

}

 

CMSP =

{

x = 6118;

y = 62;

width = 270;

height = 270;

}

 

CMSC =

{

x = 5886;

y = 25;

width = 241;

height = 241;

}

 

RWR_SCREEN =

{

x = 5569;

y = 95;

width = 235;

height = 235;

}

 

UIMainView = Viewports.Center

 

 

RWR init:

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

 

indicator_type = indicator_types.COMMON

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT}

 

local x_size = 1

local y_size = 1

 

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

 

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

 

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

 

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

 

update_screenspace_diplacement(0)

 

function set_full_viewport_coverage(viewport)

 

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

 

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

vp = env.RWR_SCREEN

 

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to MFCD\n")

set_full_viewport_coverage(vp)

end

end

 

-------PAGE IDs-------

id_Page =

{

PAGE_OFF = 0,

PAGE_MAIN = 1,

PAGE_BIT = 2

}

 

id_pagesubset =

{

COMMON = 0,

MAIN = 1,

BIT = 2,

}

 

page_subsets = {}

page_subsets[id_pagesubset.COMMON] = LockOn_Options.script_path.."AN_ALR69V/Indicator/AN_ALR69V_COMMON_page.lua"

page_subsets[id_pagesubset.MAIN] = LockOn_Options.script_path.."AN_ALR69V/Indicator/AN_ALR69V_MAIN_page.lua"

page_subsets[id_pagesubset.BIT] = LockOn_Options.script_path.."AN_ALR69V/Indicator/AN_ALR69V_BIT_page.lua"

 

----------------------

pages = {}

 

pages[id_Page.PAGE_OFF] = {}

pages[id_Page.PAGE_MAIN] = {id_pagesubset.COMMON, id_pagesubset.MAIN}

pages[id_Page.PAGE_BIT] = {id_pagesubset.COMMON, id_pagesubset.BIT}

 

init_pageID = id_Page.PAGE_OFF

use_parser = false

 

--- master modes

A10C_ALR69V_OFF = 0

A10C_ALR69V_MAIN = 1

A10C_ALR69V_BIT = 2

 

------------------------------------

pages_by_mode = {}

clear_mode_table(pages_by_mode, 2, 0, 0)

 

function get_page_by_mode(master,L2,L3,L4)

return get_page_by_mode_global(pages_by_mode,init_pageID,master,L2,L3,L4)

end

 

pages_by_mode[A10C_ALR69V_OFF][0][0][0] = id_Page.PAGE_OFF

pages_by_mode[A10C_ALR69V_MAIN][0][0][0] = id_Page.PAGE_MAIN

pages_by_mode[A10C_ALR69V_BIT][0][0][0] = id_Page.PAGE_BIT

Link to comment
Share on other sites

Mine is working using the following

 

Monitor Config:

 

_ = function(p) return p; end;

name = _('helios');

Description = 'to suit gadrocs helios profile'

Viewports =

{

Center =

{

x = 0;

y = 0;

width = 2560;

height = 1440;

viewDx = 0;

viewDy = 0;

aspect = 1.77777777777778;

}

}

RIGHT_MFCD =

{

x = 1480;

y = 1502;

width = 380;

height = 380;

}

LEFT_MFCD =

{

x = 60;

y = 1502;

width = 380;

height = 380;

}

UHF_REPEATER =

{

x = 666;

y = 2157;

width = 102;

height = 21;

}

DIGIT_CLOCK =

{

x = 517;

y = 2267;

width = 115;

height = 115;

}

CMSP =

{

x = 1141;

y = 2236;

width = 329;

height = 66;

}

CMSC =

{

x = 827;

y = 1573;

width = 297;

height = 67;

}

RWR =

{

x = 515;

y = 1553;

width = 258;

height = 258;

}

UHF_PRESET_CHANNEL =

{

x = 311;

y = 2121;

width = 47;

height = 42;

}

UHF_FREQUENCY_STATUS =

{

x = 163;

y = 2233;

width = 214;

height = 45;

}

UIMainView = Viewports.Center

 

RWR Config:

 

dofile(LockOn_Options.common_script_path.."devices_defs.lua")

indicator_type = indicator_types.COMMON

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT}

local x_size = 1

local y_size = 1

function update_screenspace_diplacement(zoom_value)

local default_width = 0.5 * LockOn_Options.screen.height + (64 * zoom_value)

if default_width > LockOn_Options.screen.height then

default_width = LockOn_Options.screen.height

end

 

if default_width > 0.5 * LockOn_Options.screen.width then

default_width = 0.5 * LockOn_Options.screen.width

end

 

local default_height = (y_size/x_size) * default_width

local default_y = LockOn_Options.screen.height - default_height

local default_x = LockOn_Options.screen.width - default_width

 

dedicated_viewport = {default_x,default_y,default_width,default_height}

dedicated_viewport_arcade = {default_x, 0 ,default_width,default_height}

end

update_screenspace_diplacement(0)

function set_full_viewport_coverage(viewport)

dedicated_viewport = {viewport.x,

viewport.y,

viewport.width,

viewport.height}

dedicated_viewport_arcade = dedicated_viewport

purposes = {render_purpose.GENERAL,

render_purpose.HUD_ONLY_VIEW,

render_purpose.SCREENSPACE_OUTSIDE_COCKPIT,

render_purpose.SCREENSPACE_INSIDE_COCKPIT} -- set purposes to draw it always

render_target_always = true

end

-- try to find assigned viewport

local multimonitor_setup_name = "Config/MonitorSetup/"..get_multimonitor_preset_name()..".lua"

local env = {}

env.screen = LockOn_Options.screen

local f = loadfile(multimonitor_setup_name)

if f then

setfenv(f,env)

pcall(f)

 

local vp = nil

vp = env.RWR

 

if vp ~= nil then

dbg_print("ok we have directly assigned viewport to MFCD\n")

set_full_viewport_coverage(vp)

end

end

----------------------

rwr_symbols_bound = 0.027 -- coeff to limit indication on RWR when symbol can't be place on RWR entirely

-------PAGE IDs-------

id_Page =

{

PAGE_OFF = 0,

PAGE_MAIN = 1,

PAGE_BIT = 2

}

id_pagesubset =

{

COMMON = 0,

MAIN = 1,

BIT = 2,

}

page_subsets = {}

page_subsets[id_pagesubset.COMMON] = LockOn_Options.script_path.."AN_ALR69V/Indicator/AN_ALR69V_COMMON_page.lua"

page_subsets[id_pagesubset.MAIN] = LockOn_Options.script_path.."AN_ALR69V/Indicator/AN_ALR69V_MAIN_page.lua"

page_subsets[id_pagesubset.BIT] = LockOn_Options.script_path.."AN_ALR69V/Indicator/AN_ALR69V_BIT_page.lua"

----------------------

pages = {}

pages[id_Page.PAGE_OFF] = {}

pages[id_Page.PAGE_MAIN] = {id_pagesubset.COMMON, id_pagesubset.MAIN}

pages[id_Page.PAGE_BIT] = {id_pagesubset.COMMON, id_pagesubset.BIT}

init_pageID = id_Page.PAGE_OFF

use_parser = false

--- master modes

A10C_ALR69V_OFF = 0

A10C_ALR69V_MAIN = 1

A10C_ALR69V_BIT = 2

------------------------------------

pages_by_mode = {}

clear_mode_table(pages_by_mode, 2, 0, 0)

function get_page_by_mode(master,L2,L3,L4)

return get_page_by_mode_global(pages_by_mode,init_pageID,master,L2,L3,L4)

end

pages_by_mode[A10C_ALR69V_OFF][0][0][0] = id_Page.PAGE_OFF

pages_by_mode[A10C_ALR69V_MAIN][0][0][0] = id_Page.PAGE_MAIN

pages_by_mode[A10C_ALR69V_BIT][0][0][0] = id_Page.PAGE_BIT

Link to comment
Share on other sites

Hello Scooternutz

 

Please find attached my working init.lua files.

 

I've also included my option and monitor config file so that you can have a look at my co-ordinates.

 

I have a dual screen setup with a 1680X1050 mounted on top of a 1920X1080 touchscreen, i'm using "Captain Loz's" profile.

 

The two MFD's worked right away with V1.09 so they just needed resizing and moving to the correct co-ordinates.

 

AN_ALR69V_init.lua

 

CMSC_init.lua

 

CMSP_init.lua

 

DIGIT_CLK_init.lua

 

freq_status_init.lua

 

Loz Halios Profile.lua

 

options.lua

 

preset_channel_init.lua

 

repeater_init.lua

 

Im guessing that your using (x3) 1680x1050 monitors to give you that resolution.

 

Im not an expert with multimonitors and i know that you been using "multi" successfully for a while now, but i don't understand your "x" co-ordinates within your monitor config file.

 

You have a max "x" resolution of 5040, however the placement of many of your indicators in the "x" plane appear to be off screen.

 

Your "y" co-ords look better

 

Barrakoodas monitor config looks sensible.

 

Anyway hope my files might help...

 

Regards Gunner.....

  • Like 1

Win 11 Home 64Bit, i7-13700K@5.2Ghz Water Cooled, 32 Gb RAM, PNY RTX4090, HP Reverb, PICO 4, Quest 3, Realsimulator FSSB R3, Thrustmaster Warthog HOTAS, MFG Crosswind Pedals.

Link to comment
Share on other sites

Thanks Gunnergolly,

 

I will definitely try this tonight. I will have to plug my coordinate numbers in though. I am going to make the lua files from scratch using Notepad++ and copy your info them. If that doesn't work I will just copy your files directly into my directory.

 

My max res is 6040 to include my touch screen which is placed out to the right in the setup although it is physically below my main display. This was the only way I could get BS and A-10 to span properly so I could select the UI buttons. This is why the diplays appear off the screen. My flying screen is 5040x1080.

 

Scooter

 

P.S. I have had no luck placing the MFD. I even tried the default MFCD monitor config and nothing.

Link to comment
Share on other sites

Good to see that you have made some progress...

 

I understand your co-ordinates now, I should have read your signature properly !!!...

 

Yeah the scaling has been totally messed up and i had to spend a long time manually adjusting and resizing the exported indicators to fit the profile that i'm using.

 

Trouble that i'm having now is that V1.09 is really loading up video card (ATI 5870) and causing me problems. V1.08 use to run really smooth, i might start a thread asking other "windowed mode" multi monitor ATI users how their getting on with V1.09.

 

How does your Nvidia GTX 580 handle all those monitors performance wise ?...

 

Regards Gunner...

Win 11 Home 64Bit, i7-13700K@5.2Ghz Water Cooled, 32 Gb RAM, PNY RTX4090, HP Reverb, PICO 4, Quest 3, Realsimulator FSSB R3, Thrustmaster Warthog HOTAS, MFG Crosswind Pedals.

Link to comment
Share on other sites

It seems when I have a exported display not showing on the screen my FPS drops to single digits. Once I have them all on the 2nd screen I am in the 60s 70s. That is while running HELIOS.

 

I am dreading manually setting all these displays. It was bad enough with two MFDs.

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
  • Recently Browsing   0 members

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