i think i know how to make a hemispheical radar, heres how you draw the blips:
--gets iff color
getiff = function(target)
local R,G,B
local name
if target:getBreedName() == "Ship" or target:getBreedName() == "Weapon" then
if target.Team:isValid() then
name = target.Team.Name
else
name = "Unknown"
end
elseif target:getBreedName() == "Asteroid" then
name = "Asteroid"
else
name = ""
end
if name == "Hostile" or name == "Traitor" then
R,G,B = 255,0,0
elseif name == "Friendly" then
R,G,B = 0,255,0
elseif name == "Unknown" then
R,G,B = 255,0,255
elseif name == "Neutral" then
R,G,B = 0,0,255
elseif name == "Asteroid" then
R,G,B = 255,255,255
else
R,G,B = 128,128,128
end
return R,G,B
end
--hemi-radar, takes scanning ship, xy coords of front hemisphere, xy coords of aft hemisphere, hemisphere radius
hradar = function(pship,x1,y1,x2,y2,r)
for i=1, #mn.Ships do
local tship = mn.Ships[i]
if tship:isValid() then
local tpos = pship.Orientation:rotateVector(tship.Position - pship.Position)
local tlen = tpos:getMagnitude()
local tx, ty = (tpos.x/tlen) * r, (tpos.y/tlen) * r
--place the blip on one hemisphere or the other
if tpos.z >= 0 then tx, ty = x1+tx, y1-ty else tx, ty = x2+tx, y2-ty end
--set colors
local r,g,b = getiff(tship)
local sel
--get selected target aura color
if pship.Target == tship then
local R,G,B = r+96,g+96,b+96
if R > 255 then R = 255 end
if G > 255 then G = 255 end
if B > 255 then B = 255 end
gr.setColor(R,G,B,128)
sel = true
end
--maybe draw selected target aura
if sel then gr.drawCircle(2,tx,ty) end
--draw blip
gr.setColor(r,g,b,255)
gr.drawCircle(1.5,tx,ty)
end
end
end
you just overlay that on top of some texture for a useful radar.