Midnight Posted September 25, 2013 Posted September 25, 2013 Thanks for your hard work on this Grimes!
St3v3f Posted September 25, 2013 Posted September 25, 2013 Thanks for your hard work on this Grimes! what he said aka: Baron [sIGPIC][/sIGPIC]
gunterlund21 Posted September 25, 2013 Posted September 25, 2013 Hi Grimes Interested in these new ground route functions. Patrolroute. When would you use this function. If I assign group b the route of group a, will group b go to the same exact waypoint locations on the map or will the mimic the route pattern. So for instance if group B is on the other side of the map from group a. I was in Art of the Kill D#@ it!!!!
Grimes Posted September 25, 2013 Posted September 25, 2013 The patrol functions are basically there so you can setup a patrol at the start of the mission and the AI will follow the route till the mission is over. If you use mist.ground.patrolRoute with gpData and useGroupRoute the group will go to the exact waypoint location, speed, and formation of the other groups path. As it is scripted, group B would attempt to travel to group A's first waypoint. There are limitations of AI capability to travel across the map, for some reason or another if you dynamically task the AI to travel across the map it might not be able to calculate the full route and will only go so far. Its not really a problem though because you don't even have to spawn the group that you might want to grab the waypoints from. 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 September 27, 2013 Posted September 27, 2013 Question: using the mist.groupToRandomPoint function and applying "0" to disableRoad variable, will the group make use of roads? PS: please note that the disableRoad description is broken in the reference guide ;). 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 September 27, 2013 Posted September 27, 2013 Wiki Documenation Wiki Documentation Now Online Good news everyone! I've created a wiki page for each and every MIST function. It can all be found here: http://wiki.hoggit.us/view/Mission_Scripting_Tools_Documentation There is a lot of work left to do on it. I'd like to have proper examples for every function, input variable, etc. But its a start. I'll also be changing how the Simulator Scripting Engine wiki page is organized. So let me know how you like the look and usability of the Mist documentation. I'll still be maintaining the PDF guide on each release; but the newest, most up to date, and most accurate information will always be available on the wiki first due to its ability to be updated anytime I want. Through making the wiki I did notice quite a few typos with the PDF that I've got to go back and fix. :) Question: using the mist.groupToRandomPoint function and applying "0" to disableRoad variable, will the group make use of roads? Any value other than (nil) or (false) in disableRoads will disable the usage of roads, including 0. So no, if you pass it a value of "0" or the number 0, the group will not try to use a road. 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 September 27, 2013 Posted September 27, 2013 Any value other than (nil) or (false) in disableRoads will disable the usage of roads, including 0. So no, if you pass it a value of "0" or the number 0, the group will not try to use a road. Cause in lua 0 is a value and not nil. Uff, I didn't remember it, sorry :) 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 September 28, 2013 Posted September 28, 2013 (edited) Uploaded a hotfix for 3.2. Its only really needed if you are using any of the following functions mist.getCurrentGroupData mist.teleportGroup mist.teleportInZone mist.teleportToPoint http://forums.eagle.ru/showpost.php?p=1885136&postcount=324 Edited September 28, 2013 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
St3v3f Posted September 29, 2013 Posted September 29, 2013 Found an error in the wiki documentation: The function described as getRandomPointInCircle is actually called getRandPointInCircle 1 aka: Baron [sIGPIC][/sIGPIC]
galevsky06 Posted September 30, 2013 Posted September 30, 2013 (edited) Uploaded a hotfix for 3.2. Its only really needed if you are using any .... http://forums.eagle.ru/showpost.php?p=1885136&postcount=324 May I do some request ? Is it possible to add a DL link on top of wiki page, closed to => Current release: 3.2 ? Because it is boring to switch between forum + wiki to get information. Single entry point is more comfortable. :) Your hoggit wiki looks perfect, even if I prefer sometimes .pdf doc due to the fact that I can search text in all-in-one page. Please keep up this so great job :thumbup: Edited September 30, 2013 by galevsky06
Grimes Posted September 30, 2013 Posted September 30, 2013 Fixed. And thanks to St3v3f for noticing and fixing a typo with the unit conversions entries. 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
chromium Posted September 30, 2013 Posted September 30, 2013 (edited) simple question: what is the equivalent of Group.getByName() for zones? zones.getByName() ? I need this to use mist.cloneInZone function after a search in the mist_DBs_zonesByName Db. SOLVED: trigger.misc.getZone() does it :) Edited September 30, 2013 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.
chromium Posted September 30, 2013 Posted September 30, 2013 need help with this function: -- -- first part, to be included in a first script --FLOT clone group active UseRandomFLOTzone = true -- -- setup part, to be included in a second script --Function for the use of the clone in random zone for zones defined by "FLOT" tag. if UseRandomFLOTzone then local zone_names local zone_data local zone_tag = "FLOT" for zone_names, zone_data in pairs(mist.DBs.zonesByName) do --List of groups by name if string.find(zone_names,zone_tag) then --searches for prefix within group names local zns = trigger.misc.getZone(zone_names) if zns then mist.scheduleFunction(mist.cloneInZone,{"FLOT_units", zns, "disp", 150},timer.getTime() + 10, 10,timer.getTime()+60) else env.info(zone_names) end end end end This function modify the clone one to allow a set of zones defined by their name. If there isn't zones with the "FLOT" tag, nothing happen. If one or more zones have the "FLOT" tag in their names, they are included in a scheduled clone function that execute 5 times the clone action. The function could also be disabled by the global variable upside, that will be part of a bigger "option" script. Well, there is a strange behaviour that I can't understand: The function is supposed to clone the FLOT_units group 5 times, placing it randomly in one of the FLOT zones. But instead, it creates a clone for any zones with FLOT in its name... every time. i.e., if I have 3 zones with FLOT in it's name, it create 15 groups... 3 by 3 at any scheduling action. Any solution? :( 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 October 1, 2013 Posted October 1, 2013 Well its working as it is programmed to. You are iterating one at a time through every zone in the mission. For each zone that it detects with the string 'FLOT" in it, it will schedule a cloneInZone to run effectively 5 times. What it looks like you want to do is to figure out which zones match, and then pass that table of zone names to the function for it to run 5 times. if UseRandomFLOTzone then local zone_tag = "FLOT" local zones = {} for zone_names, zone_data in pairs(mist.DBs.zonesByName) do --List of groups by name if string.find(zone_names,zone_tag) then --searches for prefix within group names table.insert(zones, zone_names) end end if #zones > 0 then mist.scheduleFunction(mist.cloneInZone,{"FLOT_unit s", zns, "disp", 150},timer.getTime() + 10, 10,timer.getTime()+60) else env.info(zone_names) end end The reason why its not erroring out is I have that function to setup to still work if you directly pass it a zone table. Even though its not said to be a valid input value :) 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 October 1, 2013 Posted October 1, 2013 Uhm, understood. I expected to see it working on a table (As I already use that function scheduled by trigger and with an explicit table of zone names), but I didn't notice that my code would execute the function on EVERY zone that has the tag. I believe that I should "move" the scheduling function out of the "for" zone names search... so that I can apply the scheduling function over a real zone names table. Is it the right way? thanks in advance. 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 October 1, 2013 Posted October 1, 2013 Yup. 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 October 1, 2013 Posted October 1, 2013 Yup. Thanks, I'll try this evening something different :) (expect some other annoying help request :D) 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 October 2, 2013 Posted October 2, 2013 Hi, I had not time to test your modification of the script to see if it's working (but I already changed "zns" in "zones")... I hope to try this evening. But I'm also looking for another fancy solution for customize the number of copies of the cloned group. To be clear, I have to get this function to work by other people that don't even know how trigger works, and neither script. By the zone check, I have a solution about activating / not activating the script... if the script don't find any "FLOT" zone, it doesn't copy anything anywhere. Now I want that the script generates a number of copies of the cloned group that are the double of the count of unit in the group (i.e. if the cloned group contain 4 units, there will be 8 copies... if 3 units, 6 copies... and so on). I think that I can archieve to get the unit count info and do the necessary math, but I don't know how to use this information to stop the scheduling: It' better to use another script with the remove function provided in MIST or it's better to try to insert a math calculation at the stop time variable in the scheduling function? Thanks in advance, 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 October 2, 2013 Posted October 2, 2013 (edited) ok, it seemed impossible to me, but.... IT WORKS. if UseRandomFLOTzone then local zone_tag = "FLOT_Blue1" local zones = {} local groupName local groupData local ClGrpSize = Group.getSize(Group.getByName("FLOT_Blue1_group")) for zone_names, zone_data in pairs(mist.DBs.zonesByName) do --List of groups by name if string.find(zone_names,zone_tag) then --searches for prefix within group names table.insert(zones, zone_names) end end if #zones > 0 then mist.scheduleFunction(mist.cloneInZone,{"FLOT_Blue1_group", zones, "disp", 150},timer.getTime() + 10, 10,((timer.getTime()+(ClGrpSize*10))+10)) else env.info(zone_names) end end actually this modification of the clone function will do this: produce "n" clones of a cloned group defined by its group name (FLOT_Blue1_group), where "n" is the unit number count in the group (a 4-units group will produce 4 clones). Those clones are placed randomly in every zones that has one of the defined zone_tags in its name (FLOT_Blue1). PS: I noticed that copy&paste here the code in the spoiler doesn't allow me to keep the spacing on left side of each line as it is in code... how do you archive it here in the forum? thanks ;) Edited October 2, 2013 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.
wolle Posted October 6, 2013 Posted October 6, 2013 dynAdd doesn't allow ships Hi Grimes, Not sure if this was raised before. dynAdd in Mist 3.2 does not allow creation of ships, because it only recognizes categories "GROUND_UNIT' and 'AIRPLANE'. Is there a reason for that? I modified your code a little such that it also checks for category 'SHIP', but I am wondering why you left it out. Does it mess up something else? [sIGPIC][/sIGPIC] Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro
Grimes Posted October 7, 2013 Posted October 7, 2013 Hi Grimes, Not sure if this was raised before. dynAdd in Mist 3.2 does not allow creation of ships, because it only recognizes categories "GROUND_UNIT' and 'AIRPLANE'. Is there a reason for that? I modified your code a little such that it also checks for category 'SHIP', but I am wondering why you left it out. Does it mess up something else? Are you stating that it doesn't work because you are looking at the code or you tried it and it doesn't work? If you are looking at line 4452, it is setup that way because of different naming schemes used between the editor and the scripting engine. Some data can be derived from the editor in which case the group category for a ground group is "vehicle" which is not a valid category type. All that code does is check for alternative names. The same applies to airplanes with the editor using "plane". Ships and helicopters do not have that issue as the category is the same between the editor and the scripting engine. 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
wolle Posted October 7, 2013 Posted October 7, 2013 The following code works local vars = { units = { [1] = { ["type"] = 'Infantry AK', ["name"] = 'Unit #1', ["heading"] = 0, ["skill"] = "Random", ["x"] = pos2.x, ["y"] = pos2.y, }, -- end of [1] }, visible = false, hidden = false, category = 'GROUND_UNIT', name = 'group name', country = 'USA' } mist.dynAdd (vars) The following code doesn't local vars = { units = { [1] = { ["type"] = 'PERRY', ["name"] = 'Unit #1', ["heading"] = 0, ["skill"] = "Random", ["x"] = pos2.x, ["y"] = pos2.y, }, -- end of [1] }, visible = false, hidden = false, category = 'SHIP', name = 'group name', country = 'USA' } mist.dynAdd (vars) It works after I change your code from if newTable['category'] == 'GROUND_UNIT' then mistCategory = 'vehicle' newTable['category'] = mistCategory elseif newTable['category'] == 'AIRPLANE' then mistCategory = 'plane' newTable['category'] = mistCategory end to if newTable['category'] == 'GROUND_UNIT' then mistCategory = 'vehicle' newTable['category'] = mistCategory elseif newTable['category'] == 'AIRPLANE' then mistCategory = 'plane' newTable['category'] = mistCategory elseif newTable['category'] == 'SHIP' then mistCategory = 'ship' newTable['category'] = mistCategory end [sIGPIC][/sIGPIC] Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro
Grimes Posted October 7, 2013 Posted October 7, 2013 It still spawns for me, although it causes an error. The problem is in the dbUpdate function where it doesn't correctly change the case of the group type to match what is used by mist DBs, thus it creates an error when it tries to update the DBs. Its been rectified in the next release. Without your modification it does accept a lowercase value of "ship" for the category, which isn't a problem for mist.dynAdd. 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
Bushmanni Posted October 10, 2013 Posted October 10, 2013 I found out that having "\n" in the string when using mist.utils.dostring() fails the execution of the code because of improperly ending string. It the behavior is like intended then maybe add mention of this problem in the wiki. The explanation of the function in the wiki is also a bit messy ("... If false, then this value will be the compilation error. ...", which value?). DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community -------------------------------------------------- SF Squadron
Recommended Posts