Pikey Posted April 27, 2017 Share Posted April 27, 2017 I had some requests for this. I think it's fair to say we all use our own workflows when designing missions with script files and know how long it takes. One major hurdle is the time it takes to edit a script file that's in a mission file. This is because the ME doesn't check if a file has changed, just it's name. The solutions are many, you can use FSF_Ian's LUA interpreter, you can write the script into a "DO SCRIPT", you can even try opening the file directly and swapping the new scripts in via 7zip. But none of these are simple, or as simple as the following. If you haven't come across this, it will save you a lot of time. And I know at least some of you haven't, so saving a few of you hours across the years coming, is well worth the two hours it took to get this up there. The following video will show you how to: 1) Edit scripts on the fly and run them in the game without restarting the mission. 2) Give you some ideas on how to shorten your troubleshooting workflow with scripting 3) Demonstrate live, running a script, editing it, chasing an error and re-running it, all in the same mission 4) Give a new scripter a way of testing out LUA directly in game and it's effects and perhaps encourage them to learn more This example uses MOOSE, but it's applicable to standalone scripts, snippets, ATME and of course MIST. I'm thinking of doing some follow ups if this generates interest. I'd like to say, I've had no formal development background whatsoever! I'm a techie. If any of it makes you shudder, remember people have to learn this without formal education! 6 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
WildBillKelsoe Posted April 27, 2017 Share Posted April 27, 2017 can you post the missile trainer? AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow. Link to comment Share on other sites More sharing options...
Pikey Posted April 27, 2017 Author Share Posted April 27, 2017 Do you mean the moose test mission with it in or how to use it? can you post the missile trainer? 1 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
WildBillKelsoe Posted May 2, 2017 Share Posted May 2, 2017 Do you mean the moose test mission with it in or how to use it? yes the mission as a youtube video. I want to see how it looks like. Sent from my iPhone using Tapatalk AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow. Link to comment Share on other sites More sharing options...
dannyq8 Posted May 2, 2017 Share Posted May 2, 2017 Very useful and informative video, thanks Pikey Wise men speak because they have something to say; Fools because they have to say something. Plato Link to comment Share on other sites More sharing options...
lemoen Posted May 2, 2017 Share Posted May 2, 2017 awww yeah. Thanks. Link to comment Share on other sites More sharing options...
FSFIan Posted May 3, 2017 Share Posted May 3, 2017 Great video! This is definitely the way to go if you are developing a mission script. The Lua console in DCS Witchcraft was not designed for larger scripts (it does not even have a save function). It works well with small, ephemeral code snippets, for example to inspect the contents of global variables without running your script again or to interactively figure out how to use a single function in the DCS: World API. I'd like to say, I've had no formal development background whatsoever! I'm a techie. If any of it makes you shudder, remember people have to learn this without formal education! Don't worry about formal training, it does not matter. I have a BSc in Computer Science, but that does not mean I know how to program anything more complex than a reference implementation of an algorithm without any error handling. (Maybe I should have studied Software Engineering instead.) I did not learn much about error handling, debugging, using a version control system, and writing maintainable software in lectures. I learned about these things because I was programming in my student jobs and as a hobby. For most software, the hard part in creating it is not figuring out new algorithms. It's managing complexity. It's structuring the code in a way that will be maintainable in the future. I wrote my first lines of code 20 years ago and have been programming as a hobby ever since. I still feel like I don't know what I am doing. I also think that no amount of formal training will help with that; I'll just have to get a job and gain more experience, one mistake at a time. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua Link to comment Share on other sites More sharing options...
Pikey Posted May 3, 2017 Author Share Posted May 3, 2017 Oh sure, not knowing things doesn't worry me (did in my 20's) but then experience tells me I can learn things the hard way. :) I'll have a go at anything, I love experiences! Reminds me of the saying, "Experience is a hard teacher. She gives you the test first and the lesson after." I'm doing some scripts now that are quite hard to pick up and read if i'm not constantly at them and i'm learning why people write with good spacing and tab discipline for their loops and so. But painfully coming to this realisation now... Ian;3128505']Great video! This is definitely the way to go if you are developing a mission script. The Lua console in DCS Witchcraft was not designed for larger scripts (it does not even have a save function). It works well with small, ephemeral code snippets, for example to inspect the contents of global variables without running your script again or to interactively figure out how to use a single function in the DCS: World API. Don't worry about formal training, it does not matter. I have a BSc in Computer Science, but that does not mean I know how to program anything more complex than a reference implementation of an algorithm without any error handling. (Maybe I should have studied Software Engineering instead.) I did not learn much about error handling, debugging, using a version control system, and writing maintainable software in lectures. I learned about these things because I was programming in my student jobs and as a hobby. For most software, the hard part in creating it is not figuring out new algorithms. It's managing complexity. It's structuring the code in a way that will be maintainable in the future. I wrote my first lines of code 20 years ago and have been programming as a hobby ever since. I still feel like I don't know what I am doing. I also think that no amount of formal training will help with that; I'll just have to get a job and gain more experience, one mistake at a time. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
ESAc_matador Posted May 5, 2017 Share Posted May 5, 2017 Just want to say that i already tested this system to save time and it helps A LOT OF TIME!!! It took me a couple of hours to make a script for smart AI artillery support... And I am a very bad programmer! Link to comment Share on other sites More sharing options...
Wrecking Crew Posted May 8, 2017 Share Posted May 8, 2017 Thank you, Pikey. Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site. Link to comment Share on other sites More sharing options...
FlightControl Posted May 9, 2017 Share Posted May 9, 2017 can you post the missile trainer? You can use it immediately! What do you mean with "post?" A video? [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
WildBillKelsoe Posted May 10, 2017 Share Posted May 10, 2017 You can use it immediately! What do you mean with "post?" A video? yes please Sent from my iPhone using Tapatalk AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow. Link to comment Share on other sites More sharing options...
Mano Posted May 10, 2017 Share Posted May 10, 2017 yes please Sent from my iPhone using Tapatalk there's no video of the missile trainer. but you could download the test mission included in the framework release. https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases search for the MIT mission. [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Mano Posted May 11, 2017 Share Posted May 11, 2017 Noob question... Maybe I've missed it in the video... Where do I put the loader script called with the do script assert? Thanks Inviato dal mio ALE-L21 utilizzando Tapatalk [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
lemoen Posted May 11, 2017 Share Posted May 11, 2017 Noob question... Maybe I've missed it in the video... Where do I put the loader script called with the do script assert? Thanks Inviato dal mio ALE-L21 utilizzando Tapatalk It is in the video, look closely, right panel of the trigger system, inside a Do Once trigger. Link to comment Share on other sites More sharing options...
Wrecking Crew Posted May 29, 2017 Share Posted May 29, 2017 Hi, Pikey, I would appreciate any more info you can give on Lua Projects and editing simple scripts while the game is running. I've watched the video a few times and set up the MOOSE_Framework and MOOSE_Missions, as well as a mission development folder. Using the Eclipse Lua LDT, I made Lua Projects for these, but I did not see a way to edit a Lua Project or delete them to rebuild them, so now I am downloading and starting over. As an example of my immediate goal, I want to edit a script that detects aircraft clients and be able to test changes as I go. This script is already in the mission in a Do Script. I want to make improvements to detect clients in any blue plane, and make changes in an If line to eliminate the '-- do nothing' line that follows. This is an example of my script: [size="1"]-- script.appendAircraftClientNames do aircraftUnitTypes = {'F-15C', 'AJS37', 'M-2000C', 'MiG-21Bis'} -- aircraftUnitTypes = {'[blue][plane]'} local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end for uName, uData in pairs(mist.DBs.humansByName) do -- if uData.type == 'F-15C' or uData.type == 'AJS37' or uData.type == 'M-2000C' or uData.type == 'MiG-21Bis' then if(contains(aircraftUnitTypes, uData.type)) then if(contains(aircraftClientNames, uName)) then -- do nothing else table.insert(aircraftClientNames, uName) end end end end[/size] Also, that log viewer looked pretty nice, plus any tips you have to pass along - like your mention of restarting the mission to see if changes work. Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site. Link to comment Share on other sites More sharing options...
Pikey Posted June 1, 2017 Author Share Posted June 1, 2017 LDT is my blind spot. I just broke mine again. However, I don't do anything not covered by the video, I just create a new lua file in the an existing project space and load dynamically in game. Nothing else. Literally. I use LDT as a notepad ++ +. I restart the mission with LShift-R, if the script needs it, since you will load the orignal script twice and all the global variables will be overwritten but not the local ones and things get messy fast. But for snippets it's awesome. Not sure what else I can add? Two popular log trailers - LogExpert and Glogg. Hi, Pikey, I would appreciate any more info you can give on Lua Projects and editing simple scripts while the game is running. I've watched the video a few times and set up the MOOSE_Framework and MOOSE_Missions, as well as a mission development folder. Using the Eclipse Lua LDT, I made Lua Projects for these, but I did not see a way to edit a Lua Project or delete them to rebuild them, so now I am downloading and starting over. As an example of my immediate goal, I want to edit a script that detects aircraft clients and be able to test changes as I go. This script is already in the mission in a Do Script. I want to make improvements to detect clients in any blue plane, and make changes in an If line to eliminate the '-- do nothing' line that follows. This is an example of my script: [size=1]-- script.appendAircraftClientNames do aircraftUnitTypes = {'F-15C', 'AJS37', 'M-2000C', 'MiG-21Bis'} -- aircraftUnitTypes = {'[blue][plane]'} local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end for uName, uData in pairs(mist.DBs.humansByName) do -- if uData.type == 'F-15C' or uData.type == 'AJS37' or uData.type == 'M-2000C' or uData.type == 'MiG-21Bis' then if(contains(aircraftUnitTypes, uData.type)) then if(contains(aircraftClientNames, uName)) then -- do nothing else table.insert(aircraftClientNames, uName) end end end end[/size]Also, that log viewer looked pretty nice, plus any tips you have to pass along - like your mention of restarting the mission to see if changes work. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
Pikey Posted June 1, 2017 Author Share Posted June 1, 2017 Your script above is a perfect example of where the MOOSE function "SET" becomes awesome. Names those client groups with a "C-" and you can target them. MySet = SET_GROUP:New():FilterPrefixes("C-"):FilterStart() It tracks and updates clients, groups, units by name, coalition, a prefix or manually adding and other ways and then you can manipulate or target them as a single object without managing a table. Then you can target your SET and iterate a function on them to your hearts content. http://flightcontrol-master.github.io/MOOSE/Documentation/Set.html##(SET_CLIENT).ForEachClient Also on re-reading your comments on restarting the mission, i'm not sure if you were seeing me launch the script from in the game and doing it yet again without restarting the mission. Let me know if you missed this, as it was the entire point! ;) Hi, Pikey, I would appreciate any more info you can give on Lua Projects and editing simple scripts while the game is running. I've watched the video a few times and set up the MOOSE_Framework and MOOSE_Missions, as well as a mission development folder. Using the Eclipse Lua LDT, I made Lua Projects for these, but I did not see a way to edit a Lua Project or delete them to rebuild them, so now I am downloading and starting over. As an example of my immediate goal, I want to edit a script that detects aircraft clients and be able to test changes as I go. This script is already in the mission in a Do Script. I want to make improvements to detect clients in any blue plane, and make changes in an If line to eliminate the '-- do nothing' line that follows. This is an example of my script: [size=1]-- script.appendAircraftClientNames do aircraftUnitTypes = {'F-15C', 'AJS37', 'M-2000C', 'MiG-21Bis'} -- aircraftUnitTypes = {'[blue][plane]'} local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end for uName, uData in pairs(mist.DBs.humansByName) do -- if uData.type == 'F-15C' or uData.type == 'AJS37' or uData.type == 'M-2000C' or uData.type == 'MiG-21Bis' then if(contains(aircraftUnitTypes, uData.type)) then if(contains(aircraftClientNames, uName)) then -- do nothing else table.insert(aircraftClientNames, uName) end end end end[/size]Also, that log viewer looked pretty nice, plus any tips you have to pass along - like your mention of restarting the mission to see if changes work. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING * Link to comment Share on other sites More sharing options...
Wrecking Crew Posted June 2, 2017 Share Posted June 2, 2017 Thanks, Pikey, See my PM Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site. Link to comment Share on other sites More sharing options...
Cyb0rg Posted November 10, 2017 Share Posted November 10, 2017 The wheel is probably the most important discovery. This comes in second. [sIGPIC][/sIGPIC] Asteroids ____________________________________________ Update this :D Link to comment Share on other sites More sharing options...
Recommended Posts