Lancelot074
2011-07-04 16:38:39
Hey guys, I know how to go about doing this; find all the available npcs and cycle through them to compare which one is closest, but I can't seem to make it work. Any help would be appreciated, thanks.
2011-07-04 16:38:39
2011-07-04 17:23:34
Function SortNPCs(NPCs:array of TNPC):array of TNPC; 2011-07-04 17:45:30
2011-07-04 17:49:15
From: Lancelot074
Thanks for the quick reply, after I sort the NPCs, how do I find the closest warrior? I assume it would be something like:
FindNPC(NpcID, SortedArray[0])
because the closest one is stored into the lowest position.
2011-07-04 17:54:30
2011-07-04 17:57:35
2011-07-04 17:59:22
Ta := GetNPCs(WarriorID);
if (Length(Ta) > 0) then
begin
SortNPCs(Ta);
for i := 0 to High(Ta) do
begin
if FindNPC(WarriorID, Ta[i]) then
begin
end;
end;
end; 2011-07-04 18:07:02
From: Lancelot074
Ta := GetNPCs(WarriorID);
if (Length(Ta) > 0) then
begin
SortNPCs(Ta);
for i := 0 to High(Ta) do
begin
if FindNPC(WarriorID, Ta[i]) then
begin
end;
end;
end;
I think I got it, would this work because it would find the first in the array, which is the closest because it was sorted.
2011-07-04 18:12:12
2011-07-04 20:27:39
2011-07-04 21:28:38
From: cause
Quick question, how would you use the minimap :)? (Is there a tut for this?)