Darcaem Posted October 19, 2024 Posted October 19, 2024 (edited) Is it possible to trigger the "X: COCKPIT HIGHLIGHT ELEMENT" action through lua? I would like to create exactly the same we get on the startup tutorial missions, but I would like it to be through a script that I could simply add to any of my missions (using SET_CLIENT for example to detect which aircraft is used and launch the appropiated tutorial) without the need of copying all the triggers used on each ED's tutorial every time I want to add it to a mission. In summary, I would like to be able to copy startup tutorials easily on my sandbox missions Edited October 19, 2024 by Darcaem
Solution cfrag Posted October 23, 2024 Solution Posted October 23, 2024 On 10/20/2024 at 12:09 AM, Darcaem said: Is it possible to trigger the "X: COCKPIT HIGHLIGHT ELEMENT" action through lua? Not directly, no. But looking at what you are trying to do, i think that would be the least of your challenges: On 10/20/2024 at 12:09 AM, Darcaem said: I would like to create exactly the same we get on the startup tutorial missions, but I would like it to be through a script that I could simply add to any of my missions Uh - you're in for a hellish experience here. Tutorials usually read/set cockpit switches and await control inputs using the miz actions "X" tree which are mostly unavailable via normal scripting (you can read the value of a cockpit/3D model item using unit.getDrawArgument(), but AFAIK you can't set it, so you'd have to resort to active polling and asking the player to change the setting of that model item. Each aircraft has it's own model items, they do not have standardized names, and finding an argument value for a specific plane for a specific switch is a painful procedure involving the model viewer. Add to this the fact that in single-player you may be able to figure out what kind of aircraft "you" are flying, that is impossible in MP - the is no concept of 'I' in mission scripts. On 10/20/2024 at 12:09 AM, Darcaem said: using SET_CLIENT What invocation is that? What does it do? On 10/20/2024 at 12:09 AM, Darcaem said: I would like to be able to copy startup tutorials easily I believe everyone agrees that this would be great. Currently, I don't see a way to do it in vanilla DCS. Mayhaps if you have access to ED's private mission scripting tools for third paries. 1
Darcaem Posted October 23, 2024 Author Posted October 23, 2024 That's what I though... but it was worth the try to ask jejeje I was referring to this https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_CLIENT). In my head I wanted to get all client slots and the "initiate" whatever code I could write to enable the "tutorial"
Recommended Posts