Jump to content

Possible with LUA to read an indication?


Go to solution Solved by Jagohu,

Recommended Posts

Posted

Hi folks!

With the trigger condition "X: COCKPIT INDICATION TEXT IS EQUAL TO" I can check for a certain value shown on a indicator.
On the Viggen's data panel for example, with this condition I can check if for the most right digit a "2" was entered, this works fine.
But in fact I want to check what number the user has typed in, so I have to use a script to determine the number.
Is this possible with LUA code as well?

After half an hour of searching I am still not able to find this certain information in the sources I currently use (DCS manual, Forum, Google). 😕

Thanks for any hint!
TOViper

Screen_220419_225353.png

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G 4.4 GHz | NVIDIA RTX 3080 10GB | 32 GB 3.2 GHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TRP | Rift CV1

 

  • 2 weeks later...
Posted

No plans for MP, so it would be great to know if it works in SP and how. Currently I have no clue ...🤔

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G 4.4 GHz | NVIDIA RTX 3080 10GB | 32 GB 3.2 GHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TRP | Rift CV1

 

  • 2 weeks later...
  • Solution
Posted

Not that I found unfortunately. What you can do is set the trigger in the ME to read something and execute a script with that. Cumbersome, but it works.

  • Thanks 1
  • 2 weeks later...
Posted

Yea the above would work fine but it's been a long time since I played with that and I can't recall how to do it however, you would need to be confident with Lua and to use a Hook on the backend to enable you to do it dynamically with code.

Creator & Developer of XSAF ::An AI model that wants to kill you, and needs no help from humans.

Discord: PravusJSB#9484   twitch.tv/pravusjsb  https://www.patreon.com/XSAF  https://discord.gg/pC9EBe8vWU https://bmc.link/johnsbeaslu

Work with me on Fiverr: https://www.fiverr.com/pravusjsb

Posted (edited)

Yes, it’s possible. You can read args, indications, cockpit values, etc. See list_indication and list_cockpit_params for examples.

https://dcs-bios.readthedocs.io/en/latest/lua-console.html

This is how, for example, I have “weapons” for the UH-60 UN Campaign based on the animation argument of a cockpit switch. You can download it from ED user files and take a look at the scripts in mission one to see how. 

Edited by Bailey
  • 2 years later...
Posted (edited)

It just needs 60 triggers (10 for each digit). e.g:

Trigger1 triggers the first digit if its 0, setting a value or flag to something
Trigger2 triggers the first digit if its 1, setting a value or flag to something
Trigger3 triggers the first digit if its 2, setting a value or flag to something
...
..
.
..
...
Trigger 60 triggers the last digit if its 9, setting a value or flag to something

Then it's done :biggrin:

Edited by TOViper

Visit https://www.viggen.training
...Viggen... what more can you ask for?

my computer:
AMD Ryzen 5600G 4.4 GHz | NVIDIA RTX 3080 10GB | 32 GB 3.2 GHz DDR4 DUAL | SSD 980 256 GB SYS + SSD 2TB DCS | TM Warthog Stick + Throttle + TRP | Rift CV1

 

  • Recently Browsing   0 members

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