Hi all,
I contacted Shepherd about a possible solution which helped me a lot..
I was helped by one of the co members (Nighteyes, Aka Tim) from the 31st Virtual Fighter squadron, (
www.31st.nl) (in dutch)
The PsCockpit mainboard is back to Shepherd for investigation. It does not recognise attached boards. I don't know why, so i Send it to spain.
After the adjustments below The PsCockpit Display and Gauges board works perfectly.
**********************************************
The problem was this:
When doing single player mission and setting the skill to client:
The mission starts, but because of the client skill setting, you get a role selection screen to select wich aircraft you want to fly. At this moment, the export.lua is already being executed. Since we haven't selected a role yet, the script fails because LoGetSelfData is empty. We can then select a role, but the script has already failed and wont start again.
The solution was to hold of on executing the script until LoGetSelfData exists.
the export.lua should be changed to this:
-----------------------------------------------
function LuaExportActivityNextEvent(t)
--General
local tNext = t
if LoGetSelfData() then -- do not execute untill player selects an aircraft and is in cockpit.
local t = LoGetModelTime()
-- Info
local lMyInfo = LoGetSelfData()
local name = LoGetPilotName()
local currentAircraft = lMyInfo["Name"]
--For debug purposes
-- local nametype = LoGetNameByType
-- Output_file_Debug = io.open(lfs.writedir().."/Logs/PSCockpitDebug.txt", "w+")
-- Output_file_Debug:write(string.format("%s\r\n",name))
-- Output_file_Debug:write(string.format("%s\r\n",currentAircraft))
-- Output_file_Debug:close()
--Aircraft Selection
if currentAircraft == "A-10C" then
dofile(lfs.writedir().."/Scripts/ExportPSCockpit-A10C.lua")
elseif currentAircraft == "F-16C_50" then
dofile(lfs.writedir().."/Scripts/ExportPSCockpit-F16C-50.lua")
end
end
tNext = tNext + 0.1 -- these lines should always be executed or this routine will only be called once.
return tNext
end
--------------------------------------
With the addition of the if then statement, it now works in all cases.
Its works perfectely.