Clutch
2015-03-11 01:40:48
– WARNING: .getPlayerPos(): Didn't find enough matches accurately calc your postion
– .getPlayerPos(): result = {X = -1, Y = -1}, took 421 ms
I am getting the above error. Basically I've spent 2 days getting ideas from others and doing research yet still am unable to get this to work. When I call on a single map it loads and works perfectly. When I try doing a 2nd or even 3rd map is when I start having issues. It's not updating the playerPos. It's comparing my old maps last point ex. 322,400 to my next maps first point 322,400. In this scenario it will run although 90% of the time it runs incorrectly or I just got lucky with the way it had been setup. Normally though my first point is something like 70,150, now it's the same location on the minimap BUT the player position isn't getting updated for that new map. This probably makes no sense, so i'll edit in what I wrote on the other thread where I was getting help.
Okay guys, let me explain again what is occuring. Basically using SPS does not work with using multiple maps. It tries to calc my player position based on the currently loaded map, in the example below you'll see that my playerpos at the end is 150,327. It then loads a NEW map and the starting position on the new map (which is directly on top of the ending position on the map) is picking my playerpos but it's detecting that the coordinates for that map are 193,153 not 150,327 even though its the same spot (I understand it's slightly different but not THAT different). That being said if you don't understand I encourage you to test it for yourself, you simply need to create your own map and copy the array path.
Notice the area is almost identical (center is close to identical as well obviously) note the positions in red though!
[ATTACH=CONFIG]25264[/ATTACH]
Edit 3: As a workaround I suppose I could make my maps extremely small and have a single map for each point to point interaction, albeit that's going to be 600 maps (probably not close but you get the point) and alot of effort. Any other ideas/workarounds? I think I could do as @Incurable; did and use a single huge map (he did it or I read a thread/post on it) and just have 2 second wait times which if that's the best route to take then so be it.
Edit 4: I have a crazy idea (currently testing failed miserably) but due to the way that it is interacting I could in theory have it go from top to bottom of the map I load, then rotate my next map so that my beginning position starts at my last ending position (for the way SPS sees it (ex. Top of Map A. ends at the bottom, Map B. Begins at the bottom and the path goes to the TOP)) although assuming this works it'll be a bit annoying but sounds like my best option unless one of you have a better idea or I am completely not understanding what is going on.
Edit 5: giving up for the night, that being said getplayerpos… does that come from the sps map? If so is there a way to force change it to detect your at location x,y and then start next map coords within that area? (edit this is haunting me can't even sleep back at it again trying to figure it out..)
– .getPlayerPos(): result = {X = -1, Y = -1}, took 421 ms
I am getting the above error. Basically I've spent 2 days getting ideas from others and doing research yet still am unable to get this to work. When I call on a single map it loads and works perfectly. When I try doing a 2nd or even 3rd map is when I start having issues. It's not updating the playerPos. It's comparing my old maps last point ex. 322,400 to my next maps first point 322,400. In this scenario it will run although 90% of the time it runs incorrectly or I just got lucky with the way it had been setup. Normally though my first point is something like 70,150, now it's the same location on the minimap BUT the player position isn't getting updated for that new map. This probably makes no sense, so i'll edit in what I wrote on the other thread where I was getting help.
Okay guys, let me explain again what is occuring. Basically using SPS does not work with using multiple maps. It tries to calc my player position based on the currently loaded map, in the example below you'll see that my playerpos at the end is 150,327. It then loads a NEW map and the starting position on the new map (which is directly on top of the ending position on the map) is picking my playerpos but it's detecting that the coordinates for that map are 193,153 not 150,327 even though its the same spot (I understand it's slightly different but not THAT different). That being said if you don't understand I encourage you to test it for yourself, you simply need to create your own map and copy the array path.
Notice the area is almost identical (center is close to identical as well obviously) note the positions in red though!
[ATTACH=CONFIG]25264[/ATTACH]
procedure Taverly2;
var
WTL2: TPointArray;
Taverly2: TSPSArea;
begin;
Taverly2.setup('WTL2',RUNESCAPE_OTHER,3,150,0.65); //WTL2 map
WTL2 := [Point(200, 133), Point(202, 166), Point(196, 217), Point(196, 262), Point(176, 287), Point(172, 298), Point(151, 316), Point(150, 327)];
if Taverly2.walkPath(WTL2) then
begin
wait (random(300,600));
minimap.waitPlayerMoving();
wait (random(300,600));
end
else
writeLn ('Failed to walk');
end;
procedure ActivateTaverly;
var
x, y, i: integer;
begin
if not isLoggedIn() then
exit
else
mainscreen.findObject(x, y, 5660509, 1, colorSetting(2, 1.86, 0.98), mainscreen.playerPoint, 20, 20, 1, ['averly', 'lodes'], MOUSE_LEFT);
wait(randomRange(7000, 10000));
mouse(point(288,211),MOUSE_LEFT);
end;
procedure Falador;
var
WTFalador: TPointArray;
Falador: TSPSArea;
begin;
Falador.setup('WTFalador',RUNESCAPE_OTHER,3,150,0.65);
WTFalador := [Point(193, 153), Point(214, 198), Point(215, 244), Point(238, 255), Point(270, 265), Point(295, 248), Point(332, 227), Point(353, 212), Point(361, 177)];
if Falador.walkPath(WTFalador) then
begin
wait (random(300,600));
minimap.waitPlayerMoving();
wait (random(300,600));
end
else
writeLn ('Failed to walk');
end;
Begin;
clearDebug();
smartEnableDrawing := true;
setupSRL();
if isloggedin() then
begin;
//lodestoneSetup;
//Taverly1;
Taverly2;
//ActivateTaverly;
Falador;
end
else
begin
createPlayer;
SkipTutorial;
interfaceSetup;
lodestoneSetup;
Taverly1;
Taverly2;
ActivateTaverly;
Falador;
end;
end. Edit 3: As a workaround I suppose I could make my maps extremely small and have a single map for each point to point interaction, albeit that's going to be 600 maps (probably not close but you get the point) and alot of effort. Any other ideas/workarounds? I think I could do as @Incurable; did and use a single huge map (he did it or I read a thread/post on it) and just have 2 second wait times which if that's the best route to take then so be it.
Edit 4: I have a crazy idea (
Edit 5: giving up for the night, that being said getplayerpos… does that come from the sps map? If so is there a way to force change it to detect your at location x,y and then start next map coords within that area? (edit this is haunting me can't even sleep back at it again trying to figure it out..)