buur Posted July 30, 2021 Share Posted July 30, 2021 Hello everybody, here a small script that will show the initial points, witch you can add in mission editor, on map. Requires MIST. Maybe it is for some people helpful. Simply start the script on startup. function getTableSize(t) local count = 0 for _, __ in pairs(t) do count = count + 1 end return count end coalition_side = { neutral = 0, red = 1, blue = 2 } local navPoints = mist.DBs.navPoints local id_table = world.getMarkPanels( ) local size = getTableSize(id_table) for i, u in pairs(navPoints) do for k, v in pairs(u) do trigger.action.textToAll( coalition_side[i], k + size, v["point"], {0,0,0, 1}, {0,0,0,0}, 11, true, "◊ "..v["callsignStr"] ) counter = size + k end size = counter end Link to comment Share on other sites More sharing options...
daviddou80 Posted July 30, 2021 Share Posted July 30, 2021 nice job Link to comment Share on other sites More sharing options...
buur Posted June 3, 2022 Author Share Posted June 3, 2022 There has something changed in DCS so the former script is broken. Here an updated version function getTableSize(t) local count = 0 for _, __ in pairs(t) do count = count + 1 end return count end coalition_side = { neutral = 0, red = 1, blue = 2 } local navPoints = mist.DBs.navPoints local id_table = world.getMarkPanels( ) size = getTableSize(id_table) for i, u in pairs(navPoints) do for k, v in pairs(u) do size = getTableSize(id_table) trigger.action.textToAll( coalition_side[i], k + size, v["point"], {0,0,0, 1}, {0,0,0,0}, 11, true, "◊ "..v["callsignStr"] ) counter = size + k end size = counter end Link to comment Share on other sites More sharing options...
buur Posted July 10, 2022 Author Share Posted July 10, 2022 here an second approach. This version do not need Mist, but is not able to show custom IPs on map. -- Refpoints2Map_v2 by buur function getTableSize(t) local count = 0 for _, __ in pairs(t) do count = count + 1 end return count end for i = 0, 2, 1 do --trigger.action.outText(i, 100, false) Ref2Map = coalition.getRefPoints(i) --trigger.action.outText(mist.utils.tableShow(Ref2Map), 100, false) if Ref2Map then for key, val in pairs(Ref2Map) do --trigger.action.outText(mist.utils.tableShow(Ref2Map), 100, false) local id_table = world.getMarkPanels( ) local size_id_table = getTableSize(id_table) local myCallsigns = { [0] = "N/A", [1] = "FORD", [2] = "EDSEL", [3] = "DODGE", [4] = "MAZDA", [5] = "BANKS", [6] = "CHEVY", [7] = "TOWEL", [8] = "ADDER"} trigger.action.textToAll( i, size_id_table + key, val["point"], {0,0,0, 1}, {0.8,0.8,0.8,0.5}, 11, true, "◊ "..myCallsigns[val["callsign"]] ) end end end Link to comment Share on other sites More sharing options...
Recommended Posts