SRL Archive - Reflection Help

Finding NPCs


DeSnob

2010-09-12 11:36:10

How do I use reflection to find NPCS?

I was using 'FindNPCS' and then it would sort through the NPCs' names to find the npc I needed, but now it doesn't want to work. :(

Also, How do I find out if the NPC (like the advanced pickpocketing master) has fallen after being knocked down?

Inspirations

2010-09-12 14:10:23

var
t: TNPC;
begin
t := FindNPC({ID/Name});
if t = nil then
Exit;
P := TileToMS(t.Tile);
MMouse(P.x, P.y, 5, 5);
if WaitUpText({text}, 500) then
Mouse(x, y, 0, 0, );

JPHamlett

2010-09-12 16:40:42

As for your second question you could do something like this (Assuming that begin knocked down is a animation).


var
Char : TNPC;
begin
Char := GetNPC({Name});
if (Char.Animation = {Animation}) then
begin
//Code goes here
end;
end;