VR/Tobii Eye/TIR Basic window blocking solution for 1.38/1.39/1.40
Posted: July 23rd, 2020, 6:25 pm
Note i don't have VR or Tobii Eye so i assume they will work as all 3 devices share the same game input lines and this works just fine on my Track IR 3, feel free to test and report back.
UPDATED 24/07/2020 - Added additional option 2 (best for VR) & 2 button window button example.
UPDATED 25/07/2020 - Option 2 amendments, lines 251 & 254. Line 256 added.
UPDATED 28/07/2020 - Re-written the post. No blocking option now, just turn head inside cab.
UPDATED 05/12/2020 - The same info below will also work in 1.39.
UPDATED 01/04/2021 - The same info below will also work in 1.40.
How this basic closed window block works (g_cam_window_block isn't used / can't be used):
With the window closed your head turns inside the cab, it doesn't unrealistically stop because you are looking at the drivers window. This way you have no sudden motion stop that may cause motion sickness etc.
You press driver open window button and your head is unblocked, it can now pass through the open window as normal.
You press driver close window button and your head is blocked, back to only turning head inside the cab.
That means you could open the window only 10% and be able to turn your head through it. So here is the correct way to use this option properly.
Example:
To open driver window to 50% only and therefore still be blocked, do this:
Quick press open driver window button.
When window is open enough, quick press close driver window button. This will stop the window motion and will block your head.
To open driver window to a point you think is ok to stick your head out, do this:
Quick press open driver window button.
When window is open enough, quick press open driver window button again. This will stop the window motion and will unblock your head.
To open driver window fully, do this:
Quick press open driver window button.
Your head isn't blocked whilst the window is opening, so just wait for it to finish.
Pressing close driver window button will always block your head no matter how open the window is. .
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 your controls.sii file.
NOTE: line numbers correct for game version 1.38 & 1.39:
Use these buttons to operate the windows, you'll need to substitute yours in lines 128/306/307/308/309 or keep these while testing this setup:
Open left window = keyboard.num1?0
Close left window = keyboard.num7?0
Open right window = keyboard.num3?0
Close right window = keyboard.num9?0
Note: You need to pick the correct line 128/251/254/256 for your current truck setup, LHD or RHD.
Set this value as the default:
config_lines[52]: "constant c_ht_on 1.000000"
Replace this line:
config_lines[128]: "mix headtren ``"
With this line for LHD trucks:
config_lines[128]: "mix headtren `keyboard.num1?0 & c_ht_on | keyboard.num7?0 & ! c_ht_on`"
OR
With this line for RHD trucks:
config_lines[128]: "mix headtren `keyboard.num3?0 & c_ht_on | keyboard.num9?0 & ! c_ht_on`"
Replace this line:
config_lines[250]: "mix headtron `c_ht_on & (trackiron | hmdon | eyeposon)`"
With this line:
config_lines[250]: "mix headtron `trackiron | hmdon | eyeposon`"
Replace this line:
config_lines[251]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
With this line for LHD trucks:
config_lines[251]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0), -1.45, 1.7 - c_ht_on)`"
OR
With this line for RHD trucks:
config_lines[251]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0), -1.7 + c_ht_on, 1.45)`"
Replace this line:
config_lines[254]: "mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
With this line for LHD trucks:
config_lines[254]: "mix headtrx `pow(-0.975 * ((headtryaw - (headtryaw * 2) + -abs(headtryaw)) * 0.5) * c_ht_on, 2) + clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0) + sel(hmdon, hmdx, 0), -0.1 + (headtryaw * 0.1) * c_ht_on, 0.8)`"
OR
With this line for RHD trucks:
config_lines[254]: "mix headtrx `pow(-0.975 * ((headtryaw - (headtryaw * 2) + abs(headtryaw)) * 0.5) * c_ht_on, 2) + clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0) + sel(hmdon, hmdx, 0), -0.8, 0.1 + (headtryaw * 0.1) * c_ht_on)`"
Replace this line:
config_lines[256]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), -0.2, 0.05) + sel(hmdon, hmdz, 0)`"
With this line for LHD trucks:
config_lines[256]: "mix headtrz `0.1 * ((headtryaw - (headtryaw * 2) + -abs(headtryaw)) * 0.5) * c_ht_on + clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0) + sel(hmdon, hmdz, 0), -0.35, 0.05)`"
OR
With this line for RHD trucks:
config_lines[256]: "mix headtrz `-0.1 * ((headtryaw - (headtryaw * 2) + abs(headtryaw)) * 0.5) * c_ht_on + clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0) + sel(hmdon, hmdz, 0), -0.35, 0.05)`"
config_lines[306]: "mix rwinopen `keyboard.num3?0 | semantical.rwinopen?0`"
config_lines[307]: "mix rwinclose `keyboard.num9?0 | semantical.rwinclose?0`"
config_lines[308]: "mix lwinopen `keyboard.num1?0 | semantical.lwinopen?0`"
config_lines[309]: "mix lwinclose `keyboard.num7?0 | semantical.lwinclose?0`"
Close and save.
Start game and see how it works.
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. Note each config line starts with a space in the controls.sii file.
For VR it's probably best to use two buttons on your wheel for open and close both windows.
You need to replace the window references (lwinclose/rwinclose/lwinopen/rwinopen) with your window open/close buttons.
As an example, I open left and right windows with joy.b21?0 and close left and right windows with joy.b20?0.
config_lines[306]: "mix rwinopen `joy.b21?0 | semantical.rwinopen?0`"
config_lines[307]: "mix rwinclose `joy.b20?0 | semantical.rwinclose?0`"
config_lines[308]: "mix lwinopen `joy.b21?0 | semantical.lwinopen?0`"
config_lines[309]: "mix lwinclose `joy.b20?0 | semantical.lwinclose?0`"
Copy your window buttons from your lines 306/307/308/309 into line 128 as highlighted in my example, replacing lwinclose/rwinclose/lwinopen/rwinopen with your buttons:
config_lines[128]: "mix headtren `lwinopen & c_ht_on | lwinclose & ! c_ht_on | rwinopen & c_ht_on | rwinclose & ! c_ht_on`"
And for your infomation, here's what my line 128 looks like (LHD & RHD in one line):
config_lines[128]: "mix headtren `joy.b21?0 & c_ht_on | joy.b20?0 & ! c_ht_on | joy.b21?0 & c_ht_on | joy.b20?0 & ! c_ht_on`"
But as i only use 2 buttons to open and close both windows, we can remove the 2 duplicates from that line:
config_lines[128]: "mix headtren `joy.b21?0 & c_ht_on | joy.b20?0 & ! c_ht_on`"
NOTE:
Because SCS use the camera files to switch on outside sounds when your head is ~100 degrees to the left (LHD) it means you can now hear these outside sounds through the closed window when your head is beyond 100 degrees and still inside the cab.
But, if like me, you drive with the windows slightly open to hear the outside world, its not that much of an issue.
Here's my better explanation of this issue if you're interested: viewtopic.php?p=22955#p22955
===============================================================================================
Game controls.sii file defaults 1.38/1.39/1.40: - Reset to these lines if required.
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[52]: "constant c_ht_on 1.000000"
config_lines[128]: "mix headtren ``"
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[254]: "mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
config_lines[256]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), -0.2, 0.05) + sel(hmdon, hmdz, 0)`"
UPDATED 24/07/2020 - Added additional option 2 (best for VR) & 2 button window button example.
UPDATED 25/07/2020 - Option 2 amendments, lines 251 & 254. Line 256 added.
UPDATED 28/07/2020 - Re-written the post. No blocking option now, just turn head inside cab.
UPDATED 05/12/2020 - The same info below will also work in 1.39.
UPDATED 01/04/2021 - The same info below will also work in 1.40.
How this basic closed window block works (g_cam_window_block isn't used / can't be used):
With the window closed your head turns inside the cab, it doesn't unrealistically stop because you are looking at the drivers window. This way you have no sudden motion stop that may cause motion sickness etc.
You press driver open window button and your head is unblocked, it can now pass through the open window as normal.
You press driver close window button and your head is blocked, back to only turning head inside the cab.
That means you could open the window only 10% and be able to turn your head through it. So here is the correct way to use this option properly.
Example:
To open driver window to 50% only and therefore still be blocked, do this:
Quick press open driver window button.
When window is open enough, quick press close driver window button. This will stop the window motion and will block your head.
To open driver window to a point you think is ok to stick your head out, do this:
Quick press open driver window button.
When window is open enough, quick press open driver window button again. This will stop the window motion and will unblock your head.
To open driver window fully, do this:
Quick press open driver window button.
Your head isn't blocked whilst the window is opening, so just wait for it to finish.
Pressing close driver window button will always block your head no matter how open the window is. .
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 your controls.sii file.
NOTE: line numbers correct for game version 1.38 & 1.39:
Use these buttons to operate the windows, you'll need to substitute yours in lines 128/306/307/308/309 or keep these while testing this setup:
Open left window = keyboard.num1?0
Close left window = keyboard.num7?0
Open right window = keyboard.num3?0
Close right window = keyboard.num9?0
Note: You need to pick the correct line 128/251/254/256 for your current truck setup, LHD or RHD.
Set this value as the default:
config_lines[52]: "constant c_ht_on 1.000000"
Replace this line:
config_lines[128]: "mix headtren ``"
With this line for LHD trucks:
config_lines[128]: "mix headtren `keyboard.num1?0 & c_ht_on | keyboard.num7?0 & ! c_ht_on`"
OR
With this line for RHD trucks:
config_lines[128]: "mix headtren `keyboard.num3?0 & c_ht_on | keyboard.num9?0 & ! c_ht_on`"
Replace this line:
config_lines[250]: "mix headtron `c_ht_on & (trackiron | hmdon | eyeposon)`"
With this line:
config_lines[250]: "mix headtron `trackiron | hmdon | eyeposon`"
Replace this line:
config_lines[251]: "mix headtryaw `sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0)`"
With this line for LHD trucks:
config_lines[251]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0), -1.45, 1.7 - c_ht_on)`"
OR
With this line for RHD trucks:
config_lines[251]: "mix headtryaw `clamp(sel(trackiron, trackiryaw, 0) + sel(hmdon, hmdyaw, 0) + sel(eyeposon, eyeposyaw, 0), -1.7 + c_ht_on, 1.45)`"
Replace this line:
config_lines[254]: "mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
With this line for LHD trucks:
config_lines[254]: "mix headtrx `pow(-0.975 * ((headtryaw - (headtryaw * 2) + -abs(headtryaw)) * 0.5) * c_ht_on, 2) + clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0) + sel(hmdon, hmdx, 0), -0.1 + (headtryaw * 0.1) * c_ht_on, 0.8)`"
OR
With this line for RHD trucks:
config_lines[254]: "mix headtrx `pow(-0.975 * ((headtryaw - (headtryaw * 2) + abs(headtryaw)) * 0.5) * c_ht_on, 2) + clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0) + sel(hmdon, hmdx, 0), -0.8, 0.1 + (headtryaw * 0.1) * c_ht_on)`"
Replace this line:
config_lines[256]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), -0.2, 0.05) + sel(hmdon, hmdz, 0)`"
With this line for LHD trucks:
config_lines[256]: "mix headtrz `0.1 * ((headtryaw - (headtryaw * 2) + -abs(headtryaw)) * 0.5) * c_ht_on + clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0) + sel(hmdon, hmdz, 0), -0.35, 0.05)`"
OR
With this line for RHD trucks:
config_lines[256]: "mix headtrz `-0.1 * ((headtryaw - (headtryaw * 2) + abs(headtryaw)) * 0.5) * c_ht_on + clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0) + sel(hmdon, hmdz, 0), -0.35, 0.05)`"
config_lines[306]: "mix rwinopen `keyboard.num3?0 | semantical.rwinopen?0`"
config_lines[307]: "mix rwinclose `keyboard.num9?0 | semantical.rwinclose?0`"
config_lines[308]: "mix lwinopen `keyboard.num1?0 | semantical.lwinopen?0`"
config_lines[309]: "mix lwinclose `keyboard.num7?0 | semantical.lwinclose?0`"
Close and save.
Start game and see how it works.
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. Note each config line starts with a space in the controls.sii file.
For VR it's probably best to use two buttons on your wheel for open and close both windows.
You need to replace the window references (lwinclose/rwinclose/lwinopen/rwinopen) with your window open/close buttons.
As an example, I open left and right windows with joy.b21?0 and close left and right windows with joy.b20?0.
config_lines[306]: "mix rwinopen `joy.b21?0 | semantical.rwinopen?0`"
config_lines[307]: "mix rwinclose `joy.b20?0 | semantical.rwinclose?0`"
config_lines[308]: "mix lwinopen `joy.b21?0 | semantical.lwinopen?0`"
config_lines[309]: "mix lwinclose `joy.b20?0 | semantical.lwinclose?0`"
Copy your window buttons from your lines 306/307/308/309 into line 128 as highlighted in my example, replacing lwinclose/rwinclose/lwinopen/rwinopen with your buttons:
config_lines[128]: "mix headtren `lwinopen & c_ht_on | lwinclose & ! c_ht_on | rwinopen & c_ht_on | rwinclose & ! c_ht_on`"
And for your infomation, here's what my line 128 looks like (LHD & RHD in one line):
config_lines[128]: "mix headtren `joy.b21?0 & c_ht_on | joy.b20?0 & ! c_ht_on | joy.b21?0 & c_ht_on | joy.b20?0 & ! c_ht_on`"
But as i only use 2 buttons to open and close both windows, we can remove the 2 duplicates from that line:
config_lines[128]: "mix headtren `joy.b21?0 & c_ht_on | joy.b20?0 & ! c_ht_on`"
NOTE:
Because SCS use the camera files to switch on outside sounds when your head is ~100 degrees to the left (LHD) it means you can now hear these outside sounds through the closed window when your head is beyond 100 degrees and still inside the cab.
But, if like me, you drive with the windows slightly open to hear the outside world, its not that much of an issue.
Here's my better explanation of this issue if you're interested: viewtopic.php?p=22955#p22955
===============================================================================================
Game controls.sii file defaults 1.38/1.39/1.40: - Reset to these lines if required.
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[52]: "constant c_ht_on 1.000000"
config_lines[128]: "mix headtren ``"
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[254]: "mix headtrx `clamp(sel(trackiron, trackirx, 0) + sel(eyeposon, eyeposx, 0), -0.1, 0.1) + sel(hmdon, hmdx, 0)`"
config_lines[256]: "mix headtrz `clamp(sel(trackiron, trackirz, 0) + sel(eyeposon, eyeposz, 0), -0.2, 0.05) + sel(hmdon, hmdz, 0)`"