When trying to move from aldebaran(or any other available place) to 'bat_room 169 223' (KVM chatroom - blue), the bot will move all the way to 'bat_room 165 166' (right in front of the npc), and even though the npc which is meant to warp the bot into the chat room is visible through 'nl', the bot won't talk to him, nor show any error message. Nothing happens.
However, if I manually move to 'bat_room 165 170' (which is a few cells closer to the npc than 165 166), and then do 'move bat_room 169 223', the bot will talk to the npc, as it is meant to do, since he's the one to warp him to its destination, as specified in portals.txt.
Making it short:
'move bat_room 169 223' makes the bot stop at a distance so far that he won't talk to the npc. BUT, standing at this same position, you can talk and warp yourself into the room using 'talknpc' command. This makes me think there's nothing wrong with npc/talknpc/char.
I was wondering if there is any way to set the distance/coordinates at which the bot stops before talking to the npc at 164 178, which is the one to warp him into the chatroom. Any thoughts?
Don't know if this is relevant, but the npc's coordinates (164 178) are unreacheble.
I know I could easily solve this with a 1-line macro, but I was looking for a better solution.
can't warp through npc with 'move' command
Moderators: Moderators, Developers
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: can't warp through npc with 'move' command
Code: Select all
Task::Route->getRoute(\@solution, $field, $self->{actor}{pos_to}, $self->{mapSolution}[0]{pos})
Then, before talking with NPC, it checks again if we're at 10 distance:
Code: Select all
distance($self->{actor}{pos_to}, $self->{mapSolution}[0]{pos}) <= 10
It should be changed to decrease distFromGoal in
Code: Select all
my $task = new Task::Route()
Something like that:
Code: Select all
--- src/Task/MapRoute.pm (revision 8196)
+++ src/Task/MapRoute.pm (working copy)
@@ -208,7 +208,7 @@
x => $self->{mapSolution}[0]{pos}{x},
y => $self->{mapSolution}[0]{pos}{y},
maxTime => $self->{maxTime},
- distFromGoal => 10,
+ distFromGoal => 10 - distance($self->{mapSolution}[0]{pos}, $solution[-1]),
avoidWalls => $self->{avoidWalls},
solution => \@solution
);
Re: can't warp through npc with 'move' command
thank you so much. it worked perfectly. should it be commited?
-
- Developers
- Posts: 1798
- Joined: 05 Dec 2008, 05:42
- Noob?: Yes
Re: can't warp through npc with 'move' command
Test what will happen with negative distFromGoal and commit if everything is fine.