Jump to content

Recommended Posts

Posted

Im sure everyone here is aware of the keyboard input pitfall when designing external switches which can cause the sim to be out of sync with switch position. Aside from setting up joystick/keyboard commands in DCS setup, what file and how would you directly write to the sim? Export.lua seems pretty easy to read. So how do you write?

Intel i7 990X, 6GB DDR3, Nvidia GTX 470 x2 SLI, Win 7 x64

http://picasaweb.google.com/sweinhart

Posted

I'm sorry but maybe I've misunderstood your question (keyboard etc)...how to write to Export.lua?

 

You can send info/commands etc back to Export.lua over the same socket that you've used to extract stuff from DCS, you then need to parse this in export.lua and call the appropriate commands to toggle switches etc.

 

Is this what you meant?

 

/brds

Oakes

Posted

There are examples of doing what Oakes said in both his SIOC scripts and the Touchpal scripts.

 

One thing to note is that not all commands can be executed like this. Only clickable items in the cockpit can be triggered through lua. For other things (like controls on the collective, view controls, etc) must be done either through mapping direct x buttons in game or keyboard emulation.

Posted

I read this in the DCS documentation on the feature here

http://www.digitalcombatsimulator.com/index.php?end_pos=567&scr=default&lang=en

 

haven't tried it myself but it sounds promising

 

DCS calls the function LuaExportBeforeNextFrame just before every simulation frame. So if you want to set some input control commands then you can do it here. For example:

LoSetCommand(3, 0.25) -- rudder 0.25 right

LoSetCommand(64) -- increase thrust

There are discrete and analogous input control commands. The discrete command has code only:

LoSetCommand(64) -- increase thrust

The analogous command has code and value:

LoSetCommand(3, 0.25) -- rudder 0.25 right

Posted

Thanks, this is helpful. This source looks pretty incomplete at the moment, is there another source for information, or a thread, pertaining to the changes? Also, I don't see any mention of input, to get back to the OP's topic.

 

Do these changes take effect with the installation of a DCS patch?

Posted
Thanks, this is helpful. This source looks pretty incomplete at the moment, is there another source for information, or a thread, pertaining to the changes? Also, I don't see any mention of input, to get back to the OP's topic.

 

Do these changes take effect with the installation of a DCS patch?

 

Yes, the changes are part of the 1.0.1 patch. That wiki page is unfortunately the entirety of the official information on this topic. I have posted several times in various threads on how to get the information you need from the lua files included with the game. Search through my old posts to find them. I know several where in Oakes build thread, but some where scattered as answers to other questions.

Posted
Yes, the changes are part of the 1.0.1 patch. That wiki page is unfortunately the entirety of the official information on this topic. I have posted several times in various threads on how to get the information you need from the lua files included with the game. Search through my old posts to find them. I know several where in Oakes build thread, but some where scattered as answers to other questions.

Ok I see your post on page 19 of Oakes build. That will do the trick, thanks.

  • Recently Browsing   0 members

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