Controls.sii file changes to enhance the trucking experience. First post Updated 22/03/2024

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

Re: Controls.sii file changes to enhance the trucking experience.

Post by JHTrucker » August 17th, 2023, 5:16 pm

Adjust your mirrors using your analogue 'look' thumbstick / joystick etc.
Original idea and code by forum member Nomadtales as shown here: viewtopic.php?p=60149#p60149
This post includes the fix that I supplied and a few extra tweaks to allow a more simplified setup.

Use your analogue thumbstick / joystick to look around in the cabin as usual.
Press and hold your new 'close mirror adjust' key/button and adjust the mirror with your 'look' thumbstick / joystick or press your new 'mirror reset' key/button.
Press and hold your new 'far mirror adjust' key/button and adjust the mirror with your 'look' thumbstick / joystick or press your new 'mirror reset' key/button.

Optional - Pressing 'close mirror adjust' or 'far mirror adjust' key/button will automatically instant turn your head towards that mirror.

In the line edits below replace:
joy.b1?0 with your preferred key/button for 'close mirror adjust'
joy.b2?0 with your preferred key/button for 'far mirror adjust'
joy.b3?0 with your preferred key/button for 'mirror reset'

"mix looklranaraw `! (cmirrorsel?0 | fmirrorsel?0) * deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"

"mix lookudanaraw `! (cmirrorsel?0 | fmirrorsel?0) * deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"

"mix cmirrorsel `joy.b1?0 | semantical.cmirrorsel?0`"

"mix fmirrorsel `joy.b2?0 | semantical.fmirrorsel?0`"

"mix mirroryawl `(cmirrorsel?0 | fmirrorsel?0) * deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"

"mix mirroryawr `(cmirrorsel?0 | fmirrorsel?0) * deadzone(sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"

"mix mirrorpitu `(cmirrorsel?0 | fmirrorsel?0) * deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"

"mix mirrorpitl `(cmirrorsel?0 | fmirrorsel?0) * deadzone(sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"

"mix mirrorreset `joy.b3?0 * (cmirrorsel?0 | fmirrorsel?0)`"

General note:
Using this method to adjust your mirrors may cause your truck to be shown in the mirror with missing parts.
If that happens, make this change:
Your Profile - config_local.cfg - uset g_baked_vehicle "0" (Game default "1")

----------

Optional - Pressing 'close mirror adjust' or 'far mirror adjust' key/button will automatically instant turn your head towards that mirror:

"mix lookpos2 `keyboard.num9?0 | ((fmirrorsel?0 * ! sign(lookpos9?0)) + (cmirrorsel?0 * sign(lookpos9?0))) * abs(sign(-mouse.rel_position.x?0 + 1)) | semantical.lookpos2?0`"

"mix lookpos3 `keyboard.num7?0 | ((cmirrorsel?0 * ! sign(lookpos9?0)) + (fmirrorsel?0 * sign(lookpos9?0))) * abs(sign(-mouse.rel_position.x?0 + 1)) | semantical.lookpos3?0`"

IMPORTANT: This needs to be set correctly for driving LHD trucks or RHD trucks to prevent turning towards the wrong mirror.
"mix lookpos9 `0`" <- 0=LHD or 1=RHD

Note: The above optional edit won't work if you're using -sysmouse in the startup command line.
In that case, use these two edits instead, replacing as required with your keys/buttons:

"mix lookpos2 `keyboard.num9?0 | (joy.b2?0 * ! sign(lookpos9?0)) + (joy.b1?0 * sign(lookpos9?0)) | semantical.lookpos2?0`"

"mix lookpos3 `keyboard.num7?0 | (joy.b1?0 * ! sign(lookpos9?0)) + (joy.b2?0 * sign(lookpos9?0)) | semantical.lookpos3?0`"

==========

Mirror adjust toggle option (game version 1.41+ only):

By replacing these two lines you will no longer need to press and hold the 'close mirror adjust' or 'far mirror adjust' key/button.
Just quick press the one you want to adjust and, once adjusted, quick press again to stop.

Note 1: Pressing either of the 'mirror adjust' key/buttons will auto cancel the adjusting of the other mirror, if it was already selected.
Note 2: Works best when using the above 'optional' instant turn towards the selected mirror.
Otherwise, if you start adjusting the close mirror and then select the far mirror without deselecting the close first, you'll be stuck looking at your close mirror whilst the far mirror is being adjusted or vice versa.

"mix cmirrorsel `memory(short_press(joy.b1?0 + (joy.b2?0 * cmirrorsel), 1000), ! cmirrorsel)`"

"mix fmirrorsel `memory(short_press(joy.b2?0 + (joy.b1?0 * fmirrorsel), 1000), ! fmirrorsel)`"

Go back to the first post for the full list of what's available: viewtopic.php?p=24744#p24744
Last edited by JHTrucker on October 10th, 2023, 6:49 pm, edited 1 time 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: 1335
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience.

Post by JHTrucker » October 9th, 2023, 6:29 pm

Toggle interior camera zoom on/off
For game version 1.41+ (memory function doesn't exist in lower game versions)

Instead of having to press and hold your zoom button, you can now toggle zoom on/off instead.
Or have both options available to use, press & hold and toggle.

Examples:
Replace keyboard.z?0 with your preferred key/button.

Press 'z' to toggle zoom on/off.
"mix camzoom `memory(short_press(keyboard.z?0, 1000), ! camzoom)`"

OR

Press 'z' for game default zoom (press & hold).
Press 'shift' & 'z' to toggle zoom on/off.
"mix camzoom `keyboard.z?0 & ! any_shift | memory(short_press(keyboard.z?0 & any_shift, 1000), ! camzoom)`"

OR

Press 'z' for game default zoom (press & hold).
Press 'ctrl' & 'z' to toggle zoom on/off.
"mix camzoom `keyboard.z?0 & ! any_ctrl | memory(short_press(keyboard.z?0 & any_ctrl, 1000), ! camzoom)`"

OR

Press 'z' for game default zoom (press & hold).
Press 'alt' & 'z' to toggle zoom on/off.
"mix camzoom `keyboard.z?0 & ! any_alt | memory(short_press(keyboard.z?0 & any_alt, 1000), ! camzoom)`"

OR

Replace keyboard.z?0 & keyboard.x?0 with your preferred key/button.

Press 'z' for game default zoom (press & hold).
Press 'x' to toggle zoom on/off.
"mix camzoom `keyboard.z?0 | memory(short_press(keyboard.x?0, 1000), ! camzoom)`"

Go back to the first post for the full list of what's available: viewtopic.php?p=24744#p24744
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
indian56
Posts: 3
Joined: December 5th, 2022, 12:45 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 09/10/2023

Post by indian56 » January 8th, 2024, 9:29 am

Hi JHTrucker!
I've been reading your articles on how to improve the gameplay of ATS and ETS 2 and I really like them! Dozens of great ideas and their implementation, simplifying key functions can be found in them.
At the end I read "More to come? If i can think of any more."!

I've been trying to implement an idea of mine for quite some time, with more or less interruptions, and I've already tried many variations that brought different results, but never what I want to achieve!
  • I would like to connect the emergency flasher to the reverse light, that is, I want the emergency flasher to turn on together with the reverse light when the transmission is in reverse!
I'm not a beginner, but I'm also not an expert in editing the "controls.sii" file, and I thought that you might have an idea or a solution to implement it!

Thank you in advance for your answer!
Indian56
Image
Hungary Map Developer
User avatar
JHTrucker
Expert
Posts: 1335
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 09/10/2023

Post by JHTrucker » January 9th, 2024, 2:51 am

@indian56 - Thanks for showing an interest... a few questions are required:

1 - You say 'Emergency flasher' = Beacon? or Hazzard lights (4 way flasher - all left/right indicators)?
2 - You drive with keyboard, gamepad or properly... with a wheel?
3 - You use what type of transmission, simple auto, real auto, manual with up/down gear changes or manual H shifter?

The required edits will be different depending on your answers and/or may be tricky to do, but I'll give it a go.
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
indian56
Posts: 3
Joined: December 5th, 2022, 12:45 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 09/10/2023

Post by indian56 » January 9th, 2024, 9:23 am

@JHTrusker, Thank you for responding so quickly to my question, and forgive me for just stating it in broad terms!

In answer to your questions:

1. It is about the four-way flasher (flasher4way).
2. I drive with a steering wheel, and
3. I use a real automatic transmission (manual switching for "forward", "0" and "reverse" directions).

And thank you for taking the time for me!
indian56
Image
Hungary Map Developer
User avatar
JHTrucker
Expert
Posts: 1335
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience.

Post by JHTrucker » January 10th, 2024, 4:41 pm

Reversing warning lights - Game version 1.41+
Original idea/help request from forum member indian56 viewtopic.php?p=63011#p63011

This will work for 'Real Automatic' or 'Manual with H Shifter' only.

Note 1: This uses the trucks indicators to create 4 way flashing, the game default hazard lights are unsuitable for this function as there's no way to correctly turn them on/off as required.
That means when reversing and turning your wheel you'll hear the sound of the indicator mechanism trying to 'self cancel'...
Ignore it or disable 'self cancelling':
Gameplay menu --> Truck settings --> Automatic blinker turn off - Tick (default) - Untick to have full manual control of your indicators.

Note 2: Manually turning on your hazards lights will always overrule this function:
Hazard lights off - Select reverse = New reversing warning lights, rapid flashing.
Hazard lights on - Select reverse = Hazard lights flash as normal.

Important note:
Using -sysmouse as a startup command will prevent this from working.
In that case remove it and do this edit instead, otherwise you can ignore this part:
config_lines[3]: "device phys_mouse ``" <-- game default
config_lines[3]: "device phys_mouse `sys.mouse`"


Example - Real Automatic with 3 button control (Drive/Neutral/Reverse).
Video recorded @ 720p on an old camera phone with poor low light capabilities, I'm not showing off game graphics.
Laptop isn't used for game play, just developing stuff!



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

Real Automatic Edits - 3 button control (Drive/Neutral/Reverse):

Gameplay menu --> Truck settings --> Transmission type --> Real Automatic

Drive - Toggle on Drive: keyboard.num1?0 (Numpad 1)
Neutral - Toggle off Drive/Reverse: keyboard.num2?0 (Numpad 2)
Reverse - Toggle on Reverse: keyboard.num3?0 (Numpad 3)

"mix gearup `0 * 0`" <-- This will display as 'complex' in the key/button menu just to stop you assigning anything to it!
"mix geardown `0 * 0`" <-- This will display as 'complex' in the key/button menu just to stop you assigning anything to it!

Replace keyboard.num1?0, keyboard.num2?0 & keyboard.num3?0 with your preferred keys/buttons:
"mix gear0 `keyboard.num2?0`"
"mix drive `memory((keyboard.num1?0 * ! drive) + ((gear0?0 + keyboard.num3?0) * drive), ! drive)`"
"mix reverse `memory((keyboard.num3?0 * ! reverse) + ((gear0?0 + keyboard.num1?0) * reverse), ! reverse)`"

Optional - Flashes your high beam as well - You can replace default keyboard.j?0 with your preferred key/button:
"mix lighthorn `keyboard.j?0 | memory(reverse?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lighthorn) * reverse?0`"

"mix lblinkerh `memory(reverse?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lblinkerh) * reverse?0`"
"mix rblinkerh `! lblinkerh?0 * sign(abs(mouse.rel_position.x?0) + 1) * reverse?0`"

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

Real Automatic Edits - 2 button control (Drive/Reverse - both toggle to Neutral):

Gameplay menu --> Truck settings --> Transmission type --> Real Automatic

Drive - Toggle between Drive/Neutral: keyboard.num1?0 (Numpad 1)
Reverse - Toggle between Reverse/Neutral: keyboard.num3?0 (Numpad 3)

"mix gearup `0 * 0`" <-- This will display as 'complex' in the key/button menu just to stop you assigning anything to it!
"mix geardown `0 * 0`" <-- This will display as 'complex' in the key/button menu just to stop you assigning anything to it!
"mix gear0 `0 * 0`" <-- This will display as 'complex' in the key/button menu just to stop you assigning anything to it!

Replace keyboard.num1?0 & keyboard.num3?0 with your preferred keys/buttons:
"mix drive `memory(keyboard.num1?0 + (keyboard.num3?0 * drive), ! drive)`"
"mix reverse `memory(keyboard.num3?0 + (keyboard.num1?0 * reverse), ! reverse)`"

Optional - Flashes your high beam as well - You can replace default keyboard.j?0 with your preferred key/button:
"mix lighthorn `keyboard.j?0 | memory(reverse?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lighthorn) * reverse?0`"

"mix lblinkerh `memory(reverse?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lblinkerh) * reverse?0`"
"mix rblinkerh `! lblinkerh?0 * sign(abs(mouse.rel_position.x?0) + 1) * reverse?0`"

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

Real Automatic Edits - H Shifter or button box switch used to select 'Drive' & 'Reverse':

Gameplay menu --> Truck settings --> Transmission type --> Real Automatic

Controls menu assign H Shifter 3rd & 4th (typically) to these:
Automatic Gearbox: Drive
Automatic Gearbox: Reverse
OR
Button box switch - Replace examples joy.b21?0 & joy.b22?0 as required:
"mix drive `joy.b21?0`"
"mix reverse `joy.b22?0`"

Optional - Flashes your high beam as well - You can replace default keyboard.j?0 with your preferred key/button:
"mix lighthorn `keyboard.j?0 | memory(reverse?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lighthorn) * reverse?0`"

"mix lblinkerh `memory(reverse?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lblinkerh) * reverse?0`"
"mix rblinkerh `! lblinkerh?0 * sign(abs(mouse.rel_position.x?0) + 1) * reverse?0`"

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

Manual with H-Shifter Edits - H Shifter used to change gears as normal:

Gameplay menu --> Truck settings --> Transmission type --> H-Shifter

Optional - Flashes your high beam as well - You can replace default keyboard.j?0 with your preferred key/button:
"mix lighthorn `keyboard.j?0 | memory(gear1?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lighthorn) * gear1?0`"

"mix lblinkerh `memory(gear1?0 * sign(abs(mouse.rel_position.x?0) + 1), ! lblinkerh) * gear1?0`"
"mix rblinkerh `! lblinkerh?0 * sign(abs(mouse.rel_position.x?0) + 1) * gear1?0`"

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

Go back to the first post for the full list of what's available: viewtopic.php?p=24744#p24744
Last edited by JHTrucker on February 12th, 2024, 2:55 pm, edited 3 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
indian56
Posts: 3
Joined: December 5th, 2022, 12:45 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 10/01/2024

Post by indian56 » January 11th, 2024, 12:30 pm

@JHTrusker, Thank you for your quick and comprehensive answer!

I will reconfigure the settings and let you know the result!

And thank you for taking the time for me!

Indian56
Image
Hungary Map Developer
User avatar
JHTrucker
Expert
Posts: 1335
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience.

Post by JHTrucker » February 14th, 2024, 3:37 pm

Easy swap between mouse driving and keyboard driving.

If you usually drive with a mouse but would also like to be able to use the keyboard sometimes without having to stop and enter the menu to change the control method, then you can try this.
You can set the mouse input speed and the keyboard input speed separately, so one could be used for motorway driving and the other for manoeuvring around tight spaces.
The keyboard 'digital inputs' are now simulated 'anaglogue inputs', you can apply as much steering, throttle or brake as you need.

In game - Controls menu:
Select - 'Keyboard + Mouse Steering' or 'Keyboard + Mouse Steering including pedals'.
Set 'Steering sensitivity' & 'Steering non-linearity' to how you like them when driving with a mouse.

Controls.sii file edits:
"mix camrotate `mouse.button_right?0 | semantical.camrotate?0`" <-- This is game default
"mix msteering `(-mouse.rel_position.x?0 * c_msens) + (dsteering?0 * 3)`"
"mix mpedals `(-mouse.rel_position.y?0 * c_msens) + ((dforward?0 - dbackward?0) * 3)`"
Note:
You can change '3' in the above lines to speed up or slow down keyboard steering/pedal movement.
You can use different values for steering and pedals to suit your style.
How you set 'Steering sensitivity' & 'Steering non-linearity' for the mouse affects what the best value might be!
Example: After setup and testing you'd like the keyboard steering to be twice as fast, change it to 6.

Use whatever keys you have already assigned for steering/throttle/brake.
To use the mouse to look around you'll need to press & hold the right mouse button, just the same as default mouse driving or use the numpad 'look keys'.

That's it.

In game, at any time, you can now, use the mouse to drive or use the keyboard to drive.

Notes:
The mouse control overlay is on screen so you can see the results of moving the mouse or pressing the keys, when using 'Keyboard + Mouse Steering including pedals' only.

When using 'Keyboard + Mouse Steering':
Mouse driving control is game default (steer only).
Keyboard driving has the steering key presses accumulated and the throttle and brake key presses are instant on/off.

When using 'Keyboard + Mouse Steering including pedals':
Mouse driving control is game default (steer - Throttle - Brake).
Keyboard driving has the steering key presses accumulated and the throttle and brake key presses also accumulated and not instant on/off, just like how the mouse pedals work.

----------

Extra option - Keyboard driving only, that simulates mouse driving inputs but allows the mouse to look around without pressing anything.

In game - Controls menu:
Select - 'Keyboard + Mouse Steering' or 'Keyboard + Mouse Steering including pedals'.

Controls.sii file edits:
"mix camrotate `abs(sign(mouse.rel_position.x?0))`"
"mix msteering `(dsteering?0 * 3)`"
"mix mpedals `((dforward?0 - dbackward?0) * 3)`"
Notes:
You cannot keyboard steer whilst moving your mouse, to look around etc.
If your mouse has a tendencey to move around your desk on its own (caused by vibrations or a slopping desk etc) or your mouse is too sensitive, then this 'extra option' won't work as you won't be able to steer.
Set 'Steering sensitivity' & 'Steering non-linearity' to how you like them when driving with a keyboard, you shouldn't need to change '3' but you can if you want to.

----------

Game default line edits, if you need them.
"mix camrotate `mouse.button_right?0 | semantical.camrotate?0`"
"mix msteering `-mouse.rel_position.x?0 * c_msens`"
"mix mpedals `-mouse.rel_position.y?0 * c_msens`"


Go back to the first post for the full list of what's available: viewtopic.php?p=24744#p24744
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
Italiantrucker97
Posts: 4
Joined: March 21st, 2024, 2:02 pm

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 14/02/2024

Post by Italiantrucker97 » March 21st, 2024, 2:10 pm

Hi everyone, I hope you can help me, I once used the z axis of my t.flight hotas for the various positions of the retarder, I found a guide on the internet with the code to replace in control.sii, I had to format the PC and I lost this configuration, can you help me?? I'm trying everything, thanks
User avatar
JHTrucker
Expert
Posts: 1335
Joined: February 7th, 2020, 3:19 pm
Location: UK

Re: Controls.sii file changes to enhance the trucking experience. First post Updated 14/02/2024

Post by JHTrucker » March 21st, 2024, 5:46 pm

@Italiantrucker97 - How does the z axis work?
Twist it left/right and it springs back to the centre?
Or twist left/right and it stays where you left it?

What does your controls.sii file look like when you start the game with it connected?
Here in my example, joy is an xbox360 controller and the other joy's are spare:
"device keyboard `di8.keyboard`"
"device mouse `fusion.mouse`"
"device joy `di8.'{D4625940-F711-11E8-8001-444553540000}|{028E045E-0000-0000-0000-504944564944}'`"
"device phys_mouse ``"
"device joy2 ``"
"device joy3 ``"
"device joy4 ``"
"device joy5 ``"
"device joy6 ``"

Example: Use the left/right triggers (z axis) on xbox360 to step retarder setting up/down:
"mix retarderup `sign(joy.z) | semantical.retarderup?0`"
"mix retarderdown `sign(-joy.z) | semantical.retarderdown?0`"
The above should step retarder up/down when you twist left/right multiple times?

These could perhaps be used if your z axis is stepped, doesn't re-center it's self and stays where you left it.
And so would need to be something like this?
"mix retarder0 `! sign(joy.z) | semantical.retarder0?0`"
"mix retarder1 `sign(deadzone(joy.z, 0.01)) * ! sign(deadzone(joy.z, 0.2)) | semantical.retarder1?0`"
"mix retarder2 `sign(deadzone(joy.z, 0.21)) * ! sign(deadzone(joy.z, 0.4)) | semantical.retarder2?0`"
"mix retarder3 `sign(deadzone(joy.z, 0.41)) * ! sign(deadzone(joy.z, 0.6)) | semantical.retarder3?0`"
"mix retarder4 `sign(deadzone(joy.z, 0.61)) * ! sign(deadzone(joy.z, 0.8)) | semantical.retarder4?0`"
"mix retarder5 `sign(deadzone(joy.z, 0.81)) * ! sign(deadzone(joy.z, 0.99)) | semantical.retarder5?0`"
The above would switch retarder positions at every 20% twist = 5 steps (twist would be left or right, not both)
When centered it should switch retarder off if 'retarder0' means off?

For what its worth, my in game retarder has always been on automatic...
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
Post Reply