VR/Tobii Eye/TIR Basic window blocking solution for 1.38/1.39/1.40

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

VR/Tobii Eye/TIR Basic window blocking solution for 1.38/1.39/1.40

Post by JHTrucker » 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.
no block.png
.
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)`"
Last edited by JHTrucker on April 1st, 2021, 7:20 pm, edited 24 times in total.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by BenganJ » July 23rd, 2020, 6:34 pm

@JHTrucker

This sounds as quite a normal behavior to me, might even implement it myself! Thank you! :good2: :victory: :dance4:
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
JHTrucker
Expert
Posts: 1357
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by JHTrucker » July 23rd, 2020, 6:46 pm

I kept this one separate from my TIR options because i felt VR and Tobii need head tracking on at all times to avoid motion sickness issues (i guess). So with VR you are blocked but as soon as you press the open window button you are free to move your head straight away regardless of how open the window is. User compliance required!.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
JHTrucker
Expert
Posts: 1357
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by JHTrucker » July 25th, 2020, 8:31 pm

First post updated.
Additional option 2 (best for VR) - Instead of your head stopping at the window point, it just keeps turning inside the cab when the window is closed. Once you open the window your head will move outside as normal.
This way you have no sudden motion stop that may cause motion sickness etc.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by BenganJ » July 25th, 2020, 8:53 pm

@JHTrucker

Sounds logical, but isn't bad at all for any of the head movement trackers, I think!
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
JHTrucker
Expert
Posts: 1357
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by JHTrucker » July 26th, 2020, 4:47 pm

@BenganJ - Absolutely, no unrealistic block at all is the best for all setups.
As this solution gives an SCS type window block from the start, some may prefer this, its SCS way so its perfect, i wanted to make the point that VR should really use this new option 2. It is of course working nicely on my trackir 3.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
JHTrucker
Expert
Posts: 1357
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by JHTrucker » July 28th, 2020, 8:14 pm

Re-written the post. No blocking option now, just turn your head inside the cab. The best solution.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
User avatar
BenganJ
Moderator
Posts: 9589
Joined: December 15th, 2018, 11:54 am
Location: Gothenburg, Sweden

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by BenganJ » July 28th, 2020, 8:18 pm

@JHTrucker

Thank you!
---------------------------------------------------------------------------------------------------------------------------------------------
System: Windows 8.1
Processor: Intel Core i7-4790@
Memory: 16GB
Graphics: ASUS GeForce GTX1660Ti
Image
User avatar
JHTrucker
Expert
Posts: 1357
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by JHTrucker » July 28th, 2020, 8:23 pm

@BenganJ - You shamed me into it... Now your turn... try it!
Just copy your controls.sii file as a backup first.
If scs do add g_cam for TIR i won't use it anyway... no block is best, TIR option 1 all the way for me.
multimon_config.sii files: viewtopic.php?p=17658#p17658
controls.sii edits: viewtopic.php?p=24744#p24744
TrackIR Driving Enhancements: viewtopic.php?p=46613#p46613
Extra Cameras: viewtopic.php?p=46034#p46034
alonzam99
Posts: 100
Joined: April 17th, 2020, 2:47 pm

Re: VR/Tobii Eye/TIR Basic window blocking solution for 1.38

Post by alonzam99 » July 29th, 2020, 8:55 pm

@JHTrucker - Is this method works as the same as the original SCS method ?
Post Reply