For debugging you can try this:
Simba Code:
program R_Test;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}
{$I SRL-OSR\SRL\misc\SmartGraphics.simba}
const
debugNPC = true;
debugObjects = false;
procedure drawDebug;
var
p, pt:TPoint;
npcs:TNPCArray;
objects:TRSObjectArray;
i, k:integer;
begin
p := R_GetTileGlobal();
if (debugNPC) then
npcs := R_GetAllNPCs();
SMART_ClearCanvas;
SMART_DrawText(5, 5, 'statchars07', 'Tile: ' + toStr(p.x) + ',' + toStR(p.y), 65280);
for i := 0 to high(npcs) do
begin
pt := R_TileToMs(npcs[i].tile);
if ((pt.x - 5) > 0) and ((pt.x - 5) < 515) and ((pt.y - 25) > 0) and ((pt.y - 25) < 337) then
begin
SMART_DrawText(pt.x - 5, pt.y - 25, 'statchars07', toStr(npcs[i].NpcID), 65280);
SMART_DrawCircle(false, pt, 1, false, 254);
end;
end;
if (debugObjects) then
objects := R_GetObjectsDistance(0, 12);
for k := 0 to high(objects) do
begin
pt := R_TileToMs(objects[k].tile);
if ((pt.x - 5) > 0) and ((pt.x - 5) < 515) and ((pt.y - 25) > 0) and ((pt.y - 25) < 337) then
begin
SMART_DrawText(pt.x - 5, pt.y - 25, 'statchars07', toStr(objects[k].ID), 65280);
SMART_DrawCircle(false, pt, 1, false, 254);
end;
end;
end;
begin
setupsrl;
SetupReflection;
repeat
drawDebug;
wait(300);
until false;
end.
Also the object type for trees is indeed 0