Rivvern Posted January 22, 2017 Share Posted January 22, 2017 How can i use the CloneInZone so the aircraft group keeps its current task? [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se Link to comment Share on other sites More sharing options...
Grimes Posted January 23, 2017 Share Posted January 23, 2017 How can i use the CloneInZone so the aircraft group keeps its current task? Basically you have to get information from the group that was cloned for their task and then assign it to the new group. When you use mist.cloneInZone() it returns the table that was used to spawn the group, one of those entries is "name" and will be generated via the script. You may need to schedule the mist.goRoute() function to occur at a slightly later time due assigning a task immediately after a group spawned can cause crashes. Keep in mind though that the route will be identical and the AI will fly from wherever they spawned at to the starting waypoint that has been assigned. You can always modify the first waypoint in the newRoute table to match the current position of the first unit in newGroup. local newGroup = mist.cloneInZone('whatatever'..).name local newRoute = mist.getGroupRoute('whatever', true) mist.goRoute(newGroup, newRoute) I am doing a script where I first do some teleports and spawns and then I use mist.makeUnitTable({'[red]'}). It does not work... and may be it is because since I created new units through the teleport... How to get the list of the current units?? Shouldn't matter how the groups are spawned. Are you doing it as part of the same function call? As in... mist.teleportInZone('bla', 'blaa') local redTeam = mist.makeUnitTable({'[red]'}) If so that could be the problem. The DBs update pretty quick, but it isn't instant. Curious about your situation- if you're teleporting units it should just move the same unit. I'm having some issues with some "cloned" groups- which are different (I think) since they are actually generated dynamically and are out of reach from the mission scripting engine. Clone groups are only accessible by the scripting engine while respawned and teleported units can be seen by triggers due to the unitIds and groupIds matching. Respawn, clone, and teleport all eventually use coalition.addGroup() which is how units are dynamically spawned. The difference is where and what data is grabbed from the group. Respawn will respawn the entire group. Teleport moves only the units that are currently alive. Clone does the same thing as respawn, but removes unitId, unitNames, groupId, and groupName from the table and relies on mist.dynAdd to repopulate that data. As long as those values are unique no other unit will be removed from the simulation because its been "overwritten" Anything abstract / not working about the "group patrol route" function? Does it need to be entered as an overall trigger or as a last waypoint advanced entry? Edit: Okay well now that I'm at the computer- I've tried both and both crash out. It has caused crashes before for unknown reasons. What map were you doing it on? BTW, it should work fine if assigned on either the first or last WP since I believe it just reassigns the route anyways. 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 Link to comment Share on other sites More sharing options...
Rivvern Posted January 23, 2017 Share Posted January 23, 2017 Basically you have to get information from the group that was cloned for their task and then assign it to the new group. When you use mist.cloneInZone() it returns the table that was used to spawn the group, one of those entries is "name" and will be generated via the script. You may need to schedule the mist.goRoute() function to occur at a slightly later time due assigning a task immediately after a group spawned can cause crashes. Keep in mind though that the route will be identical and the AI will fly from wherever they spawned at to the starting waypoint that has been assigned. You can always modify the first waypoint in the newRoute table to match the current position of the first unit in newGroup. local newGroup = mist.cloneInZone('whatatever'..).name local newRoute = mist.getGroupRoute('whatever', true) mist.goRoute(newGroup, newRoute) Thanks! Will try this approach. :thumbup: [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se Link to comment Share on other sites More sharing options...
Rivvern Posted January 23, 2017 Share Posted January 23, 2017 (edited) local newGroup = mist.cloneInZone('whatatever'..).name local newRoute = mist.getGroupRoute('whatever', true) mist.goRoute(newGroup, newRoute) Ok, i tested the following code. Doesnt work. But i do wonder if i understood your instructions correctly. How does this look to a you? DOESNT WORK missionCommands.addCommand("Spawn TEST",_airtargets,function() local newGroup = mist.cloneInZone('1xMiG-21', {'test'}) local newRoute = mist.getGroupRoute('1xMiG-21', true) trigger.action.outTextForCoalition(coalition.side.BLUE, "TEST", 5) mist.goRoute(newGroup, newRoute) end,nil) EDIT!: Ok hold your horses. The following code seem to work! The only issue is like you mentioned Grimes, that the aircraft goes to the initial position of the template aircraft. WORKS! missionCommands.addCommand("Spawn TEST2",_airtargets,function() do local gp = mist.cloneInZone('1xMiG-21', 'test') local newRoute = mist.getGroupRoute('1xMiG-21') mist.goRoute(gp.name, newRoute) end end,nil) Edited January 23, 2017 by Rivvern [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se Link to comment Share on other sites More sharing options...
ENO Posted January 23, 2017 Share Posted January 23, 2017 It has caused crashes before for unknown reasons. What map were you doing it on? BTW, it should work fine if assigned on either the first or last WP since I believe it just reassigns the route anyways. It was on 1.5- I should mention the game didn't crash- per se... it just kicked an error message. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
Grimes Posted January 23, 2017 Share Posted January 23, 2017 (edited) I should mention the game didn't crash- per se... it just kicked an error message. That isn't the same thing. Usually what that means is it is a syntax error or a value passed was nil. Game crash, is well the game crashes to desktop and usually gives you the windows error box associated with programs that have crashed. A lua error you can just click "ok" to continue and depending on what may be causing that error the entire script may simply just stop, or that specific part of the script will keep erroring out periodically. EDIT!: Ok hold your horses. The following code seem to work! The only issue is like you mentioned Grimes, that the aircraft goes to the initial position of the template aircraft. Yeah, so you can modify the new route there... newRoute.[1].x = gp.units[1].x newRoute.[1].y = gp.units[1].y Don't forget the true as the second value of mist.getGroupRoute as that defines whether or not it returns the groups actual tasks assigned to each WP. Without it the group will just follow the flight plan and won't attack anything. Edited January 23, 2017 by Grimes 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 Link to comment Share on other sites More sharing options...
wolf5 Posted January 28, 2017 Share Posted January 28, 2017 I got a bug with function :mist.respawnGroup('groupName', true) With ground units, no problem but with aircrafts, i have an endless respawn every seconds People fly planes, pilots fly helicopters Link to comment Share on other sites More sharing options...
Grimes Posted January 28, 2017 Share Posted January 28, 2017 Not able to reproduce it on my end. Can you post an example of the triggers or scripting function you are using to call it? Or even the mission? 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 Link to comment Share on other sites More sharing options...
Rivvern Posted January 28, 2017 Share Posted January 28, 2017 Grimes. Im trying to figure out what you mean but not having any luck. Where do i place the newRoute.[1].x = gp.units[1].x newRoute.[1].y = gp.units[1].y This gives me an error expecting a name at the newRoute line. missionCommands.addCommand("Armed Speedboat",_seatargets,function() do local gp = mist.cloneInZone('armedspeedboat', 'ships1') local newRoute = mist.getGroupRoute('armedspeedboat', true) newRoute.[1].x = gp.units[1].x newRoute.[1].y = gp.units[1].y mist.goRoute(gp.name, newRoute) end end,nil) [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se Link to comment Share on other sites More sharing options...
Grimes Posted January 28, 2017 Share Posted January 28, 2017 Whoops, the dot between newRoute and [1] needs to be removed. newRoute[1].x = gp.units[1].x newRoute[1].y = gp.units[1].y 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 Link to comment Share on other sites More sharing options...
Rivvern Posted January 29, 2017 Share Posted January 29, 2017 Everything seem to work fine. Here is the code if anyone is interested. Use this in your lua file and then load it after MIST in the mission. Be sure to set up the units and trigger zones to match the lua file.. If someone got a better idea, please let me know. Note. I did not set up a delay for the newRoute, mostly because i dont know how. I havent encountered any issues so far. For creating F10 menus and sub menus with spawnable units. --creating menu local _spawn = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Spawn") local _airtargets = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Air targets", _spawn) local _seatargets = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Sea targets", _spawn) --spawnables --_airtargets missionCommands.addCommand("Spawn 1xMiG-21",_airtargets,function() do local gp = mist.cloneInZone('1xMiG-21', {'zone1','zone2','zone3','zone4'}) local newRoute = mist.getGroupRoute('1xMiG-21', true) newRoute[1].x = gp.units[1].x newRoute[1].y = gp.units[1].y mist.goRoute(gp.name, newRoute) trigger.action.outTextForCoalition(coalition.side.BLUE, "MiG-21 detected", 5) end end,nil) --_seatargets1 missionCommands.addCommand("CV 1143.5 Admiral Kuznetsov",_seatargets,function() do local gp = mist.cloneInZone('kuznetsov', {'ships1','ships2','ships3'}) local newRoute = mist.getGroupRoute('kuznetsov', true) newRoute[1].x = gp.units[1].x newRoute[1].y = gp.units[1].y mist.goRoute(gp.name, newRoute) trigger.action.outTextForCoalition(coalition.side.BLUE, "CV 1143.5 Admiral Kuznetsov detected", 5) end end,nil) Credits to Grimes! [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se Link to comment Share on other sites More sharing options...
ENO Posted January 30, 2017 Share Posted January 30, 2017 I've read a few older threads on the issue- and I'm sorry if I missed mention of it somewhere... but is there a clearly defined way to randomly spawn a static / structure in a defined zone using MIST? "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
Rivvern Posted January 30, 2017 Share Posted January 30, 2017 I've read a few older threads on the issue- and I'm sorry if I missed mention of it somewhere... but is there a clearly defined way to randomly spawn a static / structure in a defined zone using MIST? Not sure if it answers you question but Im spawning Cargo this way. Not sure if its really a Static item though. mist.cloneInZone('cargo_1000', {'pickzone1'}, true) 1 [sIGPIC][/sIGPIC] We are looking for Swedish members! http://www.masterarms.se Link to comment Share on other sites More sharing options...
ENO Posted February 1, 2017 Share Posted February 1, 2017 (edited) Thanks riv. Cargo is in statics- structures might be different. I haven't had a chance to dork with it yet. EDIT: IT WORKED! Okay so now if you wanted to spawn that structure with vehicles from a separate group- can you do that? Reason being the structure will have defenses spawn in the same zone (ideally). Edited February 3, 2017 by ENO "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
ED Team NineLine Posted February 7, 2017 ED Team Share Posted February 7, 2017 Is there a way to detect laser in a zone or something similar with Mist? Trying to get back into mission building and I have bigger ideas than brains :D Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug** Link to comment Share on other sites More sharing options...
ENO Posted February 7, 2017 Share Posted February 7, 2017 Trying to get back into mission building and I have bigger ideas than brains :D I resemble that remark. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
Grimes Posted February 7, 2017 Share Posted February 7, 2017 Is there a way to detect laser in a zone or something similar with Mist? Trying to get back into mission building and I have bigger ideas than brains :D As far as I know you can only do it with lasers created with the scripting engine via the spot class. Lasers emitting from player aircraft, AI, or CA vehicles is simply not accessible. 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 Link to comment Share on other sites More sharing options...
ED Team NineLine Posted February 7, 2017 ED Team Share Posted February 7, 2017 As far as I know you can only do it with lasers created with the scripting engine via the spot class. Lasers emitting from player aircraft, AI, or CA vehicles is simply not accessible. What about smoke markers launched from vehicles in CA? Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug** Link to comment Share on other sites More sharing options...
ENO Posted February 7, 2017 Share Posted February 7, 2017 (edited) Similarly curious as to whether or not you can do anything with marker lights on / off. Edited February 7, 2017 by ENO "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art Link to comment Share on other sites More sharing options...
Grimes Posted February 7, 2017 Share Posted February 7, 2017 If it produces a shot event in the logs then it is trackable via scripting. So in terms of marking target type weapons then you have illumination rockets/bombs and smoke rockets. Combined Arms smoke is kind of special because I'm pretty sure its just mimicking a trigger.action.smoke() type command where-ever the player's camera is looking at. Suffice to say I wish the scripting engine had access to target pod orientation, lasing information, orientation of any on board search lights, or a more advanced way to accept commands from players than just an F10 radio menu. But we don't. 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 Link to comment Share on other sites More sharing options...
molevitch Posted February 7, 2017 Share Posted February 7, 2017 MIST/CTLD not loading at mission start Dear All, I have just started to get into this wonderful world of advanced mission building and am very excited about MIST/CTLFD/MOOSE. However, when I set up a mission in ME and use triggers to call the mist.lua and ctld.lua, they do not appear to be loading. I get an error dialog "Mission Script Error" saying things like "unexpected symbol next to '<'". This only happens when I build it myself in ME. If I download a .miz file from ED Forums or similar, the mission loads correctly. If I build my own mission from scratch, calling mist.lua from a folder on my computer (obvs), the mission will load, but within 2 seconds (TIME MORE, 2) the error messages pop up, presumably saying the mist.lua is not loaded. I have looked around a lot for help on this forum, but have not yet found a solution. Any suggestions would be greatly appreciated. Its the same for both 1.5 and 2.05. Frustrated! M.:mad::cry: SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2. Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit. [sIGPIC][/sIGPIC] www.blacksharkden.com Link to comment Share on other sites More sharing options...
Grimes Posted February 7, 2017 Share Posted February 7, 2017 Can you post a mission file where this error occurs? It would be the easiest way to see what is going wrong. 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 Link to comment Share on other sites More sharing options...
molevitch Posted February 7, 2017 Share Posted February 7, 2017 (edited) Can you post a mission file where this error occurs? It would be the easiest way to see what is going wrong. Thanks Grimes, Here is a sample mi8 transport test.miz for 1.5. The mission runs, but no mist or ctld.... Very basic to test problem.... I get this. https://forums.eagle.ru/attachment.php?attachmentid=156792&stc=1&d=1486475291 Thank you for having a look. Yours Molevitch:helpsmilie: Edited February 7, 2017 by molevitch SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2. Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit. [sIGPIC][/sIGPIC] www.blacksharkden.com Link to comment Share on other sites More sharing options...
ED Team NineLine Posted February 7, 2017 ED Team Share Posted February 7, 2017 If it produces a shot event in the logs then it is trackable via scripting. So in terms of marking target type weapons then you have illumination rockets/bombs and smoke rockets. Combined Arms smoke is kind of special because I'm pretty sure its just mimicking a trigger.action.smoke() type command where-ever the player's camera is looking at. Suffice to say I wish the scripting engine had access to target pod orientation, lasing information, orientation of any on board search lights, or a more advanced way to accept commands from players than just an F10 radio menu. But we don't. Yeah, I feature requested that that smoke get added to be detectable in a zone, so crossing my fingers, just wasnt sure if there was some MIST magic I could use for lasers or other JTAC type things. Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug** Link to comment Share on other sites More sharing options...
feefifofum Posted February 7, 2017 Share Posted February 7, 2017 (edited) Hi molevitch! I was having this same problem for the longest time and thought I was just a terrible idiot... Turns out in my case it was a bit of a questionable user interface at Github that was causing my problems. If you are in the main project folder view, and right click on, say CTLD.lua and hit save as; a window will pop up that says you're saving CTLD.lua. Unless you open the script in a text editor, everything will look normal until you load the mission and DCS starts spitting out errors. The issue is, even though the "save as" window is showing you CTLD.lua, what you're actually getting is the script's file plus what appears to be a bunch of html related to the github interface. From the main project view, left click the individual file to open it inside of GitHub. There will be a button at the top of the script that says "Raw" Right click on the "Raw" button and hit save as, and it will give you a clean version of the script without all the HTML crap and should work properly in your missions! Edited February 7, 2017 by feefifofum 1 THE GEORGIAN WAR - OFFICIAL F-15C DLC Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now