Frag Posted September 16, 2018 Posted September 16, 2018 Hi guys, this thing is driving me nuts. I am pretty sure that I am not the only one who has this so here it is. My DCS folder is on F:\DCS World ...which is an SSD drive. My personal mission folder is on d:\DCS\Mission (I keep all my code on another that I commonly backup Now here is what happen. When I modify a LUA script on the D drive and launch my mission from the mission editor ... the script is never updated and DCS execute an old version of it!!!! So even though I modify my lua sript, it is never updated and DCS use the old version I had when I started the game. I also saw in the DCS logs that DCS use the script from a temp folder, but does not seem to update it whenI start the mission! It take the script from a temp folder here: 2018-09-16 16:50:27.619 ERROR DCS: Mission script error: : [string "C:\Users\Steph\AppData\Local\Temp\DCS\/~mis00005377"]:1 What the heck I am missing here?!
snowsniper Posted September 16, 2018 Posted September 16, 2018 each time you modify a lua script, you have to reload the new one once again in mission editor, and save the mission file. don't think there is an other way. i7-10700KF CPU 3.80GHz - 32 GO Ram - - nVidia RTX 2070 - SSD Samsung EVO with LG TV screen 40" in 3840x2150 - cockpit scale 1:1 - MS FFB2 Joystick - COUGAR F16 throttle - Saitek Pro Flight Rudder Pedals
Hardcard Posted September 16, 2018 Posted September 16, 2018 (edited) Mission Editor doesn't read the attached script and sound files dynamically. When you attach any file to a mission in ME and save the mission, you're actually creating COPIES of those attached files and saving them inside the .miz file for that mission (it's a one time thing). This process needs to be repeated every time you make changes to those files. I think there's a way to make ME read files dynamically, but you'll need to set up symlinks in Windows. Edited September 16, 2018 by Hardcard [sIGPIC][/sIGPIC]
Frag Posted September 16, 2018 Author Posted September 16, 2018 each time you modify a lua script, you have to reload the new one once again in mission editor, and save the mission file. don't think there is an other way. By reloading do you mean removing the trigger and recreate it? Or simply clicking the button OPEN and reassign the script file? Mission Editor doesn't read the attached script and sound files dynamically. When you attach any file to a mission in ME and save the mission, you're actually creating COPIES of those attached files and saving them inside the .miz file for that mission (it's a one time thing). This process needs to be repeated every time you make changes to those files. I think there's a way to make ME read files dynamically, but you'll need to set up symlinks in Windows. I found some kind of workaround by doing a DO SCRIPT command instead of DO SCRIPT FILE and in the DO SCRIPT I load the lua script this way dofile([[F:\DCS Missions\Test03\Test03.lua]]) This works perfectly! But I guess that this will not work if I publish my mission and other use it. So I guess I will load dynamically to help accelerate the development and when everything will be ready then I will assign the files to my triggers with the DO SCRIPT FILE.
Hardcard Posted September 16, 2018 Posted September 16, 2018 But I guess that this will not work if I publish my mission and other use it. So I guess I will load dynamically to help accelerate the development and when everything will be ready then I will assign the files to my triggers with the DO SCRIPT FILE. Yes, that seems correct. [sIGPIC][/sIGPIC]
Frag Posted September 16, 2018 Author Posted September 16, 2018 Thanks ... but EagleDynamic should really repack the script filea at each start (or at least have an option to do it). It is very cumbersome to deal with this as a beginner when you are a script newbie ... you do a LOT of error.
snowsniper Posted September 16, 2018 Posted September 16, 2018 clever brilliant neat found ( i must have click the button OPEN and reassign the script file about 1 billion time since i'm doing scripting... lol) As a lua noob myself, i know what you mean by many many errors lol ) I'll give it a try. thanks for the tip By reloading do you mean removing the trigger and recreate it? Or simply clicking the button OPEN and reassign the script file? I found some kind of workaround by doing a DO SCRIPT command instead of DO SCRIPT FILE and in the DO SCRIPT I load the lua script this way dofile([[F:\DCS Missions\Test03\Test03.lua]]) This works perfectly! But I guess that this will not work if I publish my mission and other use it. So I guess I will load dynamically to help accelerate the development and when everything will be ready then I will assign the files to my triggers with the DO SCRIPT FILE. i7-10700KF CPU 3.80GHz - 32 GO Ram - - nVidia RTX 2070 - SSD Samsung EVO with LG TV screen 40" in 3840x2150 - cockpit scale 1:1 - MS FFB2 Joystick - COUGAR F16 throttle - Saitek Pro Flight Rudder Pedals
snowsniper Posted September 16, 2018 Posted September 16, 2018 i've just give this a try, unfortunately, doesn't work when script are dependant each other. for example with ATME, you have a main core script engine which load all other scripts so I can't use this neat turnaround with this script engine. should be interresting to test with some other lib or engine script, like moose or Mist. i7-10700KF CPU 3.80GHz - 32 GO Ram - - nVidia RTX 2070 - SSD Samsung EVO with LG TV screen 40" in 3840x2150 - cockpit scale 1:1 - MS FFB2 Joystick - COUGAR F16 throttle - Saitek Pro Flight Rudder Pedals
Hardcard Posted September 16, 2018 Posted September 16, 2018 (edited) Can't you load the main ATME script normally and then use Frag's trick to load the rest of scripts dynamically? Edited September 16, 2018 by Hardcard [sIGPIC][/sIGPIC]
snowsniper Posted September 17, 2018 Posted September 17, 2018 Can't you load the main ATME script normally and then use Frag's trick to load the rest of scripts dynamically? don't seems to work, but nothing seems impossible for Sunski34 who made ATME engine, maybe if it's a light modification or condition to use it like that for more easy testing and debugging. He ever knows about this thread, i've sent him a link and he found the idea neat too. so wait and see. if it's possible and easy for sure he would do some tweak in the engine to allow it if it need to rethink all the concept and main global modular script engine logic it won't be possible.:book: i7-10700KF CPU 3.80GHz - 32 GO Ram - - nVidia RTX 2070 - SSD Samsung EVO with LG TV screen 40" in 3840x2150 - cockpit scale 1:1 - MS FFB2 Joystick - COUGAR F16 throttle - Saitek Pro Flight Rudder Pedals
snowsniper Posted December 27, 2018 Posted December 27, 2018 (edited) It works with ATME without the need to reload with this turnaround : create a generic lua file with minimum info for ATME and load it in Mission Editor with a do script file as normal procedure *********************** local thisModule local moduleName = "temp" -- nom du present module --____________________________________ do dofile([[E:\savedgame2016\DCS.openbeta\Missions\Luaprogrammation\MAJ SNOW 2018\2018 FINIS\LIB_ATC_aknoledgment\LIB_ATC_2019.lua]]) -- link to you WIP lua file module local newHandlers = { onCreatePlayerHandler = nil, onDeletePlayerHandler = nil, onUpdatePlayerHandler = nil, onTakeoffPlayerHandler = nil, onLandingPlayerHandler = nil, onStartEnginePlayerHandler = nil, onStopEnginePlayerHandler = nil, onCreateAIUnitHandler = nil, onDeleteAIUnitHandler = nil, onDisableAIUnitHandler = nil, onTakeoffAIUnitHandler = nil, onLandingAIUnitHandler = nil, onStartEngineAIUnitHandler = nil, onStopEngineAIUnitHandler = nil, onCreateGroupHandler = nil, onSpawnGroupHandler = nil, onDeleteGroupHandler = nil, onDisableGroupHandler = nil, onCreateStaticObjectHandler = nil, onDeleteStaticObjectHandler = nil, onTimerHandler = nil, onModuleStartHandler = nil, } thisModule = ATME.C_Module(moduleName, newHandlers, true) end Edited December 27, 2018 by snowsniper i7-10700KF CPU 3.80GHz - 32 GO Ram - - nVidia RTX 2070 - SSD Samsung EVO with LG TV screen 40" in 3840x2150 - cockpit scale 1:1 - MS FFB2 Joystick - COUGAR F16 throttle - Saitek Pro Flight Rudder Pedals
Recommended Posts