Wrench Posted January 14, 2020 Share Posted January 14, 2020 Hey all, is there a way to get get all the zones defined in the ME? something like getZones()? Carrier Script. Link to comment Share on other sites More sharing options...
Grimes Posted January 14, 2020 Share Posted January 14, 2020 No direct function but anything in the mission file is accessible to the scripting engine as a table env.mission. They are indexed numerically. So you can open a .miz file and then open the mission file in notepad++ to note the formatting. In this case it is: env.mission.triggers.zones = {listOfZones} They are in this format. [2] = { ["y"] = -1606.310285714, ["radius"] = 22.86, ["zoneId"] = 58, ["x"] = 107906.32142857, ["color"] = { [1] = 1, [2] = 1, [3] = 1, [4] = 0.15, }, -- end of ["color"] ["hidden"] = false, ["name"] = "Naval Staff", }, -- end of [2] For instance this his how mist creates a DB of the zones if env.mission.triggers and env.mission.triggers.zones then for zone_ind, zone_data in pairs(env.mission.triggers.zones) do if type(zone_data) == 'table' then local zone = mist.utils.deepCopy(zone_data) zone.point = {} -- point is used by SSE zone.point.x = zone_data.x zone.point.y = 0 zone.point.z = zone_data.y mist.DBs.zonesByName[zone_data.name] = zone mist.DBs.zonesByNum[#mist.DBs.zonesByNum + 1] = mist.utils.deepCopy(zone) --[[deepcopy so that the zone in zones_by_name and the zone in zones_by_num se are different objects.. don't want them linked.]] end end end 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...
CougarFFW04 Posted January 14, 2020 Share Posted January 14, 2020 (edited) Hi Hey all, is there a way to get get all the zones defined in the ME? something like getZones()? Thanks for asking. I was about to ask it :smilewink: And thanks Grimes for the answer. Always there and helpfull :thumbup: Thans so much Edited January 17, 2020 by CougarFFW04 Link to comment Share on other sites More sharing options...
Wrench Posted January 15, 2020 Author Share Posted January 15, 2020 Grimes, I really should start either putting your name in the subject line or sending you PM, lol. As always sir, you are a scholar and a gentleman. :smartass: Carrier Script. Link to comment Share on other sites More sharing options...
Grimes Posted January 17, 2020 Share Posted January 17, 2020 Just post the questions on the forums because it allows other people to learn something or find it if they have the same question. 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 Link to comment Share on other sites More sharing options...
CougarFFW04 Posted January 17, 2020 Share Posted January 17, 2020 Hi Grimes, I had sometime to look at this and I was looking for a mist function that would return all DCS zones in a mission. But I didn't find it... Did I miss something or should I code this myself ? Thanks Link to comment Share on other sites More sharing options...
Grimes Posted January 17, 2020 Share Posted January 17, 2020 Its in the DB tables for mist. mist.DBs.zonesByName mist.DBs.zonesByNum So iterate those however you want to get the zones. 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...
CougarFFW04 Posted January 17, 2020 Share Posted January 17, 2020 Its in the DB tables for mist. mist.DBs.zonesByName mist.DBs.zonesByNum So iterate those however you want to get the zones. Don't get you :cry::joystick::joystick: Sorry Link to comment Share on other sites More sharing options...
Grimes Posted January 17, 2020 Share Posted January 17, 2020 https://github.com/mrSkortch/MissionScriptingTools/blob/master/Example%20DBs/mist_DBs_zonesByName.lua Mist saves a table of all of the zones in the mission. It is basically what would be returned via getAllZones() type of function. The following would create red smoke at 0 ASL at the center of each zone. for tName, tData in pairs(mist.DBs.zonesByName) do trigger.action.smoke(tData.point, 1) end 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...
CougarFFW04 Posted January 18, 2020 Share Posted January 18, 2020 Hi Grimes, Thanks SO MUCH YOU ROCK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Any idea about : https://forums.eagle.ru/showthread.php?t=261080 :D:D:smartass: Link to comment Share on other sites More sharing options...
Recommended Posts