lesthegrngo Posted June 27, 2020 Posted June 27, 2020 (edited) **EDITED** Fixed, now I want to understand why Hi all, I'm taking this out of the 'how to set up toggle switch' thread as I think I wore out my welcome there! I have all the other toggle switches on the electrical panel working as 2 position on/off switches with no problem, but for some reason I was unable to get the floodlight switch to work in that way. This was my logic following the instructions, and I still can't see why what I did was incorrect, even though I know it is. It is the third device in the listing for that particular category, plus the 'clickabledata.lua file lists it as button 3, see the code below from clickabledata.lua elements["PTR-EPP-EMER-FLOOD"] = {class = {class_type.TUMB,class_type.TUMB}, hint = _("Emergency Flood"), device = devices.ELEC_INTERFACE, action = {device_commands.Button_3, device_commands.Button_3}, arg = {243,243}, arg_value = {-1,1}, arg_lim = {{0,1},{0,1}},updatable = true} From the devices.lua, 'ELEC INTERFACE' is device ID 1, and command_defs.lua has the definition as 3 It therefore follows that the line I should put into default.lua is this {down = 3003, up = 3003, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('Cockpit floodlight 2-Pos ON/OFF'), category = _('Electrical power control panel')}, I then start the game, go to controls and assign the appropriate button on the Bodnar BBI, and the controls screen accepts the assignment, but while all the other four devices have accepted and function with the on/off command, the floodlight does not I tried the same line substituting 3003 with 3007 and 3008 all to no avail. As there are already devices with numerical commands of 3001, 3004, 3005 and 3006, and I believe that 3002 is allocated to the Electrical Power Inverter function I believe that I cannot use those. Is my logic path above correct? I found this line in the setup thread {down = 3007, up = 3007, cockpit_device_id = 49 , value_down = 1.0, value_up = 0.0, name = _('Emergency Flood Light 2-Pos DAY/NIGHT'), category = _('Electrical power control panel')}, Device ID 49 pertains to the Lighting system panel, a completely different panel! How should I have made that mental leap, is there something that lists the corresponding switch other than the files mentioned above? Cheers Les Edited June 27, 2020 by lesthegrngo
Recommended Posts