@samerdl I looked at the Reflection include and found this:
https://github.com/SRL/srl-reflection/blob/master/Core/NPCs.simbatype
{Holds information related to an NPC}
TNPC = record
Index, ID, Level, Animation, Height, HPRatio, Interacting,
Orientation: integer;// SOUTH = 0; NORTH = 180; CLOCKWISE.
Tile, RealTile: TTile;
Pixel: TPoint;//Pixel position on tile
Name: String;
Actions: TStringArray;
Moving, Fighting: boolean;
end;
So this function returns an arrow of the record TNPC:
function R_GetNPCsMulti(TheVarArr: TVariantArray; Null: Boolean): TNPCArray;
Each TNPC has these properties: (as defined in the type)
Index - index of the NPC(not really sure what this is :D)
ID - the NPC Id obviously
Level - the NPC combat level
Height - the NPC height
HPRatio - the NPC HPratio
Interacting - no idea TBH
Orientation - the NPC direction (south = 0 and north is 180)
Tile - the tile the NPC is standing on
RealTile - the tile were the NPC spawns I'm guessing
Pixel - Location of the NPC
Name - Name of the NPC
Actions - Options of the NPC
Moving - whether or not the NPC is moving (true/false)
Fighting - whether or not the NPC is fighting (true/false)
You can acess them by doing TNPC and a period. So to see if the NPC fighting you would do like TNPC.Fighting, and it would return true/false
To access the one you want you would have to do a for to do loop to get the one your looking for, for example:
function r_getNPCLocation(npcID:Integer):TPoint;
var
i:Integer;
NPCS:TNPCArray;
begin
NPCS := R_GetNPCsMulti; //gets the info of all the NPCs nearby
for i := 0 to high(NPCS) do //prepares to loop through all of the found NPCs
begin
// if the current index NPCs id is the one you chose and is not in combat
// then the result is the location of that NPC
if ((NPCS[i].ID = npcID) and (NPCS[i].Fighting = false)) then
result := NPCS[i].pixel;
end;
end;
To ultimately understand this I would suggest looking at a records tutorial:
http://villavu.com/forum/showthread.php?t=80132EDIT: here is a quick example sort of (that is related to this situation):
type SRLtype = record
Developer, SuperMod, Admin:TStringArray;
end;
function SRLRanks:SRLtype;
begin
result.Admin := ['Wizzup?', 'Hobbit', 'Benland100', 'Daniel', 'Brak' +
'Coh3n','nielsie95','RAM','WT-Fakawi'];
result.SuperMod := ['YoHoJo','Zyt3x','Justin','MasterBB'];
result.Developer := ['Flight', 'Coh3n', 'Hobbit', 'NCDS', 'n3ss3s' +
'Wizzup?','WT-Fakawi','Zyt3x'];
end;
begin
Writeln(SRLRanks.SuperMod);
end.
As you can see the type "SRLtype" contains Developer, Supermod, and Admin, and the function SRLRanks returns SRLType.
Writeln(SRLranks) will print all of the names
Writeln(SRLranks.Admin) will print the admins
Writeln(SrlTanks.Developer) will print the developers and so on