How to set up toggle switches (a tutorial) - Page 70 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 03-29-2020, 12:07 PM   #691
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,842
Default

Quote:
Originally Posted by punk View Post
ps. Hmm, I seem to still be missing something. None of the changes have added any extra choices. I have to assume I am editing the wrong file:
F:\DCS World OpenBeta\Mods\aircraft\C-101\Input\C-101EB\joystick\default.lua.

Example of change in case my head is up my posterior again:
Code:
--Generator added code 032620
{down = device_commands.Button_10, cockpit_device_id = 2,   value_down = -1.0,  name = _('Generator - RESET'), category = _('Main instrument panel')},
{down = device_commands.Button_10,cockpit_device_id = 2,    value_down = 0.0,    name = _('Generator - OFF'),        category = {_('Main instrument panel')}},
{down = device_commands.Button_10,cockpit_device_id = 2,    value_down = 1.0,    name = _('Generator - ON'),    category = {_('Main instrument panel')}},
{down = device_commands.Button_10, up = device_commands.Button_10, cockpit_device_id = 2,value_down = -1.0, value_up = 0.0, name = _('Generator - 2-Pos RESET/OFF'), category = _('Main instrument panel')},
{down = device_commands.Button_10, up = device_commands.Button_10, cockpit_device_id = 2,value_down = 1.0, value_up = 0.0, name = _('Generator - 2-Pos ON/OFF'), category = _('Main instrument panel')},
If you have installed your DCS World on the disk drive F: then that's the right file to edit.
I assume the first 3 lines are the original .lua code, and you added the 4th and 5th lines just underneath. Correct?
I note one inconsistency: In lines 2 and 3 the syntax of the "category" part is different from that in lines 1, 4 and 5.
In lines 2 and 3 it's "category = {_('Main instrument panel')}" and in the other lines it's "category = _('Main instrument panel')" (without the curly braces). I'm not sure if that's the problem but it might. Have a look at the other lines in the original file. If the category part is always enclosed by curly braces ({ }) then your added lines should follow the same syntax.
This is a bit frustrating. If had the C-101 and the original file I could figure it out very quickly, but I'm not buying that module. If you could post the original and the modified file that would probably help.
Another thing to check: some modules have not just the "default.lua" but also equivalent files for other game controllers. File names are like "Throttle - HOTAS Warthog.lua" or "Joystick - HOTAS Warthog.lua". If there are such files and you have the corresponding game controller, then you must add your modifications to those files to make the added commands show.
Ignore files ending with "diff.lua"!
__________________
LeCuvier
Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5
LeCuvier is offline   Reply With Quote
Old 03-29-2020, 03:04 PM   #692
punk
Member
 
punk's Avatar
 
Join Date: Sep 2015
Posts: 201
Default

Quote:
Originally Posted by LeCuvier View Post
This is a bit frustrating.
Another thing to check: some modules have not just the "default.lua" but also equivalent files for other game controllers.
Ignore files ending with "diff.lua"!
Sorry, I was hoping not to be that guy.

Secondly, no other files except for my rudders, CH PRO PEDALS USB, file.

I will post the files when I get a chance.

Thanks for all your help. Your time and efforts are greatly appreciated.

ps: seems to be working now, will test it and get back. Attaching files, FYI and others. Again, thanks.
Attached Files
File Type: lua default old.lua (152.0 KB, 2 views)
File Type: lua default.lua (157.5 KB, 3 views)
__________________
Punk


Last edited by punk; 03-30-2020 at 12:10 AM.
punk is offline   Reply With Quote
Reply

Tags
controls, lua, tm warthog, toggle switches, tutorials

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:42 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.