Forums » Suggestions
Radar API
Currently getting info from radar is retarded.
I use sector list but sometimes I'd like to filter out certain ships.
Maybe add a filter option to the sector list but a GetRadarInfo() would be great.
I use sector list but sometimes I'd like to filter out certain ships.
Maybe add a filter option to the sector list but a GetRadarInfo() would be great.
Not to be a pain but....
You can currently get full stats on any object targeted by radar thru the api.
Is there a more specific function / return you had in mind?
table = radar.getinfo(nodeid,objectid)
?
You can currently get full stats on any object targeted by radar thru the api.
Is there a more specific function / return you had in mind?
table = radar.getinfo(nodeid,objectid)
?
The best way to filter the list of players in the sector is to use ForEachPlayer(<function>)
<function> is passed the character_id of each player in the sector that can be seen by radar, so you can operate on that to get information that doesn't require direct targeting.
Try to avoid using radar.SetRadarSelection() as this is an expensive function call to make. My past tests have shown it to be around 20ms for a successful target change.
ForEachPlayer(function(charid)
if (GetPlayerName(charid):match("^[^*]")) then
table.insert(PCList, charid)
end
)
<function> is passed the character_id of each player in the sector that can be seen by radar, so you can operate on that to get information that doesn't require direct targeting.
Try to avoid using radar.SetRadarSelection() as this is an expensive function call to make. My past tests have shown it to be around 20ms for a successful target change.
ForEachPlayer(function(charid)
if (GetPlayerName(charid):match("^[^*]")) then
table.insert(PCList, charid)
end
)