Jump to content

DCS-BIOS CONTROL REFERENCE


geebeer2

Recommended Posts

Hi, I'm Dan, I'd like to know the correct procedures to create a new modul ( I'll try to export th F-5E). I'm a newby in arduino and dcs bios. I read the develop note but without success. Script addedd in control reference.HTML, f-5e add to aircraft list, json and jsonp are correctly created in automatic by dcs-bios. If possible a step by step procedures.

thanks in advance

Dan

Link to comment
Share on other sites

The Developer Guide has the step-by-step instructions. And from your post it sounds like you followed them. If the JSON files are created, then you have successfully added an aircraft module.

 

Please elaborate on the following points:

 

  • 1. What did you do? (Include the files you created, especially your F-5E.lua file)
  • 2. What did you expect to happen?
  • 3. What happened instead?

 

I have no idea what the problem is, because from your post it sounds like everything that I expected to happen did happen. So I need to know what you expected to happen before I can help you.

Link to comment
Share on other sites

You defined an empty aircraft module. The next step is to tell DCS-BIOS what switches, indicators, etc. exist in your aircraft by adding code to the F-5E.lua file between the calls to beginModule() and endModule().

 

This is described with the example of a toggle switch in the Developer Guide (in the section "The Export Module API"). To understand that documentation, you will need to learn the Lua programming language, otherwise it won't make much sense to you.

 

You can try to read the existing files (e.g. A-10C.lua) and mimic the patterns you see, and that might work for a while, but at some point you will add a syntax error by mistake and then you need to understand how to find the error message in dcs.log, navigate to the offending line in your Lua file, and recognize and fix the error.

 

There will also be a few controls that are not covered by the BIOS.Util.* functions, so you will need to write custom Lua code to get the complete module working.

Link to comment
Share on other sites

HI, I tried last night to write a short code just for fun....I've attached the LUA file, like F-5E and test file to look were I pick up the data and complete F5E's Command defs , tell me if you can, if is correct or it need other value (like memory allocation for example).

thanks in advance

dan

test.thumb.png.1dddb6c5f5c8af8a3f2e05a90d2ecaa6.png

F-5E.lua

command_defs.lua

Link to comment
Share on other sites

Looks correct (assuming you are using the correct argument numbers and device IDs, I'd have to look at clickabledata.lua to verify that). I don't have time to look at this in depth right now, so I suggest to just try if it works with the interactive control reference.

 

The memory allocation stuff is all done for you by the functions in Util.lua. You will only have to deal with this "low-level" stuff yourself if you encounter a control that does not conform to one of the common patterns; there seem to be one or two in each aircraft.

 

If it doesn't work let me know, I can download the F-5E later, grab a beta tester key, and figure this out on my own machine.

Link to comment
Share on other sites

The following works:

BIOS.protocol.beginModule("F-5E", 0x3000)
BIOS.protocol.setExportModuleAircrafts({"F-5E-3"})



local inputProcessors = moduleBeingDefined.inputProcessors
local documentation = moduleBeingDefined.documentation

local document = BIOS.util.document

local parse_indication = BIOS.util.parse_indication


local defineIndicatorLight = BIOS.util.defineIndicatorLight
local defineToggleSwitch = BIOS.util.defineToggleSwitch
local definePushButton=BIOS.util.definePushButton



defineIndicatorLight("MC_LIGHT", 169, "Warning, Caution and IndicatorLights","MasterCaution Lamp")
definePushButton("MC_RESET_BTN", 12, 3011, 172,"Warning, Caution and IndicatorLights" , "MasterCaution reset")

BIOS.protocol.endModule()

 

I found two problems:

(1) The aircraft name of the F-5E is not "F-5E" but "F-5E-3" (as you can see in the "_ACFT_NAME" value in the MetadataStart module as described by the Developer Guide). I changed the call to setExportModuleAircrafts() accordingly. If there are other internal names for other variants of the aircraft, add them to the list.

 

(2) Command identifiers must not contain spaces. They also must be at most 20 characters long and should consist only of capital letters and underscores.

Link to comment
Share on other sites

Hi, thanks, it works wery well, I've added some lights like gear transition ( I used a real TORNADO Gear Lever) Master Caution and AoA indicators.....LOT OF FUN!!!!!!!!!!!!!!!!!!!!!

Ps could give me an example about a servo motor?

thanks so mouch

 

Dan


Edited by geebeer2
  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...