Jump to content

Petrovich AI window smck middle between my 2 monitor setup


hreich

Recommended Posts

Same here 😞

 

Autopilot indicator in top right, on 3rd monitor
Petrovich flight helper, not over to the left (not sure if correct or not)

Screen_210616_214904.jpg

 

 

 

Petrovich weapon helper not in centre viewport

Screen_210616_214856.jpg

 

Weapon sight not in centre viewport, LWin+H helper box on third monitor

Screen_210616_215059.png

 

 

Thanks


Edited by jonsky7
Link to comment
Share on other sites

Well this is the first few lines of 9K113_CAM_base_page.lua 

 

As the LALT-A Keybind is listed as "9k113 aiming profile on/off" I thought it was a good bet on being the file responsible for the sight view.

 

And from looking at it, it seems to me that it should be getting the center viewport information, but it isn't.

 

I've played around with the entries from ULX,ULY,SZX,SZY,GUI_scale = get_UIMainView() to aspect = SZX/SZY but nothing seemed to make any difference. I don't really know what I'm doing, was just hoping to hit the jackpot by guessing, but sadly no.

 

 

dofile(LockOn_Options.common_script_path.."elements_defs.lua")
dofile(LockOn_Options.script_path.."ASP17V/Indicator/ASP_17V_definitions.lua")

HUD_DEFAULT_LEVEL = 2
HUD_NOCLIP_LEVEL = HUD_DEFAULT_LEVEL - 1

ULX,ULY,SZX,SZY,GUI_scale = get_UIMainView()
local v = find_viewport ("GU_MAIN_VIEWPORT", "CENTER")
if v ~= nil then
	ULX = v.x
	ULY = v.y
	SZX = v.width
	SZY = v.height
else
	ULX = ULX
	ULY = ULY
	SZX = SZX
	SZY = SZY
end
aspect = SZX/SZY

SetScale(FOV)

HUD_OnlyX	   = LockOn_Options.screen.width / 100.0 -- 6.0
HUD_OnlyY 	   = LockOn_Options.screen.height / 100.0 --6.0

 


Edited by jonsky7
Link to comment
Share on other sites

I have found a workaround to fix both the 9k113 sight as well as the Petrovich crosshair. 

 

I use a stacked monitor setup with the top being my main and then a smaller screen below that for MFD outputs and things like the control indicators.   I was having the same issues with Petrovich's crosshair from the pilot seat (it would put it right between the two monitors) as well as the 9k113 when sighted in (it would split the resolution between both screens and be completely useless.  I managed to fix both with some tinkering (and help from a clever friend). 

 

The solution for both just require a couple of small .lua tweaks.  @jonsky7was on track for the 9k113 and the solution lies in the 9K113_CAM_base_page.lua.  The file first pulls your viewport that is defined in the monitors .lua and sets the width and height as SZX and SZY

ULX,ULY,SZX,SZY,GUI_scale = get_UIMainView()
local v = find_viewport ("GU_MAIN_VIEWPORT", "CENTER")
if v ~= nil then
	ULX = v.x
	ULY = v.y
	SZX = v.width
	SZY = v.height


However, the lines below this then ignore that and define the hud-size as your entire screen resolution, instead of using the SZX and SZY it defined.
 

HUD_OnlyX	   = LockOn_Options.screen.width / 100.0 -- 6.0
HUD_OnlyY 	   = LockOn_Options.screen.height / 100.0 --6.0

 

To fix the 9k113 view not showing up on your main (and only main) screen, you just have to change the Hud_OnlyX and Hud_OnlyY to reflect the SZX and SZY coordinates instead:
 

HUD_OnlyX	   = SZX / 100.0 -- 6.0
HUD_OnlyY 	   = SZY / 100.0 --6.0

 

so just change LockOn_Options.screen.width to SZX and LockOn_Options.screen.height to SZY and you're good to go.  

 

 

 

To change the location of the crosshair use it like a helmet sight as intended, you'll need to find the HelperAI_page_common.lua file in \dcsworld\mods\aircraft\mi-24p\cockpit\scripts\HelperAI.   Open the file and scroll to line 88 which should be where the crosshair is defined.  You will then insert a new line under crosshair.vertices as seen here:

 

local crosshair				= CreateElement "ceTexPoly"
crosshair.name				= "crosshair"
crosshair.material			= MakeMaterial("Mods/aircraft/Mi-24P/Textures/ai_crosshair.dds",{255,255,255,255})
crosshair.vertices			= simple_square(cross_size / 2.2)
crosshair.init_pos			= {0.01 * aspect, 0.5}       ------ add this line to define the position of the crosshair
crosshair.tex_coords		= default_tex_coords
crosshair.indices			= default_box_indices
if not is_vr then
	crosshair.controllers		= {{"show_crosshair"}}
else
	crosshair.controllers		= {{"show_crosshair_VR"}}
end
crosshair.h_clip_relation	= h_clip_relations.REWRITE_LEVEL
crosshair.level				= DEFAULT_LEVEL
if not is_vr then
	crosshair.screenspace		= ScreenType.SCREENSPACE_TRUE
end
crosshair.use_mipfilter		= true
Add(crosshair)

Once you have added the line, the two numbers will define where in your screen space you want to have it located.  On my setup, 0.01 and 0.5 puts it right in the middle of my main monitor.  You may have to make small adjustments to those numbers to tweak it to where you want it.  Save the file, do a backup and you're done. 

 

*bonus tip -> i also moved the Petrovich compass a handier position on my bottom screen to save real estate on my main (i also do this with the controls indicator and AP readouts).   In the same file (HelperAI_page_common.lua) that you adjusted the crosshair, you can find the coordinates to move the compass:

if not is_vr then
	compass_pos = {-0.10 * aspect, -0.5} --relative to screen center, 1 equals screen height afaik
else
	compass_pos = {0, -0.2}

Just change the 2 coordinate numbers (-0.10 and -0.5 in this case) and adjust until the compass sits where you want.  In this example, the compass is placed in the center of my bottom monitor.   I then have controls indicator to the left and the AP to the right.

 

Hope that helps.  Happy Hinding.


Edited by Deadseed
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Operator seat with the controls indicator, AP and compass on the 2nd lower monitor2 hind compass move.png

 

 

This is the 9k113 scope view after the lua edits

4 hind 9k113 fix.png

 

 

9k113 before the lua edits.  This setup meant that the actual thing i was trying to target was between the two monitors.

3 hind 9k113 before.png

 

 

This is the after of the crosshair adjustment.   Using the crosshair to look and target things much easier when it's actually on screen 🙂 

1 hind crosshair fix.png

 

Both fixes should work regardless of your screen setup.  You just need to adjust the X and Y until it's aligned where you want it.


Edited by Deadseed
Link to comment
Share on other sites

6 hours ago, Deadseed said:

I have found a workaround to fix both the 9k113 sight as well as the Petrovich crosshair. 

 

I use a stacked monitor setup with the top being my main and then a smaller screen below that for MFD outputs and things like the control indicators.   I was having the same issues with Petrovich's crosshair from the pilot seat (it would put it right between the two monitors) as well as the 9k113 when sighted in (it would split the resolution between both screens and be completely useless.  I managed to fix both with some tinkering (and help from a clever friend). 

 

The solution for both just require a couple of small .lua tweaks.  @jonsky7was on track for the 9k113 and the solution lies in the 9K113_CAM_base_page.lua.  The file first pulls your viewport that is defined in the monitors .lua and sets the width and height as SZX and SZY


ULX,ULY,SZX,SZY,GUI_scale = get_UIMainView()
local v = find_viewport ("GU_MAIN_VIEWPORT", "CENTER")
if v ~= nil then
	ULX = v.x
	ULY = v.y
	SZX = v.width
	SZY = v.height


However, the lines below this then ignore that and define the hud-size as your entire screen resolution, instead of using the SZX and SZY it defined.
 


HUD_OnlyX	   = LockOn_Options.screen.width / 100.0 -- 6.0
HUD_OnlyY 	   = LockOn_Options.screen.height / 100.0 --6.0

 

To fix the 9k113 view not showing up on your main (and only main) screen, you just have to change the Hud_OnlyX and Hud_OnlyY to reflect the SZX and SZY coordinates instead:
 


HUD_OnlyX	   = SZX / 100.0 -- 6.0
HUD_OnlyY 	   = SZY / 100.0 --6.0

 

so just change LockOn_Options.screen.width to SZX and LockOn_Options.screen.height to SZY and you're good to go.  

 

 

 

To change the location of the crosshair use it like a helmet sight as intended, you'll need to find the HelperAI_page_common.lua file in \dcsworld\mods\aircraft\mi-24p\cockpit\scripts\HelperAI.   Open the file and scroll to line 88 which should be where the crosshair is defined.  You will then insert a new line under crosshair.vertices as seen here:

 


local crosshair				= CreateElement "ceTexPoly"
crosshair.name				= "crosshair"
crosshair.material			= MakeMaterial("Mods/aircraft/Mi-24P/Textures/ai_crosshair.dds",{255,255,255,255})
crosshair.vertices			= simple_square(cross_size / 2.2)
crosshair.init_pos			= {0.01 * aspect, 0.5}       ------ add this line to define the position of the crosshair
crosshair.tex_coords		= default_tex_coords
crosshair.indices			= default_box_indices
if not is_vr then
	crosshair.controllers		= {{"show_crosshair"}}
else
	crosshair.controllers		= {{"show_crosshair_VR"}}
end
crosshair.h_clip_relation	= h_clip_relations.REWRITE_LEVEL
crosshair.level				= DEFAULT_LEVEL
if not is_vr then
	crosshair.screenspace		= ScreenType.SCREENSPACE_TRUE
end
crosshair.use_mipfilter		= true
Add(crosshair)

Once you have added the line, the two numbers will define where in your screen space you want to have it located.  On my setup, 0.01 and 0.5 puts it right in the middle of my main monitor.  You may have to make small adjustments to those numbers to tweak it to where you want it.  Save the file, do a backup and you're done. 

 

*bonus tip -> i also moved the Petrovich compass a handier position on my bottom screen to save real estate on my main (i also do this with the controls indicator and AP readouts).   In the same file (HelperAI_page_common.lua) that you adjusted the crosshair, you can find the coordinates to move the compass:


if not is_vr then
	compass_pos = {-0.10 * aspect, -0.5} --relative to screen center, 1 equals screen height afaik
else
	compass_pos = {0, -0.2}

Just change the 2 coordinate numbers (-0.10 and -0.5 in this case) and adjust until the compass sits where you want.  In this example, the compass is placed in the center of my bottom monitor.   I then have controls indicator to the left and the AP to the right.

 

Hope that helps.  Happy Hinding.

 

 

Thanks comrade!

Link to comment
Share on other sites

Just for info, the compass position Deadseed mentioned is at line 26-29

 

if not is_vr then
	compass_pos = {-0.10 * aspect, -0.5} --relative to screen center, 1 equals screen height afaik
else
	compass_pos = {0, -0.2}

 


Edited by jonsky7
Link to comment
Share on other sites

14 hours ago, Skunk 2-1 said:

Fixed the Crosshairs. But the AI Target list is still somewhere lost. Any clue, where I can correct the position of the AI Target list?

Cheers

 

for me the target list shows up in the same place as where i moved the compass to.  Since that was ideal for me i never needed to change it.  Not sure if that just worked out or if it had to do with moving the compass placement though.

Link to comment
Share on other sites

My 2 monitors are of a different pixel height. So when I apply the above fix the prtrovitch sight centers on my main screen but the pitch angle is reading about -20 when looking at the horizon. Anyone else have that issue or know where to set and adjustment? Petrovitch seems to be looking too low when I tell him to search for a target.

Thanks.

Link to comment
Share on other sites

24 minutes ago, demonesque said:

My 2 monitors are of a different pixel height. So when I apply the above fix the prtrovitch sight centers on my main screen but the pitch angle is reading about -20 when looking at the horizon. Anyone else have that issue or know where to set and adjustment? Petrovitch seems to be looking too low when I tell him to search for a target.

Thanks.

 

Take a look at this post, then:

 

 

Maybe it'll help.

Don't accept indie game testing requests from friends in Discord. Ever.

Link to comment
Share on other sites

3 hours ago, demonesque said:

My 2 monitors are of a different pixel height. So when I apply the above fix the prtrovitch sight centers on my main screen but the pitch angle is reading about -20 when looking at the horizon. Anyone else have that issue or know where to set and adjustment? Petrovitch seems to be looking too low when I tell him to search for a target.

Thanks.

 

You have to play with the numbers for your particular setup, deadseed used 0.01 and 0.5 for his particular setup.

 

The first number is left right, the second is up down.

 

But if you have your monitors side by side, try 0.0 instead of 0.5

Link to comment
Share on other sites

4 hours ago, jonsky7 said:

 

You have to play with the numbers for your particular setup, deadseed used 0.01 and 0.5 for his particular setup.

 

The first number is left right, the second is up down.

 

But if you have your monitors side by side, try 0.0 instead of 0.5

Thanks Jonsky. For side by side monitors a value of 0 seems to be correct. So my settings are (-.95 , 0) for reference of anyone else. Will test some more but seems better.

 

I am not a programmer but I cant figure why the * Aspect is there in the X dimention in the brackets. Do you know what theat is supposed to do? I have just got the numerals for X and Y and it works fine.....


Edited by demonesque
typo
  • Like 1
Link to comment
Share on other sites

On 6/18/2021 at 3:42 PM, horus-DCS said:

 

Thanks comrade!

Can somebody share files that fixes and move petrovich sight and 9k113 - so all are visible on my main monitor in side by side 2 monitor configuration with standard resolution 1920*1080 for each monitor?

I just tried to edit files, now i cant launch mi-24 - it crashes upon netering misisons..Where do you enter (-.95 , 0)

Is it here like this?  
crosshair.init_pos = {-0.9 * aspect, 0} ------ add this line to define the position of the crosshair  ?


Edited by hreich

[sIGPIC][/sIGPIC]

Pilot from Croatia

Link to comment
Share on other sites

On 6/28/2021 at 9:23 PM, hreich said:

Can somebody share files that fixes and move petrovich sight and 9k113 - so all are visible on my main monitor in side by side 2 monitor configuration with standard resolution 1920*1080 for each monitor?

I just tried to edit files, now i cant launch mi-24 - it crashes upon netering misisons..Where do you enter (-.95 , 0)

Is it here like this?  
crosshair.init_pos = {-0.9 * aspect, 0} ------ add this line to define the position of the crosshair  ?

 

 here:

 

image.png

 

 

Except yours will probably be a different number than -0.95 as my monitors are different sizes and i wanted it in the middle of screen 1. But start with that then modify.

 

 


Edited by deamonesque

[sIGPIC][/sIGPIC]

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...