openkore
openkore copied to clipboard
OpenKore cannot teleport through an NPC if it is behind a wall
------------------ Openkore Issues Template ------------------
- Openkore version git: last
- Server: RMS Renewal Test Server
- Bug Report / Feature Request: OpenKore cannot teleport through an NPC if it is behind a wall
-
Summary: we have the following portal-NPC:
new_1-4 100 29 moc_ruins 155 44 0 c c c c c r0 c c c c r1 r0 r0 r0 r1 r1 c c r0 c r0 c r0 c r1 c c r0 c r1 c r1 c r1 c c r2 c r2 c r2 c r0 c r2 c r2 c r0 c r1 c c c c c c c c c c r0 c c c c c c c c
OpenKore cannot calculate the path from new_1-4 to moc_ruins openkore cannot calculate the path from location 1 to location 2 because the NPC is hiding behind the table:
Use this macro to check for defect:
macro test {
do c @warp new_1-4 100 19
pause 3
do debug 2
do move moc_ruins 155 44
do debug 0
}
console logs:
macro test
Map Change: new_1-4.gat (100, 19)
Warped.
NPC Exists: Final Tester#nv1 (100, 29) (ID 110014979) - (0)
Config 'debug' set to 2 (was 0)
Saving control\config.txt...
AI: macro sitAuto sitting | 3
Calculating route to: Morocc Ruins(moc_ruins): 155, 44
You on route to: Morocc Ruins(moc_ruins): 155, 44
CalcMapRoute - initialized.
CalcMapRoute failed.
Cannot calculate a route from new_1-4 (100,19) to moc_ruins (155,44)
Config 'debug' set to 0 (was 2)
It is a old issue, it also can't teleport in mosk fields https://forums.openkore.com/viewtopic.php?t=14631 Bot can't talk to unreachable npcs
https://forums.openkore.com/viewtopic.php?p=54026#p54026
One more problematic place.
macro test {
do c @warp monk_test 260 125
pause 3
do debug 2
do move monk_test 314 134
do debug 0
}
The portal is outside the map border
maybe add a flag in portals.txt and in config keys related to npc ?
This behavior should be automatic for all NPCs. OpenKore should build a route to the NPC if there is a free cell within "clientSight 15"
This behavior should be automatic for all NPCs. OpenKore should build a route to the NPC if there is a free cell within "clientSight 15"
so auto walk to the npc closest cell in range of clientSight
me, long time ago :
- if npc exist on the screen, why move closer?
- why 10 blocks?
me, long time ago :
- if npc exist on the screen, why move closer?
- why 10 blocks?
Portals are also npcs, so need to move closer
portals ; npcs , they use different code inside MapRoute.pm
my old openkore change this line
} elsif (distance($self->{actor}{pos_to}, $self->{mapSolution}[0]{pos}) <= $dist) {
to something like this
} elsif ((distance($self->{actor}{pos_to}, $self->{mapSolution}[0]{pos}) <= $dist) || (List::MoreUtils::any { $_->{pos}{x} == $self->{mapSolution}[0]{pos}{x} && $_->{pos}{y} == $self->{mapSolution}[0]{pos}{y} } @{$::npcsList->getItems})) {
than change the 10 blocks spot to random spots
for portal outside map ... editing the field is easier?
add to portals:
mosk_fild02 198 53 moscovia 140 54 c r0
macro:
macro test {
do c @warp mosk_fild02 202 58
pause 3
do debug 2
do move moscovia
do debug 0
}
Change this in src/Task/Route.pm:
from:
my $closest_dest = $field->closestWalkableSpot(\%dest, 1);
to:
my $closest_dest = $field->closestWalkableSpot(\%dest, 10);
results:
Novice Grounds:
Monk Test:
Moscovia: