ESAc_matador Posted June 14, 2016 Posted June 14, 2016 (edited) Truth be told those functions have always confused me. They were among the last functions Speed added to mist. I had to go in and test it to be sure, and even then I was confused so I had to add logging to the mist function to see exactly what was going on. What those functions do is you give it a unitNameTable of units to check and a bearing. It will the find the unit that is most in that direction and if a radius is given, it returns the average position of other units within a radius of that object. It then returns that position and generates a string accordingly. In other words if you give it a degreeHeading of 0 and every blue unit, it should return a string based on the position of the northern most blue unit. I say should because it was returning just fine for north/south units but when I tried east/west directions it wasn't returning what I was expecting. The BRstring function requires a reference position to give the Bearing, Range, Altitude from-to the target. MGRS and LL also have their own unique values required. I think what you might be wanting is something like a "pointInPie" where you get the objects that are within a certain bearing of an objects heading. The function mist.getLeadingPos() kind of does that, but you would need to filter out units within a radius of the aircraft first before searching them. I think I understood. What I want is a string of all units betewn the teo bearings. I can do the filtering to get a sting of groups and remove duplicated. Ill let you know how is it going. Edited June 14, 2016 by ESAc_matador
ESAc_matador Posted June 14, 2016 Posted June 14, 2016 I think, I can get the bearing to the average positiin of the group in zone through mist.getBRString then I can say if bearng is + - 15 degrees of players unit heading then add such group to a table.
ESAc_matador Posted June 25, 2016 Posted June 25, 2016 In DCS 1.5. Why, when I do mist.grouptopoint, grouptorandomzone, etc, always use roads? I try ed both, true and false.... and always tríes to get a road.
SkyCap Posted June 29, 2016 Posted June 29, 2016 Am I able to apply the advanced waypoint attributes found in the standard ME to units that are spawned through a mist script? I'm looking to build an accuracy test range, where the pilot can spawn a target which is essentially a ural, with M818s on 4 sides. They would then have to destroy the ural without destroying the M818 (with the M818s being at varying distances from the ural). I can do that part fine, but once the pilot has made an attack run, all the remaining vehicles drive away to defend themselves. I found that in just using the DCS editor the "Hold" command stops them from doing this completely. Any suggestions on how I can implement this into my spawn script? This is a small part of a larger training script, so ideally it would all be handled by the spawn script. Thanks
HiJack Posted June 30, 2016 Posted June 30, 2016 Add the ."disperse=off" to the group actions. I'll show you SkyCap.
Grimes Posted June 30, 2016 Posted June 30, 2016 To immobilize a ground AI group you have two options. You can either turn the AI off so they can't move or you can change the disperse on attack setting so they won't move if attacked. Group.getByName('whatever'):getController():setOnOff(false) or Group.getByName('whatever'):getContoller():setOption(AI.Option.Ground.id.DISPERSE_ON_ATTACK, false) Generally speaking the game doesn't like it when you assign a new task or change something the moment a group spawns, so you will have to run these functions a little bit after they spawn. 1 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
HiJack Posted June 30, 2016 Posted June 30, 2016 You also have the settings in "Reaction to threat" to just leave them standing whatever happens :D
SkyCap Posted June 30, 2016 Posted June 30, 2016 To immobilize a ground AI group you have two options. You can either turn the AI off so they can't move or you can change the disperse on attack setting so they won't move if attacked. Group.getByName('whatever'):getController():setOnOff(false) or Group.getByName('whatever'):getContoller():setOption(AI.Option.Ground.id.DISPERSE_ON_ATTACK, false) Generally speaking the game doesn't like it when you assign a new task or change something the moment a group spawns, so you will have to run these functions a little bit after they spawn. This was exactly what I needed, thank you!
chromium Posted July 10, 2016 Posted July 10, 2016 Hi Grimes, can you confirm that for cloned group the mist.DBs.dynGroupsAdded database won't add the group? it did in 1.5.3 but it's not doing in 1.5.4. Last mist release. 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.
Grimes Posted July 10, 2016 Posted July 10, 2016 Hi Grimes, can you confirm that for cloned group the mist.DBs.dynGroupsAdded database won't add the group? it did in 1.5.3 but it's not doing in 1.5.4. Last mist release. Working fine for me. What type of group are you cloning? 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
chromium Posted July 10, 2016 Posted July 10, 2016 (edited) Working fine for me. What type of group are you cloning? 3x BTR-80, vehicles. They aren't added in the db table that I dump few seconds after the cloning, in a test mission for a corrected DAWS Save Mission version for 1.5.4. DAWS use the spawned table to get data to add units. To be clear: clonegroup will work ok. teleport group also. But clonegroup data isn't added in the mist.DBs.dynGroupsAdded database. If you can confirm that it's ok I will recheck the code and maybe send it to you in PM. EDIT: added the test mission using only mist function (teleport, clone, dumpDBs). Only need to run for 40 sec after disabling sanitization module... thing that I bet you already know :pCloneTest1.miz Edited July 10, 2016 by chromium 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.
Grimes Posted July 10, 2016 Posted July 10, 2016 Enable the dbLog within mist at line 1121 by changing 'warning' to 'info'. Once changed look in your DCS.log for an entry related to "endUpdateTables". As long as you see that before you dumped the DBs, then you should see it. That said its supposed to update the DBs extremely quickly. 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
chromium Posted July 10, 2016 Posted July 10, 2016 (edited) Enable the dbLog within mist at line 1121 by changing 'warning' to 'info'. Once changed look in your DCS.log for an entry related to "endUpdateTables". As long as you see that before you dumped the DBs, then you should see it. That said its supposed to update the DBs extremely quickly. I updated previous post. I will do the test you ask asap. Can't find that entry, log attached (rename .log) :). Thanks for the help.dcs.txt Edited July 10, 2016 by chromium 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.
Grimes Posted July 10, 2016 Posted July 10, 2016 Yeah its clearly getting stuck on something and failing to update. Problem is with teleporting and not the clone. 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
chromium Posted July 10, 2016 Posted July 10, 2016 I saw. Thanks, Hope you can fix it Soon :). Good night Inviato dal mio SM-G850F utilizzando Tapatalk 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.
Grimes Posted July 11, 2016 Posted July 11, 2016 Pushed fix to development branch. May make a release later. The fix is the 2nd thing listed. It was checking the wrong type of value, don't know why it might have been working fine in previous releases though. Also noticed getUnitSkill wasn't working in your sample mission, so I had to investigate and fix that one. - fixed mist.time.getDate to account for changes made to the mission file format related to how the mission start time and date are saved. Also added in code to correctly account for leap years. - fixed issue in DB updating checking an incorrect value - fixed mist.getUnitSkill. Slightly reworked how the function got the data. 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
chromium Posted July 11, 2016 Posted July 11, 2016 Pushed fix to development branch. May make a release later. The fix is the 2nd thing listed. It was checking the wrong type of value, don't know why it might have been working fine in previous releases though. Also noticed getUnitSkill wasn't working in your sample mission, so I had to investigate and fix that one. - fixed mist.time.getDate to account for changes made to the mission file format related to how the mission start time and date are saved. Also added in code to correctly account for leap years. - fixed issue in DB updating checking an incorrect value - fixed mist.getUnitSkill. Slightly reworked how the function got the data. Worked for me. I'll wait the release to officially update DAWS Save Mission :) 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.
Grimes Posted July 11, 2016 Posted July 11, 2016 Worked for me. I'll wait the release to officially update DAWS Save Mission :) Merged fixes to the release branch. https://github.com/mrSkortch/MissionScriptingTools/releases/tag/4.3.73 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
chromium Posted July 12, 2016 Posted July 12, 2016 Merged fixes to the release branch. https://github.com/mrSkortch/MissionScriptingTools/releases/tag/4.3.73 you're FTL :thumbup: 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.
chromium Posted July 12, 2016 Posted July 12, 2016 Got an issue with the deadObjects DB, now it is void for the same mission (It's used to create the static dead object in DAWS) 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.
Grimes Posted July 13, 2016 Posted July 13, 2016 Got an issue with the deadObjects DB, now it is void for the same mission (It's used to create the static dead object in DAWS) Nothing is destroyed by the time you dump the DB so the table will be empty. I also tested it out in my mission I used to create the DBs and it looked to be displaying dead objects correctly. 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
chromium Posted July 13, 2016 Posted July 13, 2016 I tried in a different mission dumping the Db after the teleported Group Was destroyed having the issue. I Will Sent you another version tomorrow evening if i can replicate the issue Inviato dal mio SM-G850F utilizzando Tapatalk 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.
ESAc_matador Posted July 13, 2016 Posted July 13, 2016 Grimes, this can this be a Mist issue?? I am having problems with this. I need that the radius of the funcion getUnitLOS is dependant on the altitude of an aircraft. local Position_vec3 = Unit.getByName('recon1'):getPoint() local _elevation = land.getHeight({x = Position_vec3.x, y = Position_vec3.z}) local _height = Position_vec3.y - _elevation _reconradius = math.sin(0.45) * _height -- this works fine so far, gives you a radius, depending on the height and an angle, simulating a Recon Camera. Estimated camera angle is about 50º so, i did Sin(25º)) the problem is that in the function mist. getUnitsLOS does not work with the variable _reconradius. I check the table and it is always empty. It seems a format problem.. Probably due to the function.... any clue?? local redunits = mist.makeUnitTable({'[red][vehicle]'}) local blueunits = mist.makeUnitTable({'recon1'}) LOSData = mist.getUnitsLOS(blueunits,2,redunits,2,_reconradius)
ESAc_matador Posted July 13, 2016 Posted July 13, 2016 definetly the function mist.getUnitsLOS does not accept a variable in its radius argument. I made thousand tests, and it always works with number, but it never work with a variable such as _reconraius = 1000.
Recommended Posts