For debug reasons, you can type
debug where "charactername"
to find out where they are.
If you wanted this in a ingame setting and wanted to know where every single character is (aka,
ULTIMATE STALKER MODE) you could use this code.
C#:
foreach( GameLocation loc in Game1.locations)
{
if(loc.characters.Count > 0)
{
foreach( NPC npc in loc.characters )
{
Game1.addHUDMessage(new HUDMessage(npc.Name + " : " + loc.Name + " at " + npc.Tile.X +","+npc.Tile.Y));
}
}
}
Just put this into the OnTimeChanged method and you will be notified every couple seconds.
:D
(oh yeah. for your original request, you can use this method here for where a certain person is. I dunno how to make a hud for this whole thing, (in order to set which character you want) but heres what I got so far.
C#:
void whereIsCharacter(string npcName)
{
foreach (GameLocation loc in Game1.locations)
{
if (loc.characters.Count > 0)
{
foreach (NPC npc in loc.characters)
{
if (npc.Name == npcName)
{
Game1.addHUDMessage(new HUDMessage(npc.Name + " : " + loc.Name + " at " + npc.Tile.X + "," + npc.Tile.Y));
return;
}
}
}
}
}
)