Jump to content

Do Script File - How to Read and Change Cockpit Control?


CrossWiseRanger

Recommended Posts

I understand how to use triggers to perform click actions on cockpit controls and where to find the argument, cockpit device, and command numbers in devices.lua and clickabledata.lua.

 

My example is the Left MFCD brightness toggle. This action 'X:COCKPIT PERFORM CLICKABLE ACTION(2, 3027, 1, "")' will increment the brightness level and works.

 

I want to perform the same capability except from a .lua file loaded with Do Script File.

 

Two questions:

 

1. How is the action formatted? I cannot locate information on such DCS function calls.

 

2. Conversely, how can I read a control with a function call.

 

For example, I want to set the Brightness to 28. First read the value and then inc / dec from current to the desired level which is a value between 0 and 64.

 

Have looked at MIST and MOOSE neither of which seem to address cockpit control settings.

 

Thanks


Edited by CrossWiseRanger
Show title as question
  • Like 1

VR with Oculus Rift preferred flying method.

Link to comment
Share on other sites

The scripting engine doesn't have access to the cockpit related triggers. So anything with it that you want to do has to be done via triggers only.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Maybe Asked Wrong Question

 

Grimes - thanks for the info.

 

Disappointing news that cockpit actions cannot be done from a script. So for repetitive training, who wants to manually reset all of the controls each time restart a mission? For example, flying with NVG's would take a lot of time just to reconfigure the lights. This is a disincentive for playing complicated missions. Also wastes time while doing training for a specific task to AGAIN reconfigure the cockpit on start.

 

So, maybe I asked the wrong question. Once I have all of the cockpit triggers set in a mission, how do I transfer that "set" for use in another mission? For example a set of triggers that changes the cockpit configuration between "Day", "Night", and "NVG" mode. I use one of the spare buttons on the UFC to trigger the change.

 

Surely the answer is not to manually reenter the data in a new mission; or, even to start that as a mission shell for aircraft trigger setup!

VR with Oculus Rift preferred flying method.

Link to comment
Share on other sites

  • 5 months later...

Is there any update on this? I have exactly the same question where I want to set the cockpit up in a certain manner for a particular type of practice that I would like to repeat over and over again without having to waste time setting up things like TACAN and the HSI, lighting and such.

Link to comment
Share on other sites

I have only just recently come across this post so here is my input.

 

There is no way at present to be able to copy "Triggers" between mission builds...(I do hope it is a feature that could be incorporated some stage).

 

This is only a suggestion but why not amend the auto startup sequence to include what ever changes you wish to incorporate. Load that prior to starting DCS via JSGME or OvGME. When you press LWin+ Home your startup sequence will then include your additional setup. :thumbup:

Callsign: NAKED

My YouTube Channel

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 2 years later...
  • Recently Browsing   0 members

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