Reconfiguring your controls.sii file for a keyed ignition switch (Guide)

Post Reply
GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Reconfiguring your controls.sii file for a keyed ignition switch (Guide)

#1 Post by GeorgeT93 » 24 May 2022 19:20

Hi everyone, I wrote a guide for making changes to the controls.sii file for keyed ignitions that I posted to Steam that I thought could be useful to some folks here that may not browse the Steam guides sections.

INTRODUCTION
This guide is meant for people who use a keyed ignition, and if all goes well, these steps will walk you through reconfiguring the controls.sii file for your ignition key so that it properly syncs to the key position so that you no longer have to turn the key back to the accessory position to turn your truck off. It works identically in both Euro Truck Simulator 2 and American Truck Simulator, and also works if you're using an on-off toggle switch for engine electricity. If using a toggle switch, in the steps below, the ignition's 'on' position is equivalent to your toggle switch's 'on' position.

Most folks using a button box (be it a diy or purchased one) have configured their ignition switch in the game's Keys & Buttons settings so that the keyed ignition's 'on' (or 'run') position is assigned to the "Start/Stop Engine Electricity" option. This is fine in and of itself, as it technically works, but it makes the position act as a toggle that needs to be deactivated then reactivated to turn the engine off. This is usually accomplished by turning the key back past the 'off' position and into accessory temporarily, or in the case of an ignition that doesn't have an accessory position, the key needs to be turned to 'off', then back to 'on' to send the game the signal to turn the engine off. We just need to make a couple of small, manual changes to our controls.sii file in order to make our key work like a real ignition, so that our engine shuts off whenever our key is returned to the 'off' position.

EDITS TO THE CONTROLS.SII FILE
These steps are based on already having configured the on position of the ignition to "Start/Stop Engine Electricity" from within the game's Keys & Buttons settings as a starting point, since most folks are likely already configured this way. REMEMBER TO MAKE A BACKUP COPY OF YOUR controls.sii FILE BEFORE EDITING!! (Although, if you mess up the file too badly, the worst that could happen is you have to reconfigure all your controls in game. So if you don't want that to potentially happen, just back up the file before editing it. Seriously.) So let's open our controls.sii file in a text editor and get started. Note that the line numbers in the instructions may be different than the line numbers in your file, but the entries (mix engineelect, mix ignitionoff, mix ignitionon) are the important part.

  • Scroll down to the "mix engineelect" entry (somewhere in the config_lines[300]+ range.)
  • Highlight the "joy..." definition segment from the "j" in "joy" up to the "s" in "semantical.engineelect?0", including the pipe (line) and the space (See figure_1), then cut the highlighted text.
    figure_1.png
  • On the next two lines ("mix ignitionoff" and "mix ignitionon"), paste the "joy" definition we just cut in front of the "semantical.xxx" definitions (semantical.ignitionoff?0 and semantical.ignitionon?0). See figure_2.
    figure_2.png
  • Back on the "mix ignitionoff" definition, we need to add an exclaimation point and a space in front of the "j" in the "joy" segment so that it looks like figure_3.
    figure_3.png


Now save the file, exit your text editor and start your game. Your ignition *should* now properly work like a real ignition.

NOTES: If things still aren't working, in Gameplay Settings, make sure "Automatic engine and electricity start" is unchecked.

SUMMING UP
What's going on here is the "Start/Stop Engine Electricity" assignable in the game corresponds to mix engineelect setting, which is a toggle. One activation turns the electricity on, the next turns the electricity off. The ignitionon and ignitionoff settings can only be configured directly in the controls.sii file as there are no corresponding settings that are assignable from within the game. They each only do what their names imply. ignitionon only sends a 'turn electric on' signal and ignitionoff only sends a 'turn electric off' signal. The "! " in front of the joy definition for the ignitionoff setting tells the game "NOT the ignition's on position". So when the key is turned to the 'on' position, 'turn electric on' gets sent to the game, and when the key is returned to the 'off' position, the signal from the 'on' position is no longer being pressed ("NOT" the 'on' position's button assignment), so the game gets sent a 'turn electric off' signal.

Good luck and I hope other folks using a keyed ignition find this useful.
Post Reply

Return to “Offtopic and other voices”

Who is online

Users browsing this forum: No registered users and 6 guests