Jump to content

timothyboss

Members
  • Posts

    83
  • Joined

  • Last visited

About timothyboss

  • Birthday September 11

Personal Information

  • Flight Simulators
    Yup
  • Location
    Earth
  • Interests
    Spelunking

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Sharing a mission as a static template will cause the supplied data to change if another user imports the stm file in their mission. In the static template the STN should be 67201, 67202 and the Callsign should be RD11, RD12 etc. When another user adds it to their mission the STN defaults to 0J.... and the callsign reverts to ED11 or PC11 or HK11 etc. Is this normal behavior? VFA-97 Ridgid 4 ODS M06 Template Rev 2.stm
  2. Can you maybe allow it integrate realtime uploading of people's export.lua file for realtime unit display on embedded websites or is that not an ability without an API service? Is there a coordinate only export in the form of excel or parsed text? Thanks for your work and time.
  3. I upgraded to 64gb of RAM and M/T shows no advantage. I7-9700, 2080S, SSD, no page file. Just not good for my setup.
  4. Made some updates. On the site one can upload a KML file to the map. In the sheet one can get, via the exports, a file for TheWay. One can download their flight via a KML too.
  5. @Dangerzone @cfrag what are your thoughts on the Export.lua making a call to a file that loads the two independently. So for the FlightPlanner Lua I would have a LuaExportStart () start the server, start to write directory. Perform the task to export and end. Start the write of the second Lua latlongelev.lua and just perform the script. No need for the second script to start at the LuaExportStart (). Once complete with the second Lua... Repeat until the game ends and then I can luaExportStop ().
  6. Maybe using the hooks is the way to go? This is not the first time this issues has been brought up either. There are some good talks across a couple forums of this same issue. People get creating by refining global variables that end up calling on the LuaExportStart () / stop / before frame / after frame / next event. I just need to get smarter on that part.
  7. I'd find myself running into this problem 2 years later. I have two Lua files that both use the LuaExportStart()/...Stop()/...NextEvent(). Both are listed in the Export.lua file located in the Scripts folder. Individually both files work great, but the minute I try to use both together in the Export.lua.... forget it. One steps on the other or vise versa based on the order they are placed in the Export.lua file. Maybe hooks is my solution? One Lua script starts and writes to a folder that is sent off by a server using node.js and the other Lua script just writes locally and both are almost identical with the same functions use within but the file is named differently. I cannot change the function name but maybe can have if, then conditions so they do not step on one another?
  8. I have a suspicion it is probably overwriting the other because of how the scripts were written at one test point. The first (of two) dofile Lua's I am having issues with called the luaexportactivitynextevent() function and the second Lua actually performed the write to the location which confused me. But the second Lua exportnextevent was renamed something else, so I feel there might need to be a pause or delay in the dofile if possible. Maybe have a dofile that performs 1 script and then ends then performs the second then ends. Maybe like a subroutine?
  9. Good question. I don't even see it reporting in the DCS.log file. I might need to print to. Should, normally, the Lua start / stop / exportActiveNextEvent function regardless if other scripts call the same functions?
  10. I'm thinking that maybe for this project... If I have to start or stop or pause and wait with if statements in the exporting of the same or similar data, then I might just try to build a master export Lua that writes to multiple locations in the format I need for both separate projects. I should be able to set a global variable that starts say named function script1() and runs through the code in latlongelev.lua and then end with a continuation to function script2() run FlightPlannerGPS.lua end and then 30 seconds later repeat. That way both files should be written, and ended so the other can be written and ended without being stepped on. I will just have to start the server for node.js outside in a new global variable, remove the loops inside the independent Lua scripts so they complete and I should be good. When the game closes, the server closes and the problem should be solved? Maybe? Thoughts. If only DCS Lua environ would allow multiple calls of the LuaExportActivityNextEvent () by affixing a 1,2,3.... To the end. Or I just need to get better... The later.
  11. Hello and thanks for your reply. you are correct in that the two files called by the export.lua are in fact "FlightPlannerlfs" and "multiExportGSlfs" and the "w" to "a" did nothing as the ..'Scripts/FlightPlanner/FlightPlanner.lua') is being blocked by ..'Scripts/multiExportGS/latlongelev.lua'). Im still at it, but a good head scratcher. seems like I need to call on them separately, but having a heck of a time defining that process. That is correct. I wan them to both be independent of one another an each run at a set time after executed. they can be staggered, but I am going to attempt to go with your approach and see the outcome. thank you for your input. I let all know of the findings.
  12. in case I still have followers in this post. I did not have much luck in the previous posting so I instead used some info from the export and knowledge of units to have excel functions lookup and such. anyhow thank you all for your inputs. I do have a second question if anyone might have the answer (I will continue to search the forum too) I have the Export.lua script in my saved games with the following call outs. local wwtlfs=require('lfs');dofile(wwtlfs.writedir()..'Scripts/wwt/wwtExport.lua') local FlightPlannerlfs = require('lfs');dofile(FlightPlannerlfs.writedir()..'Scripts/FlightPlanner/FlightPlanner.lua') local multiExportGSlfs=require('lfs');dofile(multiExportGSlfs.writedir()..'Scripts/multiExportGS/latlongelev.lua') dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]]) local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua') local TheWayLfs=require('lfs');dofile(TheWayLfs.writedir()..'Scripts/TheWay.lua') pcall(function() local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[Mods\Services\DCS-SRS\Scripts\DCS-SimpleRadioStandalone.lua]]); end,nil) Now my problem is that these two keep stepping on one another meaning which ever is in the bottom wins and thats is the lua that provides the output file. when I swap these two around then the one on the bottom wins etc. and writes. local FlightPlannerlfs = require('lfs');dofile(FlightPlannerlfs.writedir()..'Scripts/FlightPlanner/FlightPlanner.lua') local multiExportGSlfs=require('lfs');dofile(multiExportGSlfs.writedir()..'Scripts/multiExportGS/latlongelev.lua') so what are the two lua scripts it calls? see below, in order of the above post. function LuaExportStart() -- create file object for writing d_output_file = io.open(lfs.writedir().."/Scripts/FlightPlanner/data.json", "w") -- get the start time start_time = os.clock() end function LuaExportStop() -- close the file object if d_output_file then d_output_file:close() d_output_file = nil end -- delete the data.json file os.remove(lfs.writedir().."/Scripts/FlightPlanner/data.json") end function LuaExportActivityNextEvent(t) local currentTime = LoGetModelTime() if not lastExportTime or (currentTime - lastExportTime) >= 30.0 then lastExportTime = currentTime local o = LoGetWorldObjects() -- delete the data.json file before writing to it os.remove(lfs.writedir().."/Scripts/FlightPlanner/data.json") -- create file object for writing d_output_file = io.open(lfs.writedir().."/Scripts/FlightPlanner/data.json", "w") for k,v in pairs(o) do d_output_file:write(string.format("%.1f,%s,%f,%f,%.1f,%.1f,%s\n", t, v.Name, v.LatLongAlt.Lat, v.LatLongAlt.Long, 3.28084*v.LatLongAlt.Alt, 57.2958*v.Heading, v.Coalition)) end -- close the file object if d_output_file then d_output_file:close() d_output_file = nil end end end and function startServer() local folderPath = "E:/Saved Games/DCS.openbeta/Scripts/multiExportGS" -- Replace this with the desired folder location local command = 'start "" powershell.exe -noexit -command "cd \'' .. folderPath .. '\'; node import.js"' -- Concatenate the command to change directory and start the server os.execute(command) -- Execute the command in the system shell end function LuaExportStart() -- create file object for writing default_output_file = io.open(lfs.writedir().."/Scripts/multiExportGS/FltPlannerGPS.log", "w") -- get the start time start_time = os.clock() -- Start the server upon LuaExportStart() startServer() end function LuaExportStop() -- close the file object if default_output_file then default_output_file:close() default_output_file = nil end -- delete the Export.log file os.remove(lfs.writedir().."/Scripts/multiExportGS/FltPlannerGPS.log") -- Close the server upon LuaExportStop() if os.getenv("OS") == "Windows_NT" then os.execute("taskkill /IM node.exe /F") -- Terminate the node.exe process os.execute("taskkill /IM powershell.exe /F") -- Terminate the PowerShell process else os.execute("pkill node") -- Terminate the node process on Unix-like systems os.execute("pkill powershell") -- Terminate the PowerShell process on Unix-like systems end end function LuaExportActivityNextEvent(t) local currentTime = LoGetModelTime() if not lastExportTime or (currentTime - lastExportTime) >= 30.0 then lastExportTime = currentTime local o = LoGetWorldObjects() for k,v in pairs(o) do default_output_file:write(string.format("%.1f,%s,%f,%f,%.1f,%.1f,%s\n", t, v.Name, v.LatLongAlt.Lat, v.LatLongAlt.Long, 3.28084*v.LatLongAlt.Alt, 57.2958*v.Heading, v.Coalition)) end end end I suspect my problem is related to multiple calls to the same function at the same time, but I cannot wrap my head around it. I am suspecting the function: function LuaExportActivityNextEvent(t) is causing the binding or overwritten or stepping on issue. Does anyone know how I might be able to run these two lua scripts separately and independent of one another while both performing as they are intended to function? Thanks in advance.
  13. I haven't had much luck. I have a work around. Get the name of the unit and just use a lookup function to compare and if criteria is met...it's a SHIP, HELICOPTER etc. A little more work, but that's ok. Thanks for your help.
×
×
  • Create New...