Jump to content

Recommended Posts

Posted (edited)

Hi,

 

I am currently playing around with the scripting environment for DCS on a dedicated server, that I'm hosting locally to test, and have registered some callbacks. I have noticed that these callbacks all work fine and are logging to the log file as expected.

 

When I add the getMissionFilename or getMissionName functions, however, the callbacks, that I add these function calls to, stop logging with no errors being logged.

 

'Here's what I currently have

local dcsexporter = {}

function dcsexporter.onMissionLoadBegin()
    net.log('[DCS Exporter] onMissionLoadBegin ' + DCS.getMissionFilename())
end

function dcsexporter.onSimulationStart()
    net.log('[DCS Exporter] onSimulationStart ' + DCS.getMissionFilename())
end

if DCS.isServer() then
    net.log('[DCS Exporter] Adding DCS Exporter Hooks')
    net.log('[DCS Exporter] Running as Server')
    DCS.setUserCallbacks(dcsexporter)
end

 

If I remove the concatenation and the GetMissionFilename calls then everything works fine.

 

I would appreciate if somebody could point out exactly what I'm doing wrong.

Edited by ColinM9991
Posted

String concatination in lua is two periods. If you use + it is assuming it is adding two numerical values. 

 

net.log('[DCS Exporter] onMissionLoadBegin ' .. DCS.getMissionFilename())

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

  • Recently Browsing   0 members

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