Jump to content

Whats the purpose of Saved Games Scripts folder and hook folder


Recommended Posts

Posted

As the title states what is the purpose of the scripts and hook folder located at

C:\Users\"USERName"\Saved Games\DCS.openbeta\Scripts

 

I have been looking and it seems that external programs utilize these folders. I am currently building an external program for DCS and would like to know exactly what these folders do and how to utilize them. So if you have any information on this I would love to know. Thanks!!

Posted

To preface this the documentation in your install folder API/DCS_Control.html contains most of the relevant scripting functionality for this folder. You can also go to installFolder/Scripts/export.lua, which contains information relative to export.lua functionality.

 

Script/Hooks: Any lua script in there will be run. Typically its used with the callbacks to know the state the game is in and to contentiously call stuff with the onSimulationFrame callback.

 

Scrips folder itself can contain any other file. The only "protected" name of a file is Export.lua which can be used for any of your export needs. Though typically scripts that export will just use it to call another file that does all the heavy lifting. For example my Export.lua is only this:

 

local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[scripts\DCS-SimpleRadioStandalone.lua]])
local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua')

 

Each pointing to the SRS and tacview files to be used for export.

 

For the sake of simplicity I think most of the scripts that utilize export or the hooks are made to be placed in that folder anyways.

  • Thanks 1

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

Posted
To preface this the documentation in your install folder API/DCS_Control.html contains most of the relevant scripting functionality for this folder. You can also go to installFolder/Scripts/export.lua, which contains information relative to export.lua functionality.

 

Script/Hooks: Any lua script in there will be run. Typically its used with the callbacks to know the state the game is in and to contentiously call stuff with the onSimulationFrame callback.

 

Scrips folder itself can contain any other file. The only "protected" name of a file is Export.lua which can be used for any of your export needs. Though typically scripts that export will just use it to call another file that does all the heavy lifting. For example my Export.lua is only this:

 

local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[scripts\DCS-SimpleRadioStandalone.lua]])
local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua')

 

Each pointing to the SRS and tacview files to be used for export.

 

For the sake of simplicity I think most of the scripts that utilize export or the hooks are made to be placed in that folder anyways.

Great information as always thank you!!

  • Recently Browsing   0 members

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