TRACKIR Closed window block solutions 1.38 to 1.45 - Updated 12/08/2022

Make your game even better
Post Reply
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

TRACKIR Closed window block solutions 1.38 to 1.45 - Updated 12/08/2022

Post by JHTrucker » April 27th, 2020, 3:42 pm

TRACKIR closed window block.
SCS don't want TIR users to test if having a window block is a good idea or not.
After 15+ years of sim racing, using my trackir 3, where the left/right view is restricted to simulate being strapped into a race car, i never even thought this restriction was an issue. But SCS do? After driving ETS2 for the last 7 years unrestricted, i can now enjoy having to open the windows to look out, without issues.

Note: This isn't a mod to just drop into your mod manager, you'll also need to follow instructions and edit your controls.sii file.

UPDATED 22/05/2020 - Option 7 added - Using g_cam_window_block.
UPDATED 15/07/2020 - Option 7 updated to game version 1.38. You should re-read this post and apply all edits again.
UPDATED 26/07/2020 - Option 1 re-added and updated to game version 1.38.
UPDATED 16/09/2020 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 29/09/2020 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 25/10/2020 - Option 1 updated - Added Manual "basic" window operation as an alternative to the automated setup. https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 28/10/2020 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 19/11/2020 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 20/11/2020 - Option 7 updated: New menu mod 1.39 - Lines 72, 187 & 254 amended. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 553#p31553
UPDATED 25/11/2020 - Option 1 & 7 updated - New menu mod, Line 59 added and Line 187 amended. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 760#p31760
UPDATED 12/12/2020 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 529#p32529
UPDATED 14/12/2020 - Option 7 updated: Lines 57 & 60 added and line 128 amended. New menu mod v3. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 631#p32631
UPDATED 21/12/2020 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 29/01/2021 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 876#p25876
UPDATED 06/03/2021 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 229#p36229
UPDATED 28/03/2021 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 288#p37288
UPDATED 01/04/2021 - Just to confirm the below edits and required v1.39 mod all work on 1.40
UPDATED 11/04/2021 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 395#p38395
UPDATED 25/05/2021 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 633#p41633
UPDATED 29/07/2021 - Option 1 updated: https://roextended.ro/forum/viewtopic.p ... 738#p44738
UPDATED 29/07/2021 - Option 7 updated line edit numbers for game version 1.41 - No changes from previous edits.
UPDATED 31/07/2021 - Option 7 updated: New menu mod 1.41v4 - Lines 201(192), 204(195), 250(241), 254(245) & 128(463) amended. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 792#p44792
UPDATED 31/10/2021 - Nothing new, just updated the line numbers for game version 1.42. Existing 1.41 mod still works.
UPDATED 24/12/2021 - Nothing new, just updated the line numbers for game version 1.43. Existing 1.41 mod still works.
UPDATED 15/01/2022 - Option 7 updated: New menu mod V5 - Lines 276 & 494 amended and Lines 277 & 278 added. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 338#p49338
UPDATED 20/01/2022 - Option 7 updated: New menu mod V6 - Lines 276, 277 & 278 amended. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 467#p49467
UPDATED 15/02/2022 - Option 7 updated: Line 'config_lines[276]: "mix headtrx...' amended to better fix movement 'jumps'.
UPDATED 11/03/2022 - Option 7 updated: 'config_lines[199]: "mix camzoom...' & 'config_lines[275]: "mix headtrroll...' What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 113#p50113
UPDATED 15/05/2022 - Option 7 updated: New menu mods v6.1 & v7.0. '"mix camzoom...' amended. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 810#p50810
UPDATED 12/08/2022 - Option 7 updated: New menu mod v8.0. What's changed? Look here: https://roextended.ro/forum/viewtopic.p ... 719#p52719

Both 'Option 1' & 'Option 7' are no longer being developed as both of their 'window blocking' methods are available within my 'TrackIR Driving Enhancements' mod. So if you want more features to go with the same window blocking methods, try it out instead: https://roextended.ro/forum/viewtopic.p ... 457#p46457

Option 1 "The Best"
This is for a more realistic sim experience. Unlike Option 7, full TIR control inside and outside, g_cam_window_block, isn't used or required. Your head doesn't stop at the window, you can turn your head inside the cab up to 180 degrees left/right while the window is closed.
Option 1 can be found on this link: https://roextended.ro/forum/viewtopic.p ... 876#p25876

Options 2 to 6 (all very basic for 1.37): Archived on this post: https://roextended.ro/forum/viewtopic.p ... 256#p19256

Option 7: (works with ATS & ETS2 1.38 TO 1.45).
NOTE: This update won't work on game versions below 1.38!
Option 7 for game version 1.37 is archived below the 1.38 TO 1.45 setup, if you still want it.


How option 7 works.
TIR controls the internal view as normal. Perfect.
At the point of the drivers window TIR is disabled. Mouse/game controller function takes over and g_cam_window_block is used to check for block or not.
Once head is out of the open window you are controlling the game controller function with your head, your real head is looking left so the view auto rotates left. You can't look right without jumping back into the cab/drivers window area, because you are still looking left with your real head. You can't control the outside view.
For me, i only stick my head out of the window to view the rear of the trailer when reversing, if required, so that's exactly the view i get. You can't put your head through a closed window.

1.38+ update: If you require TIR control for the outside view, then you can now activate it "on demand".
Once the driver window is open you should then turn your real head far left to look along your truck/trailer (matching the auto rotated view) and then press the "driver window open button" (the window is already fully open anyway), this will trigger unblocking, now let go of the "driver window open button" and you'll have TIR control inside and outside whilst the window is open. Once you press "driver window close button", your head will once again be trapped inside the cab. Works the opposite for RHD trucks.

Note: look far left (for LHD) or look far right (for RHD) whilst a quick press of the "driver window open button" is designed to prevent accidentally triggering the unblock when windows are closed and you are quickly looking left/right at a junction, for example. You don't keep pressing the open window button once unblocked.

So that sounds good, but it isn't perfect, you can cheat, you can just turn your head to the window without opening it and do the unblock sequence, your head will then pass through the opening window. So, don't cheat, otherwise what was the point of having a block? Pressing "driver window close button" will always block you again.
We can only initiate game functions, open window for example, but we get no feedback from the game to say the window is actually fully open. Therefore this requires a degree of user compliance. Remember, SCS prevented TIR from working with g_cam_window_block, so auto turning TIR off is the only way to check if your head can pass through the window or not and we can't control it then.

Extra note: The following situations will cause the window blocking to fail, if 'On Demand' is activated, but pressing "driver window close button" will always fix this:-
When the window is fully open and TIR outside control has been activated:
If you then change trucks, the new truck will have windows closed by default, your head will pass through them. Press "driver window close button" to fix.
If you then upgrade your truck, you get it back with windows closed by default, your head will pass through them. Press "driver window close button" to fix.
If you then load a save that had the windows closed, your head will pass through them. Press "driver window close button" to fix.
They maybe other such situations. Just press "driver window close button" to fix them.
But if you don't activate TIR outside control first, then there shouldn't be any issues.

Whilst otherwise driving around normally, operating the windows, there should be no issues in regard to head passing through a closed window.

Note: As with mouse users, using g_cam_window_block, we can now also hear external sounds at the point where the block exists.
Here is my explanation to why this happens: https://roextended.ro/forum/viewtopic.p ... 955#p22955 and probably won't be fixed by SCS. Hope i'm wrong.

Menu 'Presets' drop down selector. *** New 31/07/2021 ***
Starting presets:
Disable Option 7 - Remove this mod - Standard TrackIR only
LHD ATS Defaults
LHD ETS Defaults
RHD ETS Defaults

If you select "Disable Option 7 - Remove this mod - Standard TIR only":
You can then remove the menu mod from your game profile (if a "no mods" profile is required - Multiplayer?) which reverts the code back to game standard TrackIR without having to default all the controls.sii line edits yourself.

Use one of the supplied presets to suit the truck you are currently driving.
The preset name will change to 'Custom' when you adjust the sliders. Click '+' and type a name for your preset, LHD SCS W900 or RHD DAF 2021 XG, for example.
All presets are saved in your games home directory (the one with your MOD folder).
Example - C:\Users\TEST\Documents\American Truck Simulator\MOD
Example - C:\Users\TEST\Documents\American Truck Simulator\eye_tracking_presets\xxxxxx.sii etc
This folder is only created by the game if you have a Tobii Eye device. If you have and don't use Tobii Eye now then just rename your original folder to "OLD eye_tracking_presets" to avoid problems.

You need to use the attached menu mod to make changes whilst in game.
Note: This is a modded Tobii Eye menu so ignore the balloon tips.
Image
The Menu mod is in English only and consists of:-

'Presets' drop down selector. *** New 31/07/2021 ***
Set menu sliders to just how you want them for any given truck and then save as a preset so you can quickly select it again.

Head Tracking - Enable / Disable - Mouse only when disabled.
This allows you to turn off head tracking whilst in game, if required only.

Window blocking for LHD Truck (Untick) or for RHD Truck (Tick).
Set this to suit your current truck, so window block works correctly.

Set window block point fine adjustment - Default 0.00
This slider is useful depending on what truck your are driving.
Basically, you can reduce the gap between TIR off and controller function auto rotating to the closed window.
Examples using game standard trucks -- ATS: Kenworth W900=0.00, Mack Anthem=5.00 & Others=1.10 -- ETS2: All 2.90

Outside TrackIR Control 'On Demand' activation options:
Enable x/y/z movement when 'On Demand' is activated. *** New 20/01/2022 ***
If you're using x/y/z movement, this will enable it to work outside the window.

1 - Look Far Left (LHD) / Right (RHD) & Press Open Drivers Window Button.
Look Far Left (LHD) / Right (RHD) Trigger Point - Default 4.5
2 - Look Far Left (LHD) / Right (RHD) & Look Up.
Look Up Trigger Point - Default 3.0 - Disable 0.0
Note: TrackIR is still active whilst you are looking at the menu's / world map etc and so if you don't use 'On Demand 2' you should set to disable to prevent unwanted triggering.

How far you can move towards passenger side (TIR x) - Default 0%
Move sideways slider increases up to 100% but only to the passenger side.
As long as LHD/RHD above is set correctly then you won't slide out of the door.
0% = disabled - 10% = game standard sideways movement.

Trigger 'Zoom View' when leaning forward (TIR z) - Default 0.9 *** Amended 15/05/2022 ***
As standard, when you lean forward you get closer to the dash.
This adds to that feature by allowing you to lean further forward and thereby trigger the in game zoom.
Set the slider to 0.0 to disable. The lower the value the sooner zoom will be triggered.
Feels right to lean forward to read up coming signs. One less button to press!
The zoom feature in game doesn't work with multimon_config.sii files with fixed FOV values, it therefore means this function will also not work with that setup.

Zoom Zone - Default 0.55
This allows you to set the area to the left & right that "triggering zoom view" is active to prevent unwanted head zoom at higher head angles.
5.00 = Up to 180 degrees left/right (head zoom always on).
2.5 = Up to 90 degrees left/right.
1.25 = Up to 45 degrees left/right (prevent head zoom when looking around at junctions etc).
0.55 = Up to 20 degrees left/right - Default - (good for head zooming to just read upcoming signs in front of you).

Reset Head Tracking - Re-centers your in game head.
Existing game function shown here for completeness.

*** New 12/08/2022 ***
TIR Option 7 Window Block Menu V6.1, V7.0 & V8.0.zip --> https://mega.nz/file/6gYz0aTC#vwESmpExA ... 3cMn6D3VWo
TIR Option 7 Window Block Menu V6.1.scs - Game Version 1.38 to 1.43
TIR Option 7 Window Block Menu V7.0.scs - Game Version 1.44
TIR Option 7 Window Block Menu V8.0.scs - Game Version 1.45
All mods have the same look and functions, just use the correct one for your game version along with all the required controls.sii edits.

Press SHIFT + NUMLOCK to access menu mod to make changes as required.
Press ESCAPE to go back to driving screen.

These are the option 7 file edits that are required along with the correct menu mod:
Note: If you have used one of my other "head blocking options" you should reset the modified lines in your controls.sii file with the game default ones, associated with that option, that i display at the bottom of each "head blocking post" before editing your file with these changes.

Edit with notepad/wordpad etc your config_local.cfg file, like so:

American/Euro Truck Simulator\profiles\Your Profile\config_local.cfg
uset g_cam_window_block "0.0" <-- change to 1.0 (must be 1.0 to work properly).
That will block your head at the window until the window is fully open.

***New 19/10/2022***
This supplied controls.sii file is a game default file with all current line edits applied to it.
By using this controls.sii file you'll need to re-setup all your game controls for buttons, keys, wheel, pedals, shifter & Force Feedback settings etc.
Or don't use this file and apply the below line edits to your controls.sii file instead. The choice is yours!
controls v6.1-v8.0 15-05-2022.zip --> https://mega.nz/file/uogg0ZYC#QApxMGqmw ... pjMgF2YLSU
NOTE: Read the Readme.txt file within the zip for further details.

Make a backup copy of controls.sii for safe keeping, just in case.

Note: The line numbers are different between game versions. The numbers shown are from my 1.44 version, yours may be different.
Just match the "mix name" and paste the highlighted part into the correct line number to suit your game version.

config_lines[58]: "constant c_ht_roll 1.000000" <-- Only if you want TIR head roll enabled otherwise keep on 0.000000

*** Amended 15/05/2022 ***
config_lines[205]: "mix camzoom `sign(clamp(deadzone((-trackir.device.position.z?0 * ! sign(abs(deadzone(trackiryaw, 0.249999)))) + (trackir.device.position.z?0 * sign(abs(deadzone(trackiryaw, 0.45)))) + (abs(trackir.device.position.x?0) * sign(abs(deadzone(trackiryaw, 0.2)))), (c_et_gv_inf * 0.95) * ((1 - abs(clamp(trackiryaw * 0.5, -0.125, 0.125))) * ! sign(abs(deadzone(trackiryaw, 0.224999))) + (0.875 + abs(deadzone(clamp(trackiryaw, -0.45, 0.45), 0.225) * 0.25)) * sign(abs(deadzone(trackiryaw, 0.225))))), -0.0, 1.0)) * ! cam5 * trackiron * sign(c_et_gv_inf) * ! sign(abs(deadzone(trackiryaw, c_etwm_yawsc * 0.2)))`"

*** Amended 31/07/2021 ***
config_lines[229]: "mix looklranaraw `deadzone(sel(trackiron, trackiryaw, 0), 0.5) * sign(c_et_gv_ext)`"

*** Amended 31/07/2021 ***
config_lines[232]: "mix looklranaspd `(looklranaraw * pow(trackiryaw,4) * 8) * sign(c_et_gv_ext)`"

config_lines[246]: "mix trackiron `c_et_head & trackir.device.active?0`"

*** Amended 31/07/2021 ***
config_lines[278]: "mix headtron `(sign(trackiron) * sign(c_et_head) * ((trackiryaw / 2.5) + ((0.3 - c_et_yawsc / 100) - (sign(c_et_pos) * (0.3 - c_et_yawsc / 100) * 2)) + sign(trackiron)) - ((trackiryaw / 2.5) + ((0.3 - c_et_yawsc / 100)-(sign(c_et_pos) * (0.3 - c_et_yawsc / 100) * 2)) + sign(trackiron)) * abs(sign(c_ht_on - 1)) + abs(sign(c_ht_on - 1)) * sign(trackiron) * sign(c_et_head)) * sign(c_et_gv_ext) + ! sign(c_et_gv_ext)`"

config_lines[279]: "mix headtryaw `sel(trackiron, trackiryaw, 0)`"

*** New 11/03/2022 ***
config_lines[281]: "mix headtrroll `sel(trackiron & c_ht_roll, trackirroll, 0) * (1.0 - ((clamp(headtryaw * 2.222, -0.0, c_ht_on) * ! c_et_pos) + (clamp(-headtryaw * 2.222, -0.0, c_ht_on) * c_et_pos)))`"

*** Amended 15/02/2022 ***
config_lines[282]: "mix headtrx `(((clamp(trackirx, -clamp(c_et_hv_res, -0.0, 0.1), c_et_hv_res) * (1.0 - clamp(headtryaw * 2, -0.0, 1.0)) * ! sign(deadzone(clamp(headtryaw, -0.0, 1.0), 0.5)) * ! c_et_pos) + (clamp(trackirx, -0.2, 0.0) * sign(deadzone(clamp(headtryaw, -0.0, 1.0), 0.6)) * c_et_hv_ac * ! c_et_pos) + (clamp(trackirx, -c_et_hv_res, clamp(c_et_hv_res, -0.0, 0.1)) * (1.0 - clamp(-headtryaw * 2, -0.0, 1.0)) * ! sign(deadzone(clamp(-headtryaw, -0.0, 1.0), 0.5)) * c_et_pos) + (clamp(trackirx, -0.0, 0.2) * sign(deadzone(clamp(-headtryaw, -0.0, 1.0), 0.6)) * c_et_hv_ac * c_et_pos)) * sign(c_et_gv_ext)) + (clamp(sel(trackiron, trackirx, 0), -0.1, 0.1) * ! sign(c_et_gv_ext))`"

*** Amended 20/01/2022 ***
config_lines[283]: "mix headtry `((clamp(sel(trackiron, trackiry, 0), -0.05, 0.05) * (1.0 - (clamp(headtryaw * 2, -0.0, sign(c_ht_on + ! c_et_hv_ac)) * ! c_et_pos) - (clamp(-headtryaw * 2, -0.0, sign(c_ht_on + ! c_et_hv_ac)) * c_et_pos))) * sign(c_et_gv_ext)) + (clamp(sel(trackiron, trackiry, 0), -0.05, 0.05) * ! sign(c_et_gv_ext))`"

*** Amended 20/01/2022 ***
config_lines[284]: "mix headtrz `((clamp(sel(trackiron, trackirz, 0), -0.25, 0.05) * (1.0 - (clamp(headtryaw * 2, -0.0, sign(c_ht_on + ! c_et_hv_ac)) * ! c_et_pos) - (clamp(-headtryaw * 2, -0.0, sign(c_ht_on + ! c_et_hv_ac)) * c_et_pos))) * sign(c_et_gv_ext)) + (clamp(sel(trackiron, trackirz, 0), -0.2, 0.05) * ! sign(c_et_gv_ext))`"

config_lines[285]: "mix headtrwmon ``"

If you want to have both windows open and close together using only the left open/close window buttons, then do this:

config_lines[339]: "mix rwinopen `(abs(sign(trackir.device.position.yaw?0 + 2)) * lwinopen?0)`"
And
config_lines[340]: "mix rwinclose `(abs(sign(trackir.device.position.yaw?0 + 2)) * lwinclose?0)`"

Then just assign buttons in game for open/close left window only, otherwise assign both windows buttons in game as normal.

*** Amended 15/01/2022 ***
config_lines[507]: "mix headtren `(lwinclose?0 * abs(sign(trackir.device.position.yaw?0 + 2)) * ! c_et_pos * ! c_ht_on) + (rwinclose?0 * abs(sign(trackir.device.position.yaw?0 + 2)) * c_et_pos * ! c_ht_on) + (((lwinopen?0 * sign(deadzone(trackir.device.position.yaw?0, (0.725 + (c_et_pitchsc * 0.05)))) * ! c_et_pos * c_ht_on) + (rwinopen?0 * sign(deadzone(-trackir.device.position.yaw?0, (0.725 + (c_et_pitchsc * 0.05)))) * c_et_pos * c_ht_on)) + (((sign(deadzone(trackir.device.position.yaw?0, (0.725 + (c_et_pitchsc * 0.05)))) * abs(sign(deadzone(trackir.device.position.pitch?0, (c_etwm_pitsc * 0.1)))) * ! c_et_pos * c_ht_on) + (sign(deadzone(-trackir.device.position.yaw?0, (0.725 + (c_et_pitchsc * 0.05)))) * abs(sign(deadzone(trackir.device.position.pitch?0, (c_etwm_pitsc * 0.1)))) * c_et_pos * c_ht_on)) * sign(c_etwm_pitsc))) * c_et_head * sign(c_et_gv_ext)`"

Close and save.

Start the game and open the menu, Press SHIFT + NUMLOCK.

Select a 'Preset' from the top drop down selector to suit the truck you're currently driving, LHD ATS Defaults, LHD ETS Defaults or RHD ETS Defaults and close the menu. That will set the defaults ready for you to try it out.

If it doesn't work, open the console, if you see one of the above lines in red text, you need to check that line again for a typo or a bad copy/paste.

Press SHIFT + NUMLOCK to access menu mod to make changes as required.
Press ESCAPE to go back to driving screen.

NOTE 1: Don't change any key bindings in the game menu's that state "complex".
The above edits are the reason those are "complex".


NOTE 2: Don't click 'Reset to default' at the bottom of the keys/buttons & controller menu's as that will remove the line edits!
You can click 'Force Feedback - Reset to defaults' if required.


That's it.

Example errors in your game.log.txt file and how to fix them:
This error will prevent it from working all together. It's caused by missing a " from the end of one of the line edits. Be careful when copy/pasting as this error can cause the game to reset the whole file back to game defaults.
00:00:04.454 : <ERROR> [unit] File '<C:/Users/TEST/Documents/American Truck Simulator | /home>/profiles/xxxx/controls.sii', line 519:
00:00:04.454 : <ERROR> Expecting string value, found '"'
00:00:04.454 : <ERROR> load_unit_tree() - Failed to load unit tree from file (/home/profiles/xxxx/controls.sii)

To locate the problem subtract 6 from the line number stated. For example: 519-6=513
So the error is caused by the line starting "config_lines[513]:..."
Re-copy/paste the matching "mix name..." line edit from your line 513 into your controls.sii file.

This error will allow some functions to work but the function associated to this line won't. The game will reset this line to game default.
00:00:04.453 : <ERROR> [inp] line "mix name...`" is malformed
Re-copy/paste the matching "mix name..." line edit into your controls.sii file.

===============================================================================================


Game controls.sii file defaults: - Reset to these lines if using VR or Tobii instead.
Or If you mess up the file, just delete it, the game will generate a new one that you can then add your keys to again.
"mix headtren ``"
"mix camzoom `semantical.camzoom?0`"
"mix looklranaraw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
"mix looklranaspd `looklranaraw * c_jrspeed`"
"mix trackiron `trackir.device.active?0`"
"mix headtron `c_ht_on & (trackiron | hmdon | eyeposon)`"
"mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
"mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
"mix headtrwmon `c_ht_on & (trackiron | hmdon | eyeposon)`"


===============================================================================================
===============================================================================================

Archived game version 1.37

UPDATED 27/05/2020 - Line 243 amended. Explanation here: https://roextended.ro/forum/viewtopic.p ... 697#p22697
UPDATED 29/05/2020 - Line 243 now optional LHD or RHD
UPDATED 05/06/2020 - Line 197 amended. Explanation here: https://roextended.ro/forum/viewtopic.p ... 517#p23517
UPDATED 17/06/2020 - Line 194 & 243 amended and line 250 added. Explanation here: https://roextended.ro/forum/viewtopic.p ... 333#p24333
UPDATED 27/06/2020 - Line 194 amended & Option 7 advanced edits added.

Option 7: (works with ATS/ETS2 1.37 - 22/05/2020).
You can't put your head through a closed window. No need to press & hold anything or setup key recording / timing like my previous options. Just open window(s) as required.

How option 7 works.

TIR controls the internal view as normal. Perfect.
At the point of the drivers window TIR is disabled. Mouse/game controller function takes over and g_cam is used to check for block or not.
Once head is out of the window you are controlling the game controller function with your head, your real head is looking left so the view rotates left.
You can't look right without jumping back into the cab/drivers window area, because you are still looking left with your real head.
For me, i only stick my head out of the window to view the rear of the trailer when reversing (if required) so that's exactly the view i get.
Here's a better explanation, if you need it: https://roextended.ro/forum/viewtopic.p ... 040#p24040

Some questions to ask yourself:
Do i want to drive like in real life where the majority of the time my head is inside the cab?
Do i need TIR controlled outside view?
What would i gain from changing the view to somewhere between pic 2 & pic 3?

Remember, we've had 7+ years of freely moving our TIR controlled head where we want, totally unrestricted, thereby forgetting that the window exists.
You should at least try option 7 by driving around for some time with the windows closed or 25% or so open (to hear fmod sounds) to get a feel for having this new restriction to your head movement. If you don't like this new restriction, then the "small" limitation of non TIR controlled outside view isn't the issue you might think it is.

Note: As with mouse users, using g_cam_window_block, we can now also hear external sounds through a closed window at the point where the block exists.
Here is my explanation to why this happens: https://roextended.ro/forum/viewtopic.p ... 955#p22955 and probably won't be fixed. Hope i'm wrong.

Option 7 edits:

Edit with notepad your config_local.cfg file, like so:

American/Euro Truck Simulator\profiles\Your Profile\config_local.cfg
uset g_cam_window_block "0.0" <-- change to 0.85
That will block your head at the window until the window is atleast 85% open.
Change to uset g_cam_window_block "1.0" if you'd rather the window was fully open.

Make a backup copy of controls.sii for safe keeping, just in case.

If you've previously used one of my options (1 to 5) then you need to reset two of the lines that they modified.
Edit controls.sii file with notepad, like so:

config_lines[53]: "constant c_et_head 0.000000" <-- change back to 1.000000

Replace this line:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45... ***different edits per options 1-5***
With the original line:
config_lines[244]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"

Now make these 4 option 7 line edits:

Replace this line:
config_lines[194]: "mix looklranaraw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
With this line:
config_lines[194]: "mix looklranaraw `deadzone(sel(trackiron, trackiryaw, 0), 0.5)`"

Replace this line:
config_lines[197]: "mix looklranaspd `looklranaraw * c_jrspeed`"
With this line:
config_lines[197]: "mix looklranaspd `looklranaraw * pow(trackiryaw,4) * 8`"

Pick 1 of the below 2 lines.
Replace this line:
config_lines[243]: "mix headtron `trackiron | hmdon | eyeposon`"
With this line (for LHD trucks):
config_lines[243]: "mix headtron `(trackiryaw / 2.5) + 0.30 + sign(trackiron)`"
OR
With this line (for RHD trucks):
config_lines[243]: "mix headtron `(trackiryaw / 2.5) - 0.30 + sign(trackiron)`"

Replace this line:
config_lines[250]: "mix headtrwmon `trackiron | hmdon | eyeposon`"
With this line:
config_lines[250]: "mix headtrwmon `0`"

Close and save.

Start game and see how it works.

If you want the look up & down movement when your head is out of the window (although not recommended), then edit like so:

Replace this line:
config_lines[195]: "mix lookudanaraw `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"
With this line:
config_lines[195]: "mix lookudanaraw `deadzone(sel(trackiron, trackirpitch, 0), 0.01)`"

Replace this line:
config_lines[199]: "mix lookudspd `lookudanaraw * c_jrspeed`"
With this line:
config_lines[199]: "mix lookudspd `lookudanaraw * 3`"

Close and save.

Start game and see how it works. If you don't like it, just reverse the above 2 line changes to stop up & down once again.

Just to be clear, your controls.sii file should contain these lines for option 7 to work:
config_lines[194]: "mix looklranaraw `deadzone(sel(trackiron, trackiryaw, 0), 0.5)`"
config_lines[195]: "mix lookudanaraw `deadzone(sel(trackiron, trackirpitch, 0), 0.01)`" ***optional & not recommended***
config_lines[197]: "mix looklranaspd `looklranaraw * pow(trackiryaw,4) * 8`"
config_lines[199]: "mix lookudspd `lookudanaraw * 3`" ***optional & not recommended***
config_lines[243]: "mix headtron `(trackiryaw / 2.5) + 0.30 + sign(trackiron)`" <--- LHD TRUCKS ONLY
or
config_lines[243]: "mix headtron `(trackiryaw / 2.5) - 0.30 + sign(trackiron)`" <--- RHD TRUCKS ONLY
config_lines[244]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
config_lines[250]: "mix headtrwmon `0`"

Option 7 advanced edits - 1.37 only and are optional:

The following are advanced settings to enhance the basic "option 7" above by incorporating extra line changes and a "TIR g_cam Menu 1.37" mod to give you in game changes rather than having to edit the controls.sii file all the time, if you change from LHD to RHD, for example.

Note: This is strictly game version 1.37 only, the mod will crash 1.38, i'll fix it when i get 1.38 after public release.

The Menu mod is in English only and consists of:-

Head Tracking - Enable / Disable - Mouse only when disabled.
This allow you to turn off head tracking whilst in game, if required only.

Window blocking for LHD Truck (Untick) or for RHD Truck (Tick).
Set this to suit your current truck, so window block works correctly.

Window block point fine adjustment if required - Default 0.00
This slider is useful depending on what truck your are driving.
But don't feel you have to change from the default value to enjoy having your head blocked.

Disable window blocking - Tick - (but why would you?).
When ticked, your head will pass through a closed window (SCS standard).
May be useful if your window is open and you want TIR control outside the cab.

Reset Head Tracking - Re-centers your in game head.
Existing game function shown here for completeness.

How far you can move towards passenger side (TIR x) - Default 0%
Move sideways slider increases up to 100% but only to the passenger side.
As long as LHD/RHD above is set correctly then you won't slide out of the door.
0% is game standard sideways movement.

Trigger 'Zoom View' when leaning forward (TIR z) - Default 1.3
As standard, when you lean forward you get closer to the dash.
This adds to that feature by allowing you to lean further forward and thereby trigger the in game zoom.
Set the slider to 0.0 to disable. The higher the value the sooner zoom will be triggered.
Feels right to lean forward to read up coming signs. One less button to press!
The zoom feature in game doesn't work with multimon_config.sii files with fixed FOV values, it therefore means this function will also not work with that setup.
TIR g_cam Menu 1.37.zip
Along with the menu mod are these extra required additions and changes to your controls.sii file.
Set these values as my option 7 defaults:
config_lines[53]: "constant c_et_head 1.000000"
config_lines[54]: "constant c_et_pos 0.000000"
config_lines[55]: "constant c_et_yawsc 0.000000"
config_lines[64]: "constant c_et_hv_res 0.000000"
config_lines[71]: "constant c_et_hv_sc 0.130000"
config_lines[76]: "constant c_et_hv_ac 0.000000"

Replace this line: (I used wheel button joy.b22?0 to zoom before changing to this way)
config_lines[180]: "mix camzoom `joy.b22?0 | semantical.camzoom?0`"
With this line:
config_lines[180]: "mix camzoom `keyboard.lshift?0 & keyboard.z?0 | trackiron & -trackir.device.position.z?0 * (c_et_hv_sc * 10)`"

Replace this line:
config_lines[211]: "mix trackiron `trackir.device.active?0`"
With this line:
config_lines[211]: "mix trackiron `c_et_head & trackir.device.active?0`"

Replace this line:
config_lines[243]: "mix headtron `(trackiryaw / 2.5) + 0.30 + sign(trackiron)`"
With this line: (it's massive!!!, so be careful when you copy/paste)
config_lines[243]: "mix headtron `sign(trackiron)*sign(c_et_head)*((trackiryaw/2.5)+((0.3-c_et_yawsc/100)-(sign(c_et_hv_ac)*(0.3-c_et_yawsc/100)*2))+sign(trackiron))-((trackiryaw/2.5)+((0.3-c_et_yawsc/100)-(sign(c_et_hv_ac)*(0.3-c_et_yawsc/100)*2))+sign(trackiron))*sign(c_et_pos)+sign(c_et_pos)*sign(trackiron)*sign(c_et_head)`"

Replace this line:
config_lines[247]: "mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
With this line:
config_lines[247]: "mix headtrx `clamp(sel(trackiron, trackirx, 0), -0.1 - 0.1 * c_et_hv_ac * c_et_hv_res * 10, 0.1 + c_et_hv_res - c_et_hv_res * c_et_hv_ac)`"

Close and save.

Start game and see how it works.
By default, TIR will be on, for LHD truck, window blocking & zoom feature.
In game Press SHIFT + NUMLOCK to access TIR g_cam Menu.
Press ESCAPE to go back to driving view.
Note: This menu is a modded Tobii Eye Menu, so you should ignore the balloon tips!

If it doesn't work, open the console, if you see one of the above lines you've just amended highlighted red then that line needs re-checking / typo / copy/paste again.

The menu mod is only required to make changes in game, so you can disable it once you are happy, if you need to.
If you like to drive LHD & RHD trucks then best to keep menu mod for easy change.

If, like me, you only use TIR yaw (look left/right) you can still use the zoom method by disabling in game "z" movement.
Enable "z" in your head tracking software.
Then do the following:

Replace this line:
config_lines[249]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), -0.2, 0.05) + sel(hmdon, hmdz, 0)`"
With this line:
config_lines[249]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), 0, 0) + sel(hmdon, hmdz, 0)`"

Your in game head won't move back and forward anymore but it will trigger zoom when you lean far enough forward.

===============================================================================================

Game controls.sii file defaults 1.37 - 22/05/2020: - Reset to these lines if using VR or Tobii instead.
Or If you mess up the file, just delete it, the game will generate a new one that you can then add your keys to again.
config_lines[53]: "constant c_et_head 1.000000"
config_lines[54]: "constant c_et_pos 0.000000"
config_lines[55]: "constant c_et_yawsc 1.000000"
config_lines[64]: "constant c_et_hv_res 1.000000"
config_lines[71]: "constant c_et_hv_sc 0.750000"
config_lines[76]: "constant c_et_hv_ac 0.000000"
config_lines[180]: "mix camzoom `semantical.camzoom?0`"
config_lines[194]: "mix looklranaraw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
config_lines[195]: "mix lookudanaraw `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"
config_lines[197]: "mix looklranaspd `looklranaraw * c_jrspeed`"
config_lines[199]: "mix lookudspd `lookudanaraw * c_jrspeed`"
config_lines[211]: "mix trackiron `trackir.device.active?0`"
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[247]: "mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
config_lines[249]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), -0.2, 0.05) + sel(hmdon, hmdz, 0)`"
config_lines[250]: "mix headtrwmon `trackiron | hmdon | eyeposon`"

===============================================================================================

Unrelated controls.sii file changes to enhance the trucking experience.
Moved to here: https://roextended.ro/forum/viewtopic.php?f=23&t=1825

===============================================================================================

ATS/ETS2 Additional non standard screen configurations to try for Single, Dual, Triple or Quad screen setups.
Link: https://roextended.ro/forum/viewtopic.p ... 460#p20460
You do not have the required permissions to view the files attached to this post.
Last edited by JHTrucker on April 22nd, 2023, 7:37 pm, edited 310 times in total.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR edits: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9919
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

TRACKIR Open/Close window block (possible) solutions.

Post by BenganJ » April 27th, 2020, 3:58 pm

@JHTrucker

Finally all is happening in the same gorgeous cam view! Great mind you have! Thanks!
As far as I see it, the main problem is to find two keys or buttons to assign, which isn't
that easy. I have all mine on my G27 wheel + Shifter already assigned, gotta find a way
here. Once again, THANKS!

EDIT: DAMN, come to think about it, in ATS I already have the keyboard keys z (open) and
x (close) assigned to that function of opening both windows at the same time! :D
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

TRACKIR Open/Close window block (possible) solutions.

Post by JHTrucker » April 27th, 2020, 4:10 pm

@BenganJ I have a usb number pad that i use as a button box next to wheel on the right. Shifter is on left and keyboard (out of reach) also.
Numpad has:
TIR on/off - Fuel
Lift drop truck - Lift drop trailer
Park brake - Diff lock

G27 Wheel left side:
TIR centre
Horn --> open windows***
Cruse control

G27 Wheel right side:
High beam
spare --> close windows***
Zoom

Flappy paddles are indicators.

Shifter:
Is start truck, wipers, lights, hitch up, advisor/map toggles, activate, hazard lights, beacon & world map.
So for me, who needs a horn? I then have two spare buttons on my wheel.

===============================================================================================

Archived from first post - options 1 to 6
If you have time on your hands and enjoy reading stuff, then there's plenty to read here, but it's left available for your info only. Options 1 or 7 in the first post are currently the best solutions.

Quick summary:
Options 1 to 5 default your in cab view to blocked at the window point. You then "unblock" to gain full movement as required.

DON'T USE OPTION 1 HERE... Option 1 is unarchived and vastly updated here: viewtopic.php?p=25876#p25876


Option 1 can be automated and works well in my test (but hardest to setup), see extensive write up!
You can't put your head through a closed window.
I use H shifter on my G27 and have to set "shifter layout behavior" to "simple + warning sounds" instead of "advanced" otherwise my gears change to neutral and grind every time the console pops open for a split second to change blocked or unblocked state.
Also, drag the bottom right corner of the console over to the left to reduce it's size to make it less distracting.

Option 2 for a basic "press and hold" unblock button.
Note: You can put your head through a closed window when using an unblock button.

Option 3 for a basic "press and hold" unblock button whilst opening windows.
Note: You can put your head through a closed window when using an unblock button.

Option 4 for a basic "press and hold" unblock buttons whilst opening windows and unblock when selecting reverse on H shifter.
Note: You can put your head through a closed window when using an unblock button.

Option 5 for a basic "press and hold" unblock buttons whilst opening windows and unblock when selecting reverse on H shifter.
Also unblock when "press and hold" both window buttons at the same time.
Note: You can put your head through a closed window when using an unblock button.

Option 6 - Self control.
When driving down the road, do you veer off and run along the grass because the game doesn't stop you from doing that? No because you have full control of the steering wheel and choose how to drive.
So why turn your head far enough to put it through a closed window? Don't, you wouldn't do it in real life, so don't do it in game.
Conclusion, scs were right not to block, we should practice self control.

So you can try/test (options 1 to 5) having a window block to see if you agree with SCS not providing this function.

I'm using a Tobii eye track system variable for the option 1 block (needed a variable and this was handy), so if you have a Tobii don't do this.
I've removed VR head yaw movement, so VR won't work with this. NEW - VR & Tobii options at the bottom (untested).
g_cam_block isn't used (can't be used), so no need to set it.
All options are my preferred settings, feel free to modify them to suit your setup. You don't have to have both windows open at the same time for example. Scroll to bottom for some help info, more will be added in time.

Backup your controls.sii file. You'll need it back after test if not happy with the block.
Test with the simpler option 2, 3, 4 or 5 first to see if you like the idea of being blocked.


Option 1 (Scroll way down for options 2, 3, 4 and 5 and help info):
You need to set these two lines in your global config.cfg file.
uset g_developer "1"
uset g_console "1"

Edit controls.sii file.
NOTE: line numbers may be different, be sure to keep yours:

config_lines[53]: "constant c_et_head 1.000000" <-- change to 0.000000

Replace this line:
config_lines[244]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
With this line:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, c_et_head + 0.45)`"
Close and save.

Startup game and get to driving cab view.
Can you look around? Yes - No, check controls.sii headtryaw line for typo.
Is your left view blocked at the window? Yes
Open the window. Left view is still blocked? Yes
Now for the manual bit (it isn't automatic at this stage of the setup).
Console type c_et_head 1 enter and close console.
Can you now stick your head out of the window? Yes
Close the window.
Console type c_et_head 0 enter and close console.
Left view is back to being blocked at the window.

Basically, from now on, do this:
Open window, console type c_et_head 1 enter close console.
Close window, console type c_et_head 0 enter close console.

You'll either get sick of doing that or you'll not like being blocked in the first place and SCS were right all along.

We need the window position variable used to try to make this an automatic process. But i don't know what it is. Perhaps save file will tell us? I believe it saves the window state in there.

If you like doing the above, then read the next bit to make it a bit better.
Options 2, 3, 4 or 5 are best to start with.
Here is my way to automate the above window open/close/block/actions:
Use logitech profiler software that i use for my G27 wheel.
Record key strokes/timing and assign to a wheel key.
Export the profile and edit with notepad to change timing values to be exactly what is required.
Import the updated profile.
This post has the key timing info i used to test this: viewtopic.php?p=19423#p19423
Use the below work flow as an example of what i think should happen.

config_lines[299]: "mix rwinopen `keyboard.darrow?0 | semantical.rwinopen?0`"
config_lines[300]: "mix rwinclose `keyboard.uarrow?0 | semantical.rwinclose?0`"
config_lines[301]: "mix lwinopen `keyboard.darrow?0 | semantical.lwinopen?0`"
config_lines[302]: "mix lwinclose `keyboard.uarrow?0 | semantical.lwinclose?0`"

Using that above i want both windows to open at the same time so audio plays in both ears rather than one. So that code will be fine using up and down arrow keys.

LWMB = Left Wheel Middle Button - open window.
RWMB = Right Wheel Middle Button - close window.

Only LWMB or RWMB are pressed. The rest are recorded key strokes played back.

Quick press LWMB and the following happens:
Down arrow is pressed for 3 seconds (if that equals ~70% window open).
Down arrow is quick pressed again to stop window motion.
console c_et_head 1 enter close console.
The window is now open enough to put your head out.

Another Quick press LWMB and the following happens:
Down arrow is pressed for 3 seconds (100% window open).
Down arrow is quick pressed again to stop window motion.
console c_et_head 1 enter close console.
The window is now fully open to put your head out.

Quick press RWMB and the following happens:
console c_et_head 0 enter close console - to stop head being trapped!.
Up arrow is pressed for 3 seconds (if that equals ~30% window open from 100% open).
Up arrow is quick pressed again to stop window motion.
The window is now 30% open and you can't put your head out.

Another Quick press RWMB and the following happens:
console c_et_head 0 enter close console.
Up arrow is pressed for 3 seconds (window closed).
Up arrow is quick pressed again to stop window motion.
The window is now closed and you can't put your head out.

Quick list of window options:
LWMB -> 70% open -> RWMB -> closed.
LWMB -> 70% open -> LWMB -> fully open -> RWMB -> 30% open -> RWMB -> closed.

So you can have the windows closed and not be able to put your head out of the window.
Or you can have the windows open 30% to hear the outside world whilst not being able to put your head out of the window.
Or you can have the windows 70% open to hear the outside world and can put your head out of the window.
Or you can have the windows fully open to hear the outside world and still put your head out of the window.

The keys you need to record for the above.
Window open command:
"down"(3 sec)"down""tidle""c""_""e""t""_""h""e""a""d""space""1""enter""tidle"

Window close command:
"tidle""c""_""e""t""_""h""e""a""d""space""0""enter""tidle""up"(3 sec)"up"

(3 sec)=the duration to hold down the "down" or "up" arrow keys for ~70% open or ~30% closed followed by a further press to stop the motion.
Although you record the key presses slowly you do need to alter the timings for each key press otherwise the console will stay open for a few seconds and you have no control of your truck for that period!

Based on my G27 logitech profile pause values, here is what you should try to emulate (lower=faster):
Down key = 3000 (3 sec)
Down key = 66 (stop motion)
Up key = 3000 (3 sec)
Up key = 66 (stop motion)
Tidle key = 99 (open console)
Letter keys = 1 (c_et_head 0/1)
Enter key = 300 (to process command)
That gives me a split second for the console to open and close. The window (3 sec) are key presses and not part of the console process. I found that if the timings are too fast for "enter", "tidle", "up" & "down" then the process fails. Whereas the letter keys were as fast as possible.
If you use Logitech profiler software with a G27 wheel, see this post for the timings i used that you can copy/paste: viewtopic.php?p=19423#p19423

Note: When you first start the game your window state may not match closed. Just do the "open windows" action twice to sync the open/close actions provided by the available options here.


Option 2:
With this line change option your head is blocked until you press and hold joy.b20 (my G27 right wheel middle button).
So no need to use the console for this. Open window and whenever you need to look behind just press and hold button whilst moving your head to look outside.
Selecting reverse (H shifter) will give you full head movement. Optional.
This won't stop you putting your head through a closed window. Only option 1 with automated setup will do that.
Edit controls.sii file.
NOTE: line numbers may/will be different, be sure to keep yours:
Replace this line:
config_lines[244]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
or this line if you've already tried option 1:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, c_et_head + 0.45)`"
With this line:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & joy.b20?0, trackiryaw, 0))`"
Close and save.

Optional: Selecting reverse will unblock your head movement as well.
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & joy.b20?0 + joy.b15?0, trackiryaw, 0))`"

Replace joy.b20?0 with what suits you best.
Example: keyboard.space?0 for space bar.


Option 3:
With these line change options you open and close both windows at the same time. When opening the window you can also move your head out of the window but you can't when closing. When the window is fully open and you want to look behind, just press and hold the open window button while moving your head outside.
Yes, you can put your head through an opening window, but just watch it open before putting your head out.

Basically, these are the options you have:
This won't stop you from putting your head out of a closed window.
You don't do that in real life, so don't do it when using this option.
By default your view is blocked at the window.
Press and hold window open button will give you full head movement and open windows.

G27 left (joy.b21 / open) right (joy.b20 / close) wheel middle buttons.
Edit controls.sii file.
NOTE: line numbers may/will be different, be sure to keep yours:
config_lines[299]: "mix rwinopen `joy.b21?0 |semantical.rwinopen?0`"
config_lines[300]: "mix rwinclose `joy.b20?0 |semantical.rwinclose?0`"
config_lines[301]: "mix lwinopen `joy.b21?0 |semantical.lwinopen?0`"
config_lines[302]: "mix lwinclose `joy.b20?0 |semantical.lwinclose?0`"

config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & joy.b21?0, trackiryaw, 0))`"
Close and save.


Option 4:
The same as option 3 but here i can select reverse (H shifter) and have full head movement through the window, so i don't have to hold window open button at the same time as reversing and steering, although i should open the window first (selecting reverse with closed windows won't block you).
With these line change options you open and close both windows at the same time. When opening the window you can also move your head out of the window but you can't when closing. When the window is fully open and you want to look behind, just press and hold the open window button while moving your head outside or select reverse.
Yes, you can put your head through an opening window, but just watch it open before putting your head out.

Basically, these are the options you have:
This won't stop you from putting your head out of a closed window.
You don't do that in real life, so don't do it when using this option.
By default your view is blocked at the window.
Press and hold window open button will give you full head movement and open windows.
Selecting reverse (H shifter) will give you full head movement.
Selecting reverse (H shifter) will give you full head movement and open windows (optional).

G27 left (joy.b21 / open) right (joy.b20 / close) wheel middle buttons - Reverse (joy.b15) on H shifter.
Edit controls.sii file.
NOTE: line numbers may/will be different, be sure to keep yours:
config_lines[299]: "mix rwinopen `joy.b21?0 |semantical.rwinopen?0`"
config_lines[300]: "mix rwinclose `joy.b20?0 |semantical.rwinclose?0`"
config_lines[301]: "mix lwinopen `joy.b21?0 |semantical.lwinopen?0`"
config_lines[302]: "mix lwinclose `joy.b20?0 |semantical.lwinclose?0`"

config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & joy.b21?0 + joy.b15?0, trackiryaw, 0))`"
Close and save.

If you want the windows to automatically open when selecting reverse, do this:
config_lines[299]: "mix rwinopen `joy.b21?0 |joy.b15?0 |semantical.rwinopen?0`"
config_lines[301]: "mix lwinopen `joy.b21?0 |joy.b15?0 |semantical.lwinopen?0`"
Selecting reverse allows full head movement, may as well open windows ready for looking back.


Option 5:
The same as option 4 but if you press and hold both open & close window buttons you can look out if you turn your head. Handy if the window is already open halfway and you don't want to open anymore in order to look out for a quick glance, when you let go of the buttons you'll need to do a quick tap on one or both to stop the window motion if it starts.
Here i can select reverse (H shifter) and have full head movement through the window, so i don't have to hold window open button at the same time as reversing and steering, although i should open the window first (selecting reverse with closed windows won't block you).
With these line change options you open and close both windows at the same time. When opening the window you can also move your head out of the window but you can't when closing.
When the window is fully open and you want to look behind, just press and hold the open window button while moving your head outside or select reverse.
Yes, you can put your head through an opening window, but just watch it open before putting your head out.

Basically, these are the options you have:
This won't stop you from putting your head out of a closed window.
You don't do that in real life, so don't do it when using this option.
By default your view is blocked at the window.
Press and hold window open button will give you full head movement and open windows.
Selecting reverse (H shifter) will give you full head movement.
Selecting reverse (H shifter) will give you full head movement and open windows (optional).
Press and holding both window open and window close buttons will give you full head movement but windows will not move.

G27 left (joy.b21 / open) right (joy.b20 / close) wheel middle buttons - Reverse (joy.b15) on H shifter.
Edit controls.sii file.
NOTE: line numbers may/will be different, be sure to keep yours:
config_lines[299]: "mix rwinopen `joy.b21?0 |semantical.rwinopen?0`"
config_lines[300]: "mix rwinclose `joy.b20?0 |semantical.rwinclose?0`"
config_lines[301]: "mix lwinopen `joy.b21?0 |semantical.lwinopen?0`"
config_lines[302]: "mix lwinclose `joy.b20?0 |semantical.lwinclose?0`"

config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & joy.b21?0 + joy.b15?0, trackiryaw, 0)) + (sel(trackiron & joy.b20?0 & joy.b21?0, trackiryaw, 0))`"

Or rather than press and hold both open and close window buttons for quick glance, press and hold space bar instead in this example:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & joy.b21?0 + joy.b15?0, trackiryaw, 0)) + (sel(trackiron & keyboard.space?0, trackiryaw, 0))`"
Close and save.

If you want the windows to automatically open when selecting reverse, do this:
config_lines[299]: "mix rwinopen `joy.b21?0 |joy.b15?0 |semantical.rwinopen?0`"
config_lines[301]: "mix lwinopen `joy.b21?0 |joy.b15?0 |semantical.lwinopen?0`"
Selecting reverse allows full head movement, may as well open windows ready for looking back.

===============================================================================================

VR option (untested and may cause undesirable results):
Same as option 2 above but with VR instead of TRACKIR yaw.
config_lines[244]: "mix headtryaw `clamp(sel(hmdon, hmdyaw, 0), -1.45, 0.45) + (sel(hmdon & joy.b20?0 , hmdyaw, 0))`"

Same as option 3 & 4 above but with VR instead of TRACKIR yaw.
config_lines[244]: "mix headtryaw `clamp(sel(hmdon, hmdyaw, 0), -1.45, 0.45) + (sel(hmdon & joy.b21?0 + joy.b15?0, hmdyaw, 0))`"


TOBII eye option (untested and may cause undesirable results):
Same as option 2 above but with TOBII eye instead of TRACKIR yaw.
config_lines[53]: "constant c_et_head 1.000000"
config_lines[244]: "mix headtryaw `clamp(sel(eyeposon, eyeposyaw, 0), -1.45, 0.45) + (sel(eyeposon & joy.b20?0, eyeposyaw, 0))`"

Same as option 3 & 4 above but with TOBII eye instead of TRACKIR yaw.
config_lines[53]: "constant c_et_head 1.000000"
config_lines[244]: "mix headtryaw `clamp(sel(eyeposon, eyeposyaw, 0), -1.45, 0.45) + (sel(eyeposon & joy.b21?0 + joy.b15?0, eyeposyaw, 0))`"


How to config to suit your setup:
By default these setups will block your view at the window. NOTE: Option 2, 3, 4 & 5 - When unblocked, your head can still pass through the window regardless of window position. This is a "possible" solution and not a complete fix like the SCS mouse user block option.

If you don't know the name of the button you want to use, set that button to "horn" in game and then look in controls.sii for horn.
config_lines[279]: "mix horn `joy.b21?0 | semantical.horn?0`"
You can now copy your button name (joy.b21?0) to BUTTON in example here:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & BUTTON, trackiryaw, 0))`"
Unassign that button from horn or you'll hear the horn everytime you unblock and look out the window!

Pressing and holding an assigned BUTTON will allow your head to pass through the window. Like this:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & BUTTON, trackiryaw, 0))`"

Pressing and holding either assigned BUTTONS will allow your head to pass through the window. Like this:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & BUTTON1 + BUTTON2, trackiryaw, 0))`"

Pressing and holding both assigned BUTTONS will allow your head to pass through the window. Like this:
config_lines[244]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0), -1.45, 0.45) + (sel(trackiron & BUTTON1 & BUTTON2, trackiryaw, 0))`"
Last edited by JHTrucker on April 8th, 2021, 5:44 pm, edited 11 times in total.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR edits: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

TRACKIR Open/Close window block (possible) solutions.

Post by JHTrucker » April 27th, 2020, 11:53 pm

@BenganJ - Option 2 added.
viewtopic.php?p=19250#p19250
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR edits: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9919
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

TRACKIR Open/Close window block (possible) solutions.

Post by BenganJ » April 27th, 2020, 11:57 pm

@JHTrucker

Noted, but have so little time to test right now. It is good to have alternatives though! Thanks mate! :D
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

TRACKIR Open/Close window block (possible) solutions.

Post by JHTrucker » April 28th, 2020, 1:38 am

@BenganJ - Option 3 added.
viewtopic.php?p=19250#p19250
This would be my choice i think.

I don't want all this hard work lost inside this thread, if you want to test it before deciding if its worth moving it so it's more readily noticed by forum visitors, ok. Thanks.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR edits: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9919
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

TRACKIR Open/Close window block (possible) solutions.

Post by BenganJ » April 28th, 2020, 1:49 am

@JHTrucker

This is some really nicely done work mate, so I won't hesitate for one minute now
to move this to it's own topic, BUT in order for you to be able to maintain the first
post of that topic I want you to find a proper place for it and then create that first
post as a placeholder. You don't have to place any contents, just a text to indicate
it as a placeholder. Then I will move your main post in this topic to that new topic
and maybe add what is having any substance from here there too.

Just tell me when you have created the topic and where!
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: TRACKIR Open/Close window block (possible) solutions.

Post by JHTrucker » April 28th, 2020, 1:02 pm

Option 4 added.
viewtopic.php?p=19250#p19250
This would be my choice when i move to 1.37, it works very well in 1.36 without the window bits.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR edits: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9919
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: TRACKIR Open/Close window block (possible) solutions.

Post by BenganJ » April 28th, 2020, 2:14 pm

@JHTrucker

DAMN, you didn't stop there either! :lol: :lol: :lol: And I see that you advertise or link
to the new forum place in the old category too! Grand job, mate! :D
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
alonzam99
Posts: 100
Joined: April 17th, 2020, 2:47 pm

Re: TRACKIR Open/Close window block (possible) solutions.

Post by alonzam99 » April 28th, 2020, 2:47 pm

hey JHTrucker, thanks for the solutions for the Trackir window block solutino but can you make a video about how to use each method and how to automate it ?
because it is hard to me to understand from text.
thanks :)
Post Reply