World_GetCircleFromPoint (table)

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
vettim89
Posts: 3668
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

World_GetCircleFromPoint (table)

Post by vettim89 »

I have a question about the syntax for this function. You need, long, lat, numpoints, and radius according to the documents and the LUA Console. I have tried this and nothing happens. Should you get a set of reference points when running this function? That is what I am trying to do. Also what measure is radius measured in? I assume its NM
"We have met the enemy and they are ours" - Commodore O.H. Perry
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: World_GetCircleFromPoint (table)

Post by KnightHawk75 »

When you say nothing happens do you mean a table of points is not returned or RP's aren't created. If the latter you must do this yourself, as function just returns a table of lat\lons for you to use. Yes radius is in Nm.

For example:

Code: Select all

 local function BuildCircleOfRPs(theside,basename)
   local tableofcirclepoints = World_GetCircleFromPoint({latitude=1.0,longitude=1.0,numpoints=12,radius=50})
   local counter = 1;
   for k,v in ipairs(tableofcirclepoints) do
     ScenEdit_AddReferencePoint({side=theside,latitude=v.latitude,longitude=v.longitude,name=basename .. "-" .. counter})
     counter = counter +1;
   end
 end
 
 BuildCircleOfRPs("blue","mycircle");
 
Post Reply

Return to “Lua Legion”