I actualy asked this before but only just now noticed I posted it on the wrong part of the bord so I am now posting it here.



I have the code here and it should work. so the only reason why it isn't working is that I'm give the wrong position fore the player.

Just in case I also tryed the code in c++ in a test envirment that I made since I can't debug in lite-c becouse I have no debug window...

so if anyone can point me in the right way I thank you, and to further clarify I am using the plBiped01 that came along with lite-c.

function checkInTalkRange()
{
...var talkEvents = 2;
...var radius2 = 100*100;
...var x0 = 0;
...var y0 = 0;
...x0 = my.x;
...y0 = my.y;
...var i = 0;
...while(i < talkEvents)
...{
......var x1 = 0;
......var y1 = 0;
......x1 = npcX;
......y1 = npcY;
......var dx = 0;
......dx = x1 - x0;
......var dy = 0;
......dx = y1 - y0;
......var distance = 0;
......distance = (dx*dx) + (dy*dy);
......if(distance < radius2)
......{
.........talk();
......}
...i += 1;
...}
}

the problem is that the distance seams to get the wrong numbers and the my.x my.y should be from the plBiped01 altough they are called forth in a difrent file named talk so maybe thats the problem.

I used the ... to show the height in the code since it seams to delete my spaces when I past.