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: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

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

Post by JHTrucker » March 31st, 2023, 5:18 pm

'Walk Around Your Truck' UPDATE:

Note: All head tracking code removed, this is now for non-head tracking users only.

Head tracking users should use one of these instead, to suit your device:
TrackIR Driving Enhancements https://roextended.ro/forum/viewtopic.p ... 457#p46457
VR Driving Enhancements https://roextended.ro/forum/viewtopic.p ... 557#p55557
Tobii Eye Driving Enhancements https://roextended.ro/forum/viewtopic.p ... 548#p57548

New menu mods, v3.0.

You can now set a value so you can always face your truck, if required, rather than the default of looking down the side of your truck/trailer.

You can now set the required pitch value, rather than always level, makes it easier to look at fuel tanks or crank handle when refueling or attach/de-tach the trailer etc.

Amended line edits for:
mix headtryaw...
mix headtrpitch...
mix headtrx...
mix headtry...
mix headtrz...
If in doubt, just copy/paste all required line edits.

See 'Walk around your truck' post for more info: https://roextended.ro/forum/viewtopic.p ... 312#p50312
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
cwat89
Posts: 6
Joined: October 19th, 2020, 3:16 pm

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

Post by cwat89 » June 7th, 2023, 6:21 am

I have 2 questions. First, is there a way to change something in the controls.sii file to make the engine brake on/off toggle switch work correctly in game without having to use a mapping program? Second, how do you trick the game to let the truck stay running while fueling or loading/unloading?
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

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

Post by JHTrucker » June 7th, 2023, 3:27 pm

@cwat89

1 - I'm not an expert on trucks and trucking... just enjoy the relaxing drive that is completely different to sim racing cars around tracks.
So you'll need to explain what you want the engine brake toggle to do if it doesn't work, as you say, correctly.

For me, I always drive from cam 1 using wheel/pedals/trackir and manual 6 speed gearbox with engine brake and retarder set to automatic.

2a - Refueling can't be done with the engine running as the game code requires the engine to be stopped first. Therefore any activation inputs are ignored until the game code detects the engine has stopped.
Also sleep works the same as above.

I know nothing about your setup and how you like to play, simple, basic or real etc.
But, here's a simple idea:
When you press your accelerator the engine automatically starts if it's not running.
When you press your NEW refuel/sleep button (not activate button) the engine will stop and you'll refuel or sleep.

To try that, do this:

1 - In 'Gameplay' menu - Tick 'Automatic engine and electricity start'

2 - Choose yourself a button that you want to use for refueling and sleeping. My example is using keyboard.z?0

3 - In controls.sii file -> "mix activate `keyboard.enter?0 | keyboard.z?0 | semantical.activate?0`"

4 - In controls.sii file -> "mix ignitionoff `keyboard.z?0 | semantical.ignitionoff?0`"

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


2b - Unloading/loading can already be done with the engine running or stopped.
Or I think you do have to switch off when using your own trailer? Haven't done that for a long time... I'll check this out.
EDIT:
American Truck Simulator\profiles\YOUR PROFILE\config.cfg
uset g_cargo_load_require_park_brake "0"
uset g_cargo_load_require_engine_off "0"
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
cwat89
Posts: 6
Joined: October 19th, 2020, 3:16 pm

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

Post by cwat89 » June 8th, 2023, 3:33 am

I play as real as the game allows. I built a custom button box and the switch I'm using for the jake brake is a regular on/off toggle switch. When using it in game you have to cycle the switch for ON and cycle it again for OFF. Right now I'm using a button mapping program to make it work as intended but would prefer altering the controls.sii if it's possible so it's one less thing I have running in the background.
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

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

Post by JHTrucker » June 8th, 2023, 1:25 pm

Ok, so your switch is just an on/off switch and it stays in position when you let go of it. Up = on & Down = off.

Looking at the games keys/buttons menu, Truck Controls, there's 2 options for engine brake:
Engine Brake - Default 'B'
Engine Brake Toggle - No default

If I assign them as:
Engine Brake - B
Engine Brake Toggle - V

When I press and hold B the engine symbol appears on the dash and it disappears when I stop pressing B.

When I press V and let go the engine symbol appears on the dash and stays there until I next press V again.

I think you just need to use the first one, Engine Brake.
When your switch is up it turns on engine brake.
When your switch is down it turns off engine brake.

These are the 2 lines in the controls.sii file:
"mix motorbrake `keyboard.b?0 | semantical.motorbrake?0`"
"mix engbraketog `keyboard.v?0 | semantical.engbraketog?0`"
But you should be able to assign your switch using the menu:
Engine Brake - Button box switch up
Engine Brake Toggle - Blank

If you want the switch to work the opposite way round, up=off & down=on, then you can add an ! to the controls.sii file.
For example:
Apply engine brake when pressing B:
"mix motorbrake `keyboard.b?0 | semantical.motorbrake?0`"
Apply engine brake when B is not being pressed:
"mix motorbrake `! keyboard.b?0 | semantical.motorbrake?0`"

Hopefully I haven't misunderstood what you want.
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
cwat89
Posts: 6
Joined: October 19th, 2020, 3:16 pm

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

Post by cwat89 » June 9th, 2023, 2:06 am

Ok, I think the second part of that is what I'm looking for with the "!" added. Gonna give it a try. Thanks
Nomadtales
Posts: 2
Joined: August 16th, 2023, 3:42 pm

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

Post by Nomadtales » August 16th, 2023, 4:03 pm

Hi there, I have built a custom button box with a single built in analogue thumbstick. It uses X/Y Rotation to give the normal analogue look around. I am attempting to also use the thumbstick to control the mirrors when a selector key is active. I can successfully move the mirrors using the thumbstick but the look around also wants to occur. How do I disable the look around while in "mirror mode"?

Some relevant code lines from controls.sii below.

Code: Select all

 config_lines[14]: "input j_look_ud `joy2.ry`"
 config_lines[15]: "input j_look_lr `joy2.rx`"
 
 config_lines[231]: "mix looklranaraw `deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
 config_lines[232]: "mix lookudanaraw `deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"
 
 config_lines[437]: "mix cmirrorsel `joy2.b10?0 | semantical.cmirrorsel?0`"
 config_lines[438]: "mix fmirrorsel `joy2.b11?0 | semantical.fmirrorsel?0`"
 config_lines[439]: "mix mirroryawl `(joy2.b10?0 | joy2.b11?0) & deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz) | semantical.mirroryawl?0`"
 config_lines[440]: "mix mirroryawr `(joy2.b10?0 | joy2.b11?0) & deadzone(sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz) | semantical.mirroryawr?0`"
 config_lines[441]: "mix mirrorpitu `(joy2.b10?0 | joy2.b11?0) & deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz) | semantical.mirrorpitl?0`"
 config_lines[442]: "mix mirrorpitl `(joy2.b10?0 | joy2.b11?0) & deadzone(sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz) | semantical.mirrorpitu?0`"
 config_lines[443]: "mix mirrorreset `(joy2.b10?0 | joy2.b11?0) & joy2.b20?0 | semantical.mirrorreset?0`"
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

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

Post by JHTrucker » August 16th, 2023, 7:56 pm

@Nomadtales

If you press and hold joy2.b10?0 or joy2.b11?0 to enable mirror mode whilst also using the stick to move the mirrors at the same time, then we can also use those to disable rotation when they are pressed...

So as long as joy2.b10?0 or joy2.b11?0 are not being pressed then rotation will work:

Add this >>> ! (joy2.b10?0 | joy2.b11?0) * <<< to your lines:

config_lines[231]: "mix looklranaraw `! (joy2.b10?0 | joy2.b11?0) * deadzone(-sel(c_jilooklr, -j_look_lr?0, j_look_lr?0), c_lr_dz)`"
config_lines[232]: "mix lookudanaraw `! (joy2.b10?0 | joy2.b11?0) * deadzone(-sel(c_jilookud, -j_look_ud?0, j_look_ud?0), c_ud_dz)`"

OR

Would you prefer to have joy2.b10?0 & joy2.b11?0 set to toggle on/off so that you don't have to hold them whilst adjusting the mirrors?
I think I might have a way to do this...
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
Nomadtales
Posts: 2
Joined: August 16th, 2023, 3:42 pm

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

Post by Nomadtales » August 17th, 2023, 1:22 am

Tested and works beautifully. Thank you so much. I was trying all sorts of logic to achieve this, though never used the * in the line and that did the trick.

No need to worry about holding b10/11 as this is a latched switched, so all good there.
User avatar
JHTrucker
Expert
Posts: 1330
Joined: February 7th, 2020, 3:19 pm
Location: UK

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

Post by JHTrucker » August 17th, 2023, 2:23 pm

@Nomadtales - Glad it now works as you wanted it to... however, I think it such a good idea it's worth adding to my first post list, so I'll create a new post for this which will include a simplified setup and a few tweaks to your original code.
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