Jump to content

[Help] Getting to work my callbacks


Max_ARG

Recommended Posts

Hey guys, I am just done with it and I need help if somebody has a bit of time.

 

I have read DCS World\API\DCS_ControlAPI.html file in order to implement the onSimulationFrame callback function and others. That's what I am trying.

 

This is my VERY basic code, it's in a file named TestingCallbacks.lua and located in C:\Users\Maxi\Saved Games\DCS\Scripts\Hooks:

 

local myCallbackTable= {}

 

function myCallbackTable.onSimulationStart()

env.info("Calling onSimulationStart...")

end

 

function myCallbackTable.onSimulationFrame()

env.info("Calling onSimulationFrame...")

end

DCS.setUserCallbacks(myCallbackTable)

 

So far I got no message log in Dcs.log file located in ..\dcs\logs\dcs.log

I tried installing working scripts like SLmod-witchcraft-SimpleRadioStandalone-Tacview and all of them are working. Reading all their source code wasn't of much help sadly and 7 hours later I am just done.

 

The testbed mission consists of one SU25t available as 'Client', not player, not AI.

 

The plane is turned off, at the ramp start.

 

I suspect I have to do something with Export.lua but I have no clue really.

 

Sometimes I get an error in the log that says 'attempt to index global 'DCS' (a nil value)', so I suspect I am not reaching DCS really.

 

My intention: Creating a simple client-server with my external C++ app using sockets, so i can get data in and out of DCS.

 

If I write the env.info, outside the function callbacks, the env.infois called fine, so the file is recognized by the sim I guess.

 

Feel free to ask me anything or whatever.

Any help will be very welcome and thanks!


Edited by Max_ARG
Link to comment
Share on other sites

  • 5 months later...

Hi,

I found something interesting here:

https://forums.eagle.ru/showthread.php?p=3034367

 

 

"Installation:

Take the file and put it in the servers - C:\Users\<computer name>\Saved Games\DCS\Scripts\

File has to end with GameGUI.lua (case sensitive)"

 

After that, it worked for me! (but not callbacks, not yet)

 

Thx xcom if you read this :)


Edited by astazou

My DCS contributions:
- My mods/skins: here
- My server/missions scripts: there
- My Discord bot:
this place
If you want to thank me buying a coffee☕/beer🍺, feel free:
https://www.buymeacoffee.com/Astazou

Link to comment
Share on other sites

  • Recently Browsing   0 members

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