In order to reproduce this issue I write a script:
============================================================
--Server environment script
local TestScriptVariable = {}
local TestScriptCallbacks = {}
TestScriptVariable.freshrate = 5
TestScriptVariable.LastTime = DCS.getModelTime()
TestScriptVariable.message = "trigger.action.outText('Test',5,false)"
function TestScriptCallbacks.onSimulationFrame()
local CurrentTime = DCS.getModelTime()
if CurrentTime > TestScriptVariable.LastTime + TestScriptVariable.freshrate then
net.log(net.dostring_in('mission',TestScriptVariable.message)) --where the issue is
TestScriptVariable.LastTime = CurrentTime
end
end
DCS.setUserCallbacks(TestScriptCallbacks)
=============================================================
Put the file into SavedGames\DCS(or DCS.openbeta)\Scripts\Hooks and run the game.
When the simulation started I will get some logs with the same ERRORs every 5 seconds:
nullINFO LUANET [string "trigger.action.outText('Test',5,false)"]:1: attempt to index global 'trigger' (a nil value) false
But if I directly copy the "string trigger.action.outText('Test',5,false)" and run this line of code in the mission environment there will be no errors.
I don't know if I did something wrong?
If not, this might be a bug?