sedenion Posted September 23, 2011 Posted September 23, 2011 Hello, Is there any way to use/make a REAL (Lua ?) script in addition of the "graphical" triggers system ? Something that allow creation of some more sophisticated conditions with "AND / OR / NOT" (and not only "AND"), loops, and variables ? Thanks, regards.
Speed Posted September 23, 2011 Posted September 23, 2011 (edited) Yes. You need to unzip the .miz and edit the "mission" file. The "mission" file is a saved Lua table. The triggers within the mission file get evaluated every second, so what you will need to do is either insert or edit a trigger, and make the trigger actions or conditions (or both) run the Lua script you desire. Once you are done, you have to re-zip the mission back into a .zip, and then change the .zip extension to .miz. Now you can fly the mission. Keep in mind, you cannot edit the mission again in the mission editor without destroying your script. Fairly recently, I used this method to create the script that would display the number of seconds it took you to complete an obstacle course in DCS: Black Shark. See here: http://forums.eagle.ru/showthread.php?t=76410 If you're a LOMAC fan, you'd better hope that they come out with FC3, as DCS now contains native support for your own custom Lua within mission editor triggers. Edited September 23, 2011 by Speed Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
ivanwfr Posted September 23, 2011 Posted September 23, 2011 I tried making sense from the mission files where everything is stored inside the miz archive; - All you find here are your mission value tables, no trace of the code that use them. - LUA table stringification does not order keys... you have to deal with a pile of rubish an try to guess what to make of it. ... good luck
Speed Posted September 23, 2011 Posted September 23, 2011 I tried making sense from the mission files where everything is stored inside the miz archive; - All you find here are your mission value tables, no trace of the code that use them. - LUA table stringification does not order keys... you have to deal with a pile of rubish an try to guess what to make of it. ... good luck The trigger table that you have to modify to run your custom Lua always appears to be the first thing listed, so it's not really bad at all. There is a second Lua actions/conditions set of tables later, but they appear to be simply for mission editor use, not for game runtime. It's really not that bad, if you stare at it a moment, it all starts making sense. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
ivanwfr Posted September 24, 2011 Posted September 24, 2011 Yea, I thought so and I did put my fingers in those files and replaced the original after some global editing with a programmer editor. This can spare you many tedious clicking in ME and helps with some smart regex juggling instead of having to adjust a whole bunch of waypoints altitude or the like. But I could not make it all the way to the point where I get the whole big picture. I was looking for logic, not piles of data and you can see the logic is not there. Even the data seems to have issues sometime like heading, speed, altitude... you have to gess whether you have air speed, ground speed, in knots or meter/sec, with heading being 360 complements! For instance, I could not even find how to correct first version of Sabre-TLA BFT09_Instrument_Approach_and_Landing_V1.0.miz after hours of tuning and test flight ... was fun though but it became boring by frustration for not learning anything worth to get you some reusable experience. I did not try his new BFT09_Instrument_Approach_and_Landing_V1.1.miz version, but I will definitely look at what has been corrected. If you're looking for a way to spend some of your time with, this is one, but you'd better be prepared to get back to square one at the end.
Recommended Posts