stilesw
Posts: 1497
Joined: 6/26/2014 From: Hansville, WA, USA Status: offline
|
DWReese is right on. The below LUA code was created before the "reference point circle" feature was added to CMO/CMANO. I don't recall who created it but it lets you assign any number of reference points around a given unit and, allows you to name them as you like. I've found that 12 works very well and have used this code extensively. -WS ----------------------------------------------------------------------------------- function draw_circle(a, b, First_Pt, Last_Pt, Num_Pts, txt) -- ([lat,lon], First_Pt, Last_Pt, Number_of_Pointsts, name) if txt == nil then txt = "" end lat1 = a.latitude lon1 = a.longitude r = b / 60 ----- for i = First_Pt, Last_Pt do -- Consecutive integer numbers th = 2 * math.pi * i / Num_Pts rlat = lat1 + r * math.cos(th) rlon = lon1 + r * math.sin(th) / math.cos(math.rad(lat1)) ScenEdit_AddReferencePoint({ side = 'PlayerSide', lat = rlat, lon = rlon, name = txt..i, highlighted = "yes"}) end end --------------------------------------------------- Owner = "Appropriate Side Name" Unit_Name = "Appropriate Unit Name" Radius =1 Number_of_Points = 12 First_Pt = 00 Last_Pt = 11 Point_Names = "AAW Patrol Zone-" --------------------------------------------------- local unit = ScenEdit_GetUnit({side=Owner, name=Unit_Name}) draw_circle({latitude=unit.latitude, longitude=unit.longitude}, Radius, First_Pt, Last_Pt, Number_of_Points, Point_Names) ---------------------------------------------------
_____________________________
“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.” Charles Edward Montague, English novelist and essayist ~Disenchantment, ch. 15 (1922)
|