tmoilanen -> [Logged] Add Reference Point Relativity (1/27/2021 7:37:16 PM)
|
Hi - I'm attempting to set a reference point's relativity via LUA script. I am getting the following error: "Missing unit xxxxx from relative bearing" (xxxxx substituted for the GUID.) I suspect this is because I am trying to make the Reference Point relative to a unit of the other side, although I can manually set it in God's Eye View. Any help would be appreciated. Script is below: a = ScenEdit_GetUnit({name='elint'}) print(a) myguid = a.guid mylat = a.latitude mylon = a.longitude print(myguid) print(mylat) print(mylon) b = ScenEdit_GetUnit({name='nimitz'}) print(b) yourguid = b.guid print(yourguid) c = Tool_Bearing(myguid,yourguid) print(c) d = Tool_Range(myguid,yourguid) print(d) d = d - 240 print(d) position = World_GetPointFromBearing({latitude=mylat,longitude=mylon,distance=d,bearing=c}) print(position) rplon = position.longitude print(rplon) rplat = position.latitude print(rplat) if rplon > 180 then rpvar = rplon - 180 print(rpvar) rplon = 180 - rpvar print(rplon) end if rplon < 180 then rplon = rplon * -1 end ScenEdit_AddReferencePoint({side='Russia',name='test1',lat=rplat,long=rplon,clear=true}) ScenEdit_SetReferencePoint({side='Russia',name='test1',bearingtype=1,relativeto=yourguid})
|
|
|
|