IsVisible : unitId, byTeamId : bool
True iff given unit is visible to given team. In full information mode, visibility information about other teams is available. In limited information mode, only visible units are accessible
Lua Guide says:
IsVisible (unitID, teamID)
unitID:IsVisible (teamID)
Every which way I've used this, the game crashes. If understand this correctly, it's this...
IsVisible(unitID[not your own unit], [your own]TeamID), that is, can your own bot see the enemy unit you're referencing.
Even in chat, IsVisible causes a crash. Is it my code or the argument?!
Code: Select all
Defcon 4
enemyBattleships = {}
other code logs enemy units every second
...
Defcon 3
local us = GetOwnTeamID()
local eb = # enemyBattleships
if # enemyBattleships > 0 then
--if enemyBattleships[eb]:IsVisible (us) == true then
SendChat(enemyBattleships[eb]:IsVisible (us))
--end
end