Analogue look left/right/up/down auto center solution.
Posted: June 8th, 2020, 1:58 pm
Analogue look left/right/up/down auto center solution - works for interior driving view only (cam 1).
Note: g_cam_window_block doesn't work when using the auto center option. Button look options don't auto center.
You can enable this auto center option in game to swap between the standard camera movement that doesn't auto center and this one.
Example: Drive to the destination using auto center option and then switch to standard whilst maneuvering into the parking position.
Setup controller as normal in game, like so.
OPTIONS - CONTROLLERS - Keyboard+Controller
Pick your "Look up/down axis" & "Look left/right axis"
Adjust deadzones & axis mode as required.
Make a backup copy of controls.sii for safe keeping, just in case.
(American/Euro Truck Simulator 2\profiles\Your Profile\controls.sii)
Now edit with notepad your controls.sii file:
Do this for game version 1.38+ only (1.37 further down):
Change the following lines (line numbers correct for game version 1.38/1.39/1.40):
config_lines[250]: "mix headtron `c_ht_on`"
config_lines[251]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
config_lines[252]: "mix headtrpitch `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0) / 2, c_ud_dz)`"
Close and save
In game go to Options - keys & buttons - other - "Enable head tracking" - assign a key. New feature added to 1.38, thanks SCS.
I assigned to my xbox360 "press right stick button", so i have both look options contained on one stick.
In game, you enable or disable auto center option by pressing that assigned key to toggle enable or disable. No menu mod required!
If the view seems twitchy when centered, increase left/right and/or up/down deadzone in game options.
If you feel the left/right & up/down motion is too quick / sensitive then try replacing lines 251 & 252 with these two lines that are smoothed / less sensitive around the center point:
config_lines[251]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz)`"
config_lines[252]: "mix headtrpitch `deadzone(pow(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), 3), c_ud_dz)`"
If you'd rather keep the auto center view restricted to inside the cab only, to not cheat when using g_cam_window_block with the standard view, then here's two options:
Replace line 251 with this line to restrict left/right to 90 degrees using quick motion:
config_lines[251]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz) / 2`"
OR
Replace line 251 with this line to restrict left/right to 90 degrees using smoothed motion:
config_lines[251]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz) / 2`"
Here's a graph of what the original quick motion & smoothed motion looks like. Quick look back view for head tracking or my Analogue look left/right/up/down auto center solution - ATS & ETS2 1.38.
viewtopic.php?p=28304#p28304
======================================================================================================
If you want to use 'button look' instead of analogue gamepad then look at this, info provided by forum member danilozxf:
Demo video: viewtopic.php?p=28579#p28579
Download link: viewtopic.php?p=28585#p28585
======================================================================================================
Do this for game version 1.37 only:
Change the following lines (line numbers correct for game version 1.37):
config_lines[243]: "mix headtron `c_et_head`"
config_lines[244]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
config_lines[245]: "mix headtrpitch `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0) / 2, c_ud_dz)`"
Close and save
In game, you enable or disable auto center option by doing the following:
Enable - Console type c_et_head 1 enter close console.
Disable - Console type c_et_head 0 enter close console.
Or use the attached mod for ATS/ETS2 1.37 to tick and untick auto center as required.
Warning: Your game will crash if you use this mod with 1.38!!! Press SHIFT + NUMLOCK to access the modified menu (Eye Tracking Menu).
Press ESCAPE to go back to driving view.
If the view seems twitchy when centered, increase left/right and/or up/down deadzone in game options.
If you feel the left/right & up/down motion is too quick / sensitive then try replacing lines 244 & 245 with these two lines that are smoothed / less sensitive around the center point:
config_lines[244]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz)`"
config_lines[245]: "mix headtrpitch `deadzone(pow(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), 3), c_ud_dz)`"
If you'd rather keep the auto center view restricted to inside the cab only, to not cheat when using g_cam_window_block with the standard view, then here's two options:
Replace line 244 with this line to restrict left/right to 90 degrees using quick motion:
config_lines[244]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz) / 2`"
OR
Replace line 244 with this line to restrict left/right to 90 degrees using smoothed motion:
config_lines[244]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz) / 2`"
======================================================================================================
Original 1.37 controls.sii file unedited lines, should you require them:
config_lines[53]: "constant c_et_head 1.000000"
config_lines[243]: "mix headtron `trackiron | hmdon | eyeposon`"
config_lines[244]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
config_lines[245]: "mix headtrpitch `sel(trackiron, trackirpitch, 0) + sel(hmdon, hmdpitch, 0) + sel(eyeposon, eyepospitch, 0)`"
Original 1.38/1.39/1.40 controls.sii file unedited lines, should you require them:
config_lines[250]: "mix headtron `c_ht_on & (trackiron | hmdon | eyeposon)`"
config_lines[251]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
config_lines[252]: "mix headtrpitch `sel(trackiron, trackirpitch, 0) + sel(hmdon, hmdpitch, 0) + sel(eyeposon, eyepospitch, 0)`"
Note: g_cam_window_block doesn't work when using the auto center option. Button look options don't auto center.
You can enable this auto center option in game to swap between the standard camera movement that doesn't auto center and this one.
Example: Drive to the destination using auto center option and then switch to standard whilst maneuvering into the parking position.
Setup controller as normal in game, like so.
OPTIONS - CONTROLLERS - Keyboard+Controller
Pick your "Look up/down axis" & "Look left/right axis"
Adjust deadzones & axis mode as required.
Make a backup copy of controls.sii for safe keeping, just in case.
(American/Euro Truck Simulator 2\profiles\Your Profile\controls.sii)
Now edit with notepad your controls.sii file:
Do this for game version 1.38+ only (1.37 further down):
Change the following lines (line numbers correct for game version 1.38/1.39/1.40):
config_lines[250]: "mix headtron `c_ht_on`"
config_lines[251]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
config_lines[252]: "mix headtrpitch `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0) / 2, c_ud_dz)`"
Close and save
In game go to Options - keys & buttons - other - "Enable head tracking" - assign a key. New feature added to 1.38, thanks SCS.
I assigned to my xbox360 "press right stick button", so i have both look options contained on one stick.
In game, you enable or disable auto center option by pressing that assigned key to toggle enable or disable. No menu mod required!
If the view seems twitchy when centered, increase left/right and/or up/down deadzone in game options.
If you feel the left/right & up/down motion is too quick / sensitive then try replacing lines 251 & 252 with these two lines that are smoothed / less sensitive around the center point:
config_lines[251]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz)`"
config_lines[252]: "mix headtrpitch `deadzone(pow(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), 3), c_ud_dz)`"
If you'd rather keep the auto center view restricted to inside the cab only, to not cheat when using g_cam_window_block with the standard view, then here's two options:
Replace line 251 with this line to restrict left/right to 90 degrees using quick motion:
config_lines[251]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz) / 2`"
OR
Replace line 251 with this line to restrict left/right to 90 degrees using smoothed motion:
config_lines[251]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz) / 2`"
Here's a graph of what the original quick motion & smoothed motion looks like. Quick look back view for head tracking or my Analogue look left/right/up/down auto center solution - ATS & ETS2 1.38.
viewtopic.php?p=28304#p28304
======================================================================================================
If you want to use 'button look' instead of analogue gamepad then look at this, info provided by forum member danilozxf:
Demo video: viewtopic.php?p=28579#p28579
Download link: viewtopic.php?p=28585#p28585
======================================================================================================
Do this for game version 1.37 only:
Change the following lines (line numbers correct for game version 1.37):
config_lines[243]: "mix headtron `c_et_head`"
config_lines[244]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
config_lines[245]: "mix headtrpitch `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0) / 2, c_ud_dz)`"
Close and save
In game, you enable or disable auto center option by doing the following:
Enable - Console type c_et_head 1 enter close console.
Disable - Console type c_et_head 0 enter close console.
Or use the attached mod for ATS/ETS2 1.37 to tick and untick auto center as required.
Warning: Your game will crash if you use this mod with 1.38!!! Press SHIFT + NUMLOCK to access the modified menu (Eye Tracking Menu).
Press ESCAPE to go back to driving view.
If the view seems twitchy when centered, increase left/right and/or up/down deadzone in game options.
If you feel the left/right & up/down motion is too quick / sensitive then try replacing lines 244 & 245 with these two lines that are smoothed / less sensitive around the center point:
config_lines[244]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz)`"
config_lines[245]: "mix headtrpitch `deadzone(pow(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), 3), c_ud_dz)`"
If you'd rather keep the auto center view restricted to inside the cab only, to not cheat when using g_cam_window_block with the standard view, then here's two options:
Replace line 244 with this line to restrict left/right to 90 degrees using quick motion:
config_lines[244]: "mix headtryaw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz) / 2`"
OR
Replace line 244 with this line to restrict left/right to 90 degrees using smoothed motion:
config_lines[244]: "mix headtryaw `deadzone(pow(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), 3), c_lr_dz) / 2`"
======================================================================================================
Original 1.37 controls.sii file unedited lines, should you require them:
config_lines[53]: "constant c_et_head 1.000000"
config_lines[243]: "mix headtron `trackiron | hmdon | eyeposon`"
config_lines[244]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
config_lines[245]: "mix headtrpitch `sel(trackiron, trackirpitch, 0) + sel(hmdon, hmdpitch, 0) + sel(eyeposon, eyepospitch, 0)`"
Original 1.38/1.39/1.40 controls.sii file unedited lines, should you require them:
config_lines[250]: "mix headtron `c_ht_on & (trackiron | hmdon | eyeposon)`"
config_lines[251]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
config_lines[252]: "mix headtrpitch `sel(trackiron, trackirpitch, 0) + sel(hmdon, hmdpitch, 0) + sel(eyeposon, eyepospitch, 0)`"