Hi! How would it be possible to toggle states related to electrics using triggers on vehicles, like the blue-green clickable ones? I know how to place a trigger and I know about trigger-event links and events, but not how to make the stuff toggle electrics. Specifically toggle these 3 things: - Left signal - Right signal - Parking brake I tried seeing how the RUSH does the hazard and lowhighbeam switches, but I didn’t get much from that at all. Oh, and also I have never worked with Lua before and have no clue how it works and how the syntax looks etc (other than from seeing that lua file i talked about earlier ofc). might be a minor inconvenience lol
I've made a simple mod for the default D-Series (see attached file). It is a trigger box placed above the hood, which toggles left turn signal when you click it. To make it appear, select "Trigger Left Signal" part in the "Tow hitch" slot (I've chosen this slot because it's empty by default). In fact, you don't need any custom Lua code to trigger the common vehicle actions. You can check the complete list of these in the file with C:\Program Files (x86)\Steam\steamapps\common\BeamNG.drive\lua\ge\extensions\core\input\actions\vehicle.json directory. Each listed action calls a certain Lua function in files with C:\Program Files (x86)\Steam\steamapps\common\BeamNG.drive\lua directory. If you want to create a custom action, you need to make a custom lua module (https://www.beamng.com/threads/binding-help.71172/ this thread might be useful)
These are all the electrics functions you can use: Code: updateGFX() updateGFXSecondStep() toggle_left_signal() toggle_right_signal() stop_turn_signal() set_warn_signal() toggle_lightbar_signal() set_lightbar_signal() toggle_fog_lights() set_fog_lights() toggle_lights() light_flash_highbeams() setLightsState() horn() setIgnitionLevel() toggleIgnitionLevelOnDown() toggleIgnitionLevelOnUp() setAllowedIgnitionLevels() initLastStage() reset() init() initLastStage() Values: Code: throttle brake steering clutch wheelspeed odometer avgWheelAV airspeed horn rpmspin rpm boost boostMax A simple example: Code: "events":[ ["id", "title", "desc"], ["hazard", "", "", {"onDown" :"electrics.toggle_warn_signal()"}], ],