It is maybe a dump question, but I don't understand what "TypeName" means in "Object.GetNearbyObjects( TypeName, SearchDistance )".
I looked through the Lua page and tried values like "Object" or "People", but nothing seems to work.
Here is a piece of my code:
Code: Select all
local found = Object.GetNearbyObjects( "People", 20 );
local size = table.getn(found);
Game.DebugOut(size);
for k, v in pairs(found) do
Game.DebugOut(k);
Game.DebugOut(v);
end
-- [EDIT] Working code:
local objectTypes = {"Guard","Prisoner" }
for i,objectType in ipairs( objectTypes ) do
local found = Object.GetNearbyObjects( objectType, 4 );
for id, distance in pairs(found) do
Game.DebugOut("Found:");
Game.DebugOut(id);
end
end
Also I have problems with the Debug window, "DebugOut" does not open it. It only opens if a error happens. Is there a button to open it?
Thank you for your help!