FlightControl Posted April 29, 2014 Share Posted April 29, 2014 Changed some code to fix an error. Grimes, I got an error in the following code at the function 'mistdisplayV3'. It is related to the following code: messageData:remove() -- now using the remove/destroy function. This is the error that I got in the DCS.log files: 00186.623 INFO SCRIPTING: mist.scheduleFunction, error in scheduled function: [string "C:\Users\vandeves\AppData\Local\Temp\DCS\/~..."]:3701: attempt to call method 'remove' (a nil value) I changed your code in the function mistdisplayV3 to the following: local function mistdisplayV3() -- adding audio file support -- CA roles local caMessageRed = false local caMessageBlue = false local audioRed = false local audioBlue = false local audioPlaying = false if #messageList > 0 then for messageId, messageData in pairs(messageList) do if messageData.displayedFor > messageData.displayTime then if messageData ~= nil then mist.debug.info( 'mistdisplayV3', 'messageData', messageData ) [color=red] table.remove(messageList, messageId) return true [/color] end --[[else if messageData.fileName then audioPlaying = true end]] end messageList[messageId].displayedFor = messageList[messageId].displayedFor + messageDisplayRate end Now the error does not appear again. Sven [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...
ENO Posted April 29, 2014 Share Posted April 29, 2014 thanks xcom - +1 I am using a randomized trigger for AI groups right now so it will randomly span a certain # of AI flights differently each time…. will this script recognize an "unselected" group from my randomization list as "dead" and spawn it? I'm trying to figure out if it will render my randomization efforts as moot then. I'd like to randomize - then respawn out of the groups that were selected by the random triggers. Just so I know what you're asking- you want to generate a certain number of AI flights in the mission and respawn those units... But not the others that aren't spawned in by your random trigger. That's how I'm understanding the question so if my answer doesn't make sense I may have misunderstood. If the unit isn't actually destroyed then it won't respawn. Sounds like you're concerned that if the unit isn't spawned in that it may be detected as destroyed and spawn in its replacement but this will not be a problem. "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...
ajax Posted May 14, 2014 Share Posted May 14, 2014 Using mist 3.3 and everything working great but one line in the dcs.log that keeps bugging me... 00041.137 INFO SCRIPTING: mist.scheduleFunction, error in scheduled function: [string "C:\Users\user\AppData\Local\Temp\DCS.openbet..."]:4251: Parameter #1 (unit name string) missed 00203.126 INFO SCRIPTING: mist.scheduleFunction, error in scheduled function: [string "C:\Users\user\AppData\Local\Temp\DCS.openbet..."]:4254: Parameter #1 (unit name string) missed Making these changes to Mist will fix that: http://forums.eagle.ru/showpost.php?p=2063758&postcount=14 Link to comment Share on other sites More sharing options...
HiJack Posted May 14, 2014 Share Posted May 14, 2014 Great Ajax! Thank you for finding this. Will make the change and test this tonight :thumbup: Link to comment Share on other sites More sharing options...
dooom Posted May 14, 2014 Share Posted May 14, 2014 Just so I know what you're asking- you want to generate a certain number of AI flights in the mission and respawn those units... But not the others that aren't spawned in by your random trigger. That's how I'm understanding the question so if my answer doesn't make sense I may have misunderstood. If the unit isn't actually destroyed then it won't respawn. Sounds like you're concerned that if the unit isn't spawned in that it may be detected as destroyed and spawn in its replacement but this will not be a problem. ^^ Bang on ENO - that's exactly what i was worried about. Thanks! ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 "This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL Link to comment Share on other sites More sharing options...
Zaz0 Posted May 16, 2014 Share Posted May 16, 2014 (edited) hi all, newbie here scripting... How I can send a UH-1H (IA) to pickup a downed pilot ramdonly respawned in zone? I try to use "mist.heli.buildWP" and "mist.GoRoute"with "mist.getLeadPos" inside to locate unit and send the copter, but it returns a error anyone could explain me how can I do it? or its so difficult? Edit: I do it! local path = {} path[#path + 1] = mist.heli.buildWP(mist.getLeadPos('mia'), TurningPoint, 120, 100, 'agl') path[#path + 1] = mist.heli.buildWP(mist.getLeadPos('aliado'), TurningPoint, 170, 200, 'agl') mist.goRoute(Group.getByName('helo'), path) thanks Edited May 16, 2014 by Zaz0 Link to comment Share on other sites More sharing options...
gregzagk Posted May 31, 2014 Share Posted May 31, 2014 Hi guys. Has anyone a working example of teleporting ground groups with Mist to a specific zone? I can't make this work :wub: "ARGO" DCS UH-1H DLC SP Campaign 373vFS DCS World squadron (Greece) - www.buddyspike.net "ARGO 2.0 Project Phoenix" UH-1H DLC Campaign - WIP Link to comment Share on other sites More sharing options...
LFCChameleon_Silk Posted May 31, 2014 Share Posted May 31, 2014 mist.teleportInZone('YOUR GROUP NAME HERE', {'ZONE 1 NAME', 'ZONE 2 NAME', 'ZONE 3 NAME'}, true, 100) Link to comment Share on other sites More sharing options...
gregzagk Posted May 31, 2014 Share Posted May 31, 2014 Thanks for the quick responce! I tried this but I think I have a problem with the table that it needs before these lines. Could you provide a working example from a mission maybe? Thanks in advance "ARGO" DCS UH-1H DLC SP Campaign 373vFS DCS World squadron (Greece) - www.buddyspike.net "ARGO 2.0 Project Phoenix" UH-1H DLC Campaign - WIP Link to comment Share on other sites More sharing options...
LFCChameleon_Silk Posted May 31, 2014 Share Posted May 31, 2014 then your probably not loading MIST prior to trying to use the command.Teleport Demo.miz Link to comment Share on other sites More sharing options...
gregzagk Posted May 31, 2014 Share Posted May 31, 2014 Thanks a lot man.You are right. I had Mist running when the mission starts with the initialitation script way but it was not running for some reason . Thanks again :thumbup: "ARGO" DCS UH-1H DLC SP Campaign 373vFS DCS World squadron (Greece) - www.buddyspike.net "ARGO 2.0 Project Phoenix" UH-1H DLC Campaign - WIP Link to comment Share on other sites More sharing options...
chromium Posted June 8, 2014 Share Posted June 8, 2014 Beware of last update... sad problem here: http://forums.eagle.ru/showthread.php?t=125269 Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously. Link to comment Share on other sites More sharing options...
Grimes Posted June 13, 2014 Share Posted June 13, 2014 (edited) Mist 3.4 Since I was away several issues have apparently cropped up with the scripting engine and these issues have had a negative impact on the sim. I'd like to thank ajax and svenvandevelde for posting workarounds for users in regards to mist and general simulator scripting engine issues. Attached is mist 3.4 which contains fixes for issues highlighted by ajax and svenvandevelde, along with some other changes I did a few months ago. If other issues are discovered I will make the appropriate fixes, however the version number will likely remain "3.4" and I'll just hotfix it. So basically version 3.4 is to fix whatever maybe broken, and new features will be shelved for later iterations. (3.5+) Changelog 3.4.23: -added country table entry for mist.getGroupData() -mist.getHeading now accepts optional second variable. Set to true to get cartesian-based heading instead of lat/lon-based heading. -fixed mist.getLeadPos if passed group table contains a dead leader -fixed minor bug with msgDisplay (thanks svenvandevelde) -fixed bug with dynamically added groups (thanks Ajax) Changelog 3.4.24: -teleportToPoint now accepts vars.gpName or vars.groupName for the groups name -fixed bug with mist.flagFunc.units_in_polygon() toggle option Changelog 3.4.25: -Fixed bug with mist.message.add with regard to updating messages So please post if you are having issues with 3.4. As far as I can tell Speed is still away/busy so I'll also address issues for slmod. If issues are present in my IADScript I'll also attempt to fix. Please post issues in their respective threads though: SLmod IADScript Mist (Why do you need a link for the mist thread? You are already here!) Right now my priority is mist>slmod>IADScriptMistv3_4_25.rar Edited August 1, 2014 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...
Midnight Posted June 13, 2014 Share Posted June 13, 2014 Thanks for your work on this Grimes, it is appreciated. Link to comment Share on other sites More sharing options...
ENO Posted June 13, 2014 Share Posted June 13, 2014 +100000000000000000 Same to Ajax and seven. "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...
chromium Posted June 13, 2014 Share Posted June 13, 2014 +1 Author of DSMC, mod to enable scenario persistency and save updated miz file Stable version & site: https://dsmcfordcs.wordpress.com/ Openbeta: https://github.com/Chromium18/DSMC The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously. Link to comment Share on other sites More sharing options...
ED Team NineLine Posted June 13, 2014 ED Team Share Posted June 13, 2014 I agree, I am glad both of them were helping out cuz I was a horrible fill in for Grimes :) Forum Rules • My YouTube • My Discord - NineLine#0440• **How to Report a Bug** Link to comment Share on other sites More sharing options...
m9matt Posted June 13, 2014 Share Posted June 13, 2014 Thanks Grimes Link to comment Share on other sites More sharing options...
xcom Posted June 23, 2014 Share Posted June 23, 2014 Issue/byDesign found with MIST DBs - 1. AliveUnits DB does not hold newly spawned units. 2. DBs do not hold infantry units. (DBs categories only have helicopter/plane/ship/static/vehicle) - Can the newly spawned units be added to the AliveUnits table? - Is there a quick way to add another category to the DBs to hold infantry? Edit - point 1 was only tested with infantry, might be that it actualy does hold newly spawned units but not infantry because of point 2. Thanks. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook Link to comment Share on other sites More sharing options...
ajax Posted June 23, 2014 Share Posted June 23, 2014 I believe infantry are classified as 'vehicle'. That doesn't address the issue of them not being stored, though. Link to comment Share on other sites More sharing options...
spinter Posted June 27, 2014 Share Posted June 27, 2014 Scusate chiedo cortesemente se posso usare e modificare parte del codice mist per poterlo usare nei miei script,vorrei sapere se e possibile! Traslated by Google! Sorry politely ask if I can use and modify the code mist to use it in my script, I would like to know if it is possible! posto un dei esempi del codice che dovrei usare! a place of the examples of code that I should use! function getCountry(groupName) local i,j,k if env.mission.coalition then for coa,coaTable in pairs(env.mission.coalition) do if type(coaTable) == 'table' and coaTable.country then for i=1,#coaTable.country do local country = coaTable.country[i] for uType,uTable in pairs(country) do if uType == 'helicopter' or uType == 'ship' or uType == 'vehicle' or uType == 'plane' then if type(uTable)=='table' and uTable.group then for j=1,#uTable.group do local group = uTable.group[j] if group.units then for k=1,#group.units do local unit = group.units[k] -- if unit.name and unit.name == groupName then -- return group.name--country.name -- end if group.name and group.name == groupName then return country.name end end end end end end end end end end end return nil end ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
dooom Posted June 28, 2014 Share Posted June 28, 2014 hello - i cannot get the following to work.... switched condition -> if not Group.getByName('groupA') then mist.respawnGroup('groupA', 120) end is the respawn function currently broken in MIST? ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 "This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL Link to comment Share on other sites More sharing options...
ENO Posted June 28, 2014 Share Posted June 28, 2014 Which mist are you using? "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...
dooom Posted June 28, 2014 Share Posted June 28, 2014 3.4 but i just figured it out.... i was using a GROUP DEAD condition... apparantly the ME doesnt like this... once i changed it to a flag condition that was set when the group dies, everything worked. eg. SWITCHED CONDITION -> GROUP DEAD 'GROUP A' -> DO SCRIPT if not Group.getByName('groupA') then mist.respawnGroup('groupA', 120) end ^^ Doesnt work BUT SWITCHED CONDITION -> GROUP DEAD 'GROUP A' -> FLAG ON '31' SWITCHED CONDITION -> FLAG TRUE '31' -> DO SCRIPT if not Group.getByName('groupA') then mist.respawnGroup('groupA', 120) end ^^ WORKS ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 "This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL Link to comment Share on other sites More sharing options...
Grimes Posted June 29, 2014 Share Posted June 29, 2014 The mission editor triggers don't update for anything added with coalition.addGroup() which is what mist.respawnGroup() uses. So even if the group data is identical, it won't "see" the group. However the trigger will work if you use a script condition. Also your method works to. For instance: Switched Condition > Lua Predicate (if not Group.getByName('groupA') then return true end) > Do Script (mist.respawnGroup('groupA', 120)) 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...
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