ENO Posted March 7, 2013 Posted March 7, 2013 Eh guys. Please be patient as my new addiction to mission editing takes hold of me! First of all thanks again to SPEED for these extra functions. I'm FINALLY getting the courage (by way of necessity) to explore some of these tools and implementing their functions in a mission I'm working on. Basically, I'm looking at some opportunities and THINK I know what I need to do but not exactly how to do it. 1) I have used a "Do script" action that covers off any damage done to map objects within a zone- with a trigger that stops the action when it no longer applies. That one is pretty much copy paste from the instruction manual and I adjusted it accordingly. 2) I'd like to add all red objects to a table and be able to identify when any of those objects are hit (prior to the same flag I set above). I don't know if I need to add them all to the table... but basically I want to do the same thing as the map objects... but with the coalition objects. I'm reading about the tables but not 100% sure how to apply them. I have no .lua experience and am pretty restricted in how comfortable I am interpreting some of the directions. Currently I'm working around it manually by just "group alive less than" but as one can imagine having to input all those separately is a pain- especially knowing there is (could be) an easier way. I don't want to clog up the SLMOD thread with my questions so thought maybe I could start a thread of my own to float questions to the experts. Thanks in advance guys. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Speed Posted March 7, 2013 Posted March 7, 2013 Eh guys. Please be patient as my new addiction to mission editing takes hold of me! First of all thanks again to SPEED for these extra functions. I'm FINALLY getting the courage (by way of necessity) to explore some of these tools and implementing their functions in a mission I'm working on. Basically, I'm looking at some opportunities and THINK I know what I need to do but not exactly how to do it. 1) I have used a "Do script" action that covers off any damage done to map objects within a zone- with a trigger that stops the action when it no longer applies. That one is pretty much copy paste from the instruction manual and I adjusted it accordingly. It's not damage to map objects that is detected, it's destruction of map objects that is detected. 2) I'd like to add all red objects to a table and be able to identify when any of those objects are hit (prior to the same flag I set above). I don't know if I need to add them all to the table... but basically I want to do the same thing as the map objects... but with the coalition objects. Hit or killed? You can use Slmod to set a flag when one group of units hits another group of units. Or you can use Slmod to set a flag when the number of dead units (dead either by being killed or deactivated) in a set of units exceeds a certain number. Both of those functionalities will eventually be ported over to Mist, but right now, they exist only in Slmod, or if you create it yourself through Lua. Here's how to set a flag when one set of units hits another set of units: slmod.units_hitting{ init_units = {'[all]'}, tgt_units = {'[red]'}, flag = 100 } I use the '[all]' unit table short cut to fill in init_units with all the units in the mission. I use the '[red]' unit table short cut to fill in tgt_units with all the red coalition units in the mission. Whenever a unit on red is hit by any unit, flag 100 is set true. -------------------------- To detect if the number of dead units on red exceeds a certain number, slmod.num_dead_gt{ units = {'[red]'}, numdead = 150, flag = 51 } If the number of units on red coalition that are dead exceeds 150, flag 51 becomes true. 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.
ENO Posted March 7, 2013 Author Posted March 7, 2013 (edited) Thanks speed. I owe you about an hour of my time lol. And to enter a stop flag it would be the same as in the other entries I presume? Also with regards to formatting- If I do my input in notepad ++ and configure it as it appears in your writing... and then copy paste it over to the scratchpad in the mission editor... I'm not sure it goes across the right way- or is formatting (provided everything is in placea) less important in the scratchpad? (ie: indents etc) Edited March 7, 2013 by ENO "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
ENO Posted March 7, 2013 Author Posted March 7, 2013 I'm getting an error with that slmod.units_hitting one. Is it referencing a table I need to configure? I read about tables but I'm exactly sure how they apply? I see how to add to the table but not sure... Uh... How to apply them... "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Grimes Posted March 7, 2013 Posted March 7, 2013 Thanks speed. I owe you about an hour of my time lol. And to enter a stop flag it would be the same as in the other entries I presume? Also with regards to formatting- If I do my input in notepad ++ and configure it as it appears in your writing... and then copy paste it over to the scratchpad in the mission editor... I'm not sure it goes across the right way- or is formatting (provided everything is in placea) less important in the scratchpad? (ie: indents etc) Lua can be written as a giant single line if you wanted to. And it copy and pastes just fine into the do script box. Just make sure you copy the whole thing correctly. More than a few times I've pasted it into the box but I failed to completely paste over the older code resulting in an extra "end" and causing a scripting error. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
ENO Posted March 7, 2013 Author Posted March 7, 2013 Thanks Grimes... maybe you can give me a boost here: Here is what I'm seeing... And here is what I've got in there... slmod.units_hitting{ init_units = {'[blue]'}, tgt_units = {'[red]'}, flag = 3 } That's copy and pasted from the game... "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Speed Posted March 8, 2013 Posted March 8, 2013 (edited) Thanks Grimes... maybe you can give me a boost here: Here is what I'm seeing... And here is what I've got in there... slmod.units_hitting{ init_units = {'[blue]'}, tgt_units = {'[red]'}, flag = 3 } That's copy and pasted from the game... "Attempt to index global 'slmod', a nil value" nil means nothing in English. Likewise, in Lua, it also means nothing. Index means to get the value of one part of a Lua table. A global value is a value that is in the global Lua environment- hence, it is accessible everywhere inside Lua. So, now, just read the error message. See what it means? It means that you attempted to treat a non-existent value, named "slmod", as a table by indexing it. You attempted to index a nil value. You can only index a table value. Lua looked inside the local environment, found no variable called "slmod", looked in the global environment, found no variable named "slmod", then spat an error at you. Clearly, this means you do not have Slmod installed correctly. You must place the MissionScripting.lua file included with Slmod inside ./Scripts, over-writing the the MissionScripting.lua included with the game. Once you do this, it will work. Edited March 8, 2013 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.
ENO Posted March 8, 2013 Author Posted March 8, 2013 Okay- is it odd that other slmod functions work properly? I'll copy it over again and hope for something different. Thanks. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Speed Posted March 8, 2013 Posted March 8, 2013 Okay- is it odd that other slmod functions work properly? I'll copy it over again and hope for something different. Thanks. Can you upload the mission? It will probably only take a second to spot the cause of the problem. 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.
ENO Posted March 8, 2013 Author Posted March 8, 2013 Let me try the reinstall first... I'll upload it if there's no joy- thanks though! "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
ENO Posted March 8, 2013 Author Posted March 8, 2013 Eh Speed... I THINK the reinstall worked- so I do thank you for the attention and the guidance. Thanks to you as well Grimes. I'd like to leave the thread open as I enhance features of this new mission using these new functions... I won't depend on you guys explicitly- I'll keep reading the guides etc... however sometimes I need someone to help drop that last pin into place. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
ENO Posted March 9, 2013 Author Posted March 9, 2013 I'm wanting to make a structure indestructible unless it's hit by a 2000lb bomb... I'd like to make it immortal until "bomb in zone" is a MK84 variety. Any thoughts on the easiest way to do that? It'd have to be a script in a stop condition- Or do I have a "true" flag thrown when bomb in zone is an MK84 and just do flagX = true a stop condition? Can it be that easy? Thanks in advance. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
SubEclipse Posted July 2, 2013 Posted July 2, 2013 I have two servers currently... one of which runs Slmod 7 without any issues, the other is having the same problem that ENO is reporting here. I have attempted to reinstall Slmod as advised by Speed, but the problem persists. I also went as far as to reinstall DCSW, but that also did not fix the problem.
IanMacleod Posted March 31, 2017 Posted March 31, 2017 i cant find the missionscripting.lua file other than the original one to uninstall...am i using the wrong zip installer ? Ka-50 Black Shark 2 Mi-8MTV2 Magnificent Eight SA342 Gazelle L-39 Albatros Combined arms F15C Spitfire LF Mk. IX
Recommended Posts