Jump to content

Scripting Keystrokes at Mission Start?


WytchCrypt

Recommended Posts

39 minutes ago, TimRobertsen said:

 

It seems that all the different articles I've been reading on this subject have not been applicable to setting up triggers in the F/A-18.

 

For ex. this one: http://volatusvirtualis.blogspot.com/2019/09/dcs-advanced-mission-editor-concepts.html

 

In the Mirage there is apparently a correspondence between the "COMMAND" and the "PTN_XXX"-number in the clickabledata.lua. This does not seem to be the case with the F/A-18. As you point out: you have to get the command from the Options-Controls-page.

 

Hi.

 

Didnt knew about that Blog, the subjects of cockpit interaction using the Mission Editor is not well documented by ED and it seems that the different developers use their own conventions to ease their use. The Mirage is one of the earliest third party aircrafts and seems that they did a lot to ease the complexities of cockpit triggers as they worked closely with Baltic Dragon to create one of the best set of Training Missions.

 

But, yes, it seems that every aircraft is a bit different on this regard .. so far I've made training missions for the C-101, F-16, F-18, Mig-21, Mi-8, JF-17 and A-4E ... and every one of them was slightly different  ... in some cases a few controls worked for the pilot but not for the Triggers, as I found a few bugs. Also, sometimes the Module updates change these codes rendering the missions obsolete ... this was particularly infuriating with the JF-17 🙂

 

Even so, I enjoy editing training missions, as they force me to learn the aircraft systems and weapons a lot better.

Best regards,

 

 

Eduardo

  • 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

21 hours ago, Rudel_chw said:

 

 

Makes sense (now that I am aware of the fact:p)

 

I got everything to work as I wanted 🙂 Thanks for all the help! 🙂

 

 

My new F/A-18 trigger-list:

Strobe Down    8 3009 -1
L Gen off    3 3028 0
R Gen off    3 3029 0


-Axis-
UFC bright    25 3040 -1 x50
Comm1 Vol    25 3036 -1 x50
Comm2 Vol    25 3038 -1 x50
Oxy flow    10 3004 -1 x10
Ifei Bright    33 3008 -1 x40

Defog Handle    11 3015 -1 x130
Cabin Temp    11 3017 -1 x15
Suit Temp    11 3019 -1 x15

Push to Test    30 3002 -1 x2

 

I'm surprised how easy it was, once I knew what to do and how to do it 🙂 


Edited by TimRobertsen
  • Like 1

First become an aviator, then become a terminator

Link to comment
Share on other sites

21 hours ago, Rudel_chw said:

 

Do you know if it is possible to make a script which can run the different clickable actions? So that you can simply have a trigger to run a script, instead of having to set up a long list of actions.

First become an aviator, then become a terminator

Link to comment
Share on other sites

5 minutes ago, TimRobertsen said:

 

Do you know if it is possible to make a script which can run the different clickable actions? So that you can simply have a trigger to run a script, instead of having to set up a long list of actions.


I really don’t know, scripting isn’t my strength 😞

 

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

4 minutes ago, Rudel_chw said:


I really don’t know, scripting isn’t my strength 😞

Same here 😛 I just keep thinking that there must be a way to do it 😛

 

The triggers are listed in the "mission.lua-file" within the .miz-file. So there must be a way to copy them and put them in their own trigger-script-file. It's just a matter of how to do it 😛

First become an aviator, then become a terminator

Link to comment
Share on other sites

I tried exactly that, creating a script to activate clickable actions, but failed. The required functions were/are 'private', i.e. DCS did/does not allow them to be called from within a mission script. So I reverted back to making lists of actions...

Link to comment
Share on other sites

  • 3 months later...

Look at the file: 

DCS World\Mods\aircraft\FA-18C\Cockpit\Scripts\Macro_sequencies.lua

 

It is a script that, when it is called, runs cockpit clickable functions for aircraft start-up. I should think it might be possible to adapt its format to achieve your goals.

Link to comment
Share on other sites

  • 7 months later...
On 6/18/2021 at 8:54 AM, Habu_69 said:

Look at the file: 

DCS World\Mods\aircraft\FA-18C\Cockpit\Scripts\Macro_sequencies.lua

 

It is a script that, when it is called, runs cockpit clickable functions for aircraft start-up. I should think it might be possible to adapt its format to achieve your goals.

Will this only work for single player? How would you call the script on demand during startup in multiplayer sessions? I was trying to accomplish this with AutoHotKey and it was working but stopped suddenly and I don't know why. The key bind to run the macro isn't making it out of DCS to the AutoHotKey script anymore. It wasn't because of an update or anything, I was editing the script, adding to it after I had it working and then it just stopped working altogether and I can't figure out why. The script works, if I hit the hotkey for the macro in say notepad, but as said, the hotkey isn't making it out of DCS anymore or the keystrokes aren't making it from the script into DCS. I had that problem with Opentracker once, where the recenter key wasn't making it out of DCS but solved it by making sure DCS was NOT running as administrator. Still, I can't seem to figure it out. So to recap, Opentracker recenter key which is my num 5 key, makes it out of DCS when playing and recenters my headtracker, but Shift+q isn't making it out of DCS to invoke the macro, or at least seems that way, it might be making it out but the macro strokes aren't making it in to DCS then. Funny because I have the script running now and even trying to type 'shift+q' it starts running the macro, here it is in action D1122. From the thread, it sounds like VoiceAttack commands make it out of DCS and into the VoiceAttack when not focused. I'd chalk it up to DCS blocking the keystrokes but it was working just last night and then something went wrong and now nothing, no matter what script I try to activate. I might have to try another macro program. Mind you, my intent isn't to cheat or game the game, I simply get tired of having to perform the same function like setting up my weapons and radar EVERY time I hop in the jet for the first time or respawn. We should have this functionality in a Data Cartridge by now, it's ridiculous and been far too long, but it is what it is.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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