Jump to content

How to check warning light status in mission?


Go to solution Solved by virgo47,

Recommended Posts

Hello guys, I know this is more a mission editing question, but it's C-101 specific because I'm lost in those lua files. 🙂 I want to check whether some warning/caution light, let's say AVIS.PERD. is on. I wanted to use X: COCKPIT ARGUMENT IN RANGE, but I can't find the argument. When I want something like that for, let's say, L-39, I go to L-39C/Cockpit/mainpanel_init.lua and find the section there with a line such as RV_5_2_DangerRALT_index.arg_number  = 397.

For C-101 I can't find this. Specific mainpanel_init.lua files are very short, and mainpanel_init_common.lua is longer, but still doesn't contain what I'm looking for. I grepped the whole directory for "warn", "caut", and more, but couldn't find anything in non-binary files. I know it can be obtained, as DCS-BIOS sends the status to Touch Portal plugin (DCS-COINS), but DCS-BIOS definition didn't help me much.

Please, where is it? What am I missing? 🙂

✈️ L-39, F-5E, F/A-18C, MiG-15, F-86F, C-101, FC3 🛩️ Yak-52, P-47, Spitfire 🚁 UH-1H, Ka-50 III 🗺️ NTTR, PG, SY, Chnl, Norm2 📦 Supercarrier, NS430, WWII 🕹️ VKB STECS+Gladiator/Kosmosima ▶️ DCS Unscripted YouTube

Link to comment
Share on other sites

32 minutes ago, virgo47 said:

I want to check whether some warning/caution light, let's say AVIS.PERD. is on. I wanted to use X: COCKPIT ARGUMENT IN RANGE, but I can't find the argument.

 

The argument is 167. A value between -1 to 0 is when the light is Off, a value from 0.01 to 1 denotes a light On. Here is a test mission.

I found the correct argument using the Modelviewer utility. It is very tedious as there is no way to get the argument of a cockpit element, I had to try moving arguments (metodically, I tested every 10 arguments, as the warning lights make for a fairly big group of arguments, once you find one, the others are nearby).

C-101 - Test Arg (by Rudel_chw).miz

  • Like 1
  • Thanks 1

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • Solution
Posted (edited)
7 hours ago, Rudel_chw said:

 

The argument is 167. A value between -1 to 0 is when the light is Off, a value from 0.01 to 1 denotes a light On. Here is a test mission.

I found the correct argument using the Modelviewer utility. It is very tedious as there is no way to get the argument of a cockpit element, I had to try moving arguments (metodically, I tested every 10 arguments, as the warning lights make for a fairly big group of arguments, once you find one, the others are nearby).

C-101 - Test Arg (by Rudel_chw).miz 10.99 kB · 3 downloads

Thanks for the info and for the method, I'll add that to my palette.

It's a bummer it is so complicated and unsearchable. But it's possible. 🙂

(Half an hour later before I actually pressed submit.)

But this left me wondering that DCS-BIOS guys must know it already and perhaps have such a database. Old dcs-bios repo wasn't helpful as it only defined seven indicator lamps, but I found this treasure - and it contains:

C_101:defineIndicatorLight("CC_FRONT_WARN_AOA", 167, "Warning, Caution and IndicatorLights", "C-101CC FRONT Warning Panel AOA/STALL Lamp (yellow)")

Now how they got from this to this piece of JSON that is available in their release...

"CC_FRONT_WARN_AOA": {
       "category": "Warning, Caution and IndicatorLights",
   "control_type": "led",
    "description": "C-101CC FRONT Warning Panel AOA/STALL Lamp (yellow)",
     "identifier": "CC_FRONT_WARN_AOA",
         "inputs": [  ],
        "outputs": [ {
                         "address": 14182,
         "address_mask_identifier": "C_101_CC_FRONT_WARN_AOA_AM",
   "address_mask_shift_identifier": "C_101_CC_FRONT_WARN_AOA",
                     "description": "0 if light is off, 1 if light is on",
                            "mask": 4,
                       "max_value": 1,
                        "shift_by": 2,
                          "suffix": "",
                            "type": "integer"
                   } ]

...is a mystery to me. Also, I don't see any relation between the address and mask and the original 167 - so I guess there is none. But at least they have it all sorted out in their sources, which is great. That's the "database" I needed!

(I assume, someone did all the digging in the Modelviewer, or even knew how to read some of the binary files.)


Edited by virgo47
  • Like 1

✈️ L-39, F-5E, F/A-18C, MiG-15, F-86F, C-101, FC3 🛩️ Yak-52, P-47, Spitfire 🚁 UH-1H, Ka-50 III 🗺️ NTTR, PG, SY, Chnl, Norm2 📦 Supercarrier, NS430, WWII 🕹️ VKB STECS+Gladiator/Kosmosima ▶️ DCS Unscripted YouTube

Link to comment
Share on other sites

  • Recently Browsing   0 members

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