Openkore.com

OpenKore Forums
It is currently 29 Jul 2014, 21:04

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Follow Slave Detect Wrong Map Name to find Master
PostPosted: 13 Oct 2011, 00:15 
Offline
Noob
Noob

Joined: 31 Mar 2011, 22:35
Posts: 12
I try to go castle dungeon with using master bot and slave bot at town (yuno).
Then i try enter castle yuno schg_cas05 at Master bot, but the slave detect Master bot at
schg_cas01.
I type in console "Party" in slave bot, and comfirm the list of map for Master bot is schg_cas05 but which when "Calculating route to find master: schg_cas01" is running?


Top
 Profile  
 
 Post subject: Re: Follow Slave Detect Wrong Map Name to find Master
PostPosted: 22 Oct 2011, 19:46 
Offline
Plain Yogurt
Plain Yogurt

Joined: 09 Sep 2011, 18:04
Posts: 59
Location: Malaysia
Mr_M wrote:
I try to go castle dungeon with using master bot and slave bot at town (yuno).
Then i try enter castle yuno schg_cas05 at Master bot, but the slave detect Master bot at
schg_cas01.
I type in console "Party" in slave bot, and comfirm the list of map for Master bot is schg_cas05 but which when "Calculating route to find master: schg_cas01" is running?



Try This Bro:

follow 1
followTarget <<< Put Master name Char Here
followEmotion 1
followEmotion_distance 4
followFaceDirection 0
followDistanceMax 1
followDistanceMin 1
followLostStep 12
followSitAuto
followBot 1

itemsTakeAuto 2
itemsTakeAuto_party 0
itemsGatherAuto 2
itemsMaxWeight 49
itemsMaxWeight_sellOrStore 48
itemsMaxNum_sellOrStore 99
cartMaxWeight 7900
itemsTakeAuto_new 0


lockMap ra_fild12 << make sure u master and u slave same map
lockMap_x
lockMap_y
lockMap_randX
lockMap_randY


my english is bad .. sorry hope this can help u


Top
 Profile  
 
 Post subject: Re: Follow Slave Detect Wrong Map Name to find Master
PostPosted: 02 Nov 2011, 01:08 
Offline
Noob
Noob

Joined: 31 Mar 2011, 22:35
Posts: 12
Thanks for propose solution, but the main bug still exist.
I have look into the src code, i think the bug come from map_aliase function that when detect Masterbot at different map. Slave bot will pass map_aliase name to itself instead pass the actual map name.
I try to modify the source on AI.pm to get actual solution.
Need some guide on this source code.
scr\AI.pm
Code:
sub ai_partyfollow {
   # we have to enable re-calc of route based on master's possition regulary, even when it is
   # on route and move, otherwise we have finaly moved to the possition and found that the master
   # already teleported to another side of the map.

   # This however will give problem on few seq such as storageAuto as 'move' and 'route' might
   # be triggered to move to the NPC

   my %master;
   $master{id} = main::findPartyUserID($config{followTarget});
   if ($master{id} ne "" && !AI::inQueue("storageAuto","storageGet","sellAuto","buyAuto")) {

      $master{x} = $char->{party}{users}{$master{id}}{pos}{x};
      $master{y} = $char->{party}{users}{$master{id}}{pos}{y};
      ($master{map}) = $char->{party}{users}{$master{id}}{map} =~ /([\s\S]*)\.gat/;

      if ($master{map} ne $field->name || $master{x} == 0 || $master{y} == 0) { # Compare including InstanceID
         delete $master{x};
         delete $master{y};
      }

      return unless ($master{map} ne $field->name || exists $master{x}); # Compare including InstanceID

      # Compare map names including InstanceID
      if ((exists $ai_v{master} && distance(\%master, $ai_v{master}) > 15)
         || $master{map} != $ai_v{master}{map}
         || (timeOut($ai_v{master}{time}, 15) && distance(\%master, $char->{pos_to}) > $config{followDistanceMax})) {

         $ai_v{master}{x} = $master{x};
         $ai_v{master}{y} = $master{y};
         $ai_v{master}{map} = $master{map};
         ($ai_v{master}{map_name}, undef) = Field::nameToBaseName(undef, $master{map}); # Hack to clean up InstanceID
         $ai_v{master}{time} = time;

         if ($ai_v{master}{map} ne $field->name) {
            message TF("Calculating route to find master: %s\n", $ai_v{master}{map}), "follow";
         } elsif (distance(\%master, $char->{pos_to}) > $config{followDistanceMax} ) {
            message TF("Calculating route to find master: %s (%s,%s)\n", $ai_v{master}{map_name}, $ai_v{master}{x}, $ai_v{master}{y}), "follow";
         } else {
            return;
         }

         AI::clear("move", "route", "mapRoute");
         ai_route($ai_v{master}{map_name}, $ai_v{master}{x}, $ai_v{master}{y}, distFromGoal => $config{followDistanceMin});

         my $followIndex = AI::findAction("follow");
         if (defined $followIndex) {
            $ai_seq_args[$followIndex]{ai_follow_lost_end}{timeout} = $timeout{ai_follow_lost_end}{timeout};
         }
      }
   }
}


I have change the value at this line
Code:
         if ($ai_v{master}{map} ne $field->name) {
            message TF("Calculating route to find master: %s\n", $ai_v{master}{map_name}), "follow";

to
Code:
         if ($ai_v{master}{map} ne $field->name) {
            message TF("Calculating route to find master: %s\n", $ai_v{master}{map}), "follow";


then it display correct map to route, but why it still route to alliase map instead actual map?


Top
 Profile  
 
 Post subject: Re: Follow Slave Detect Wrong Map Name to find Master
PostPosted: 02 Nov 2011, 08:18 
Offline
Developers
Developers

Joined: 05 Dec 2008, 05:42
Posts: 1874
Aliases and instances support is buggy, maybe it's because of that.


Top
 Profile  
 
 Post subject: Re: Follow Slave Detect Wrong Map Name to find Master
PostPosted: 02 Nov 2011, 22:38 
Offline
Noob
Noob

Joined: 31 Mar 2011, 22:35
Posts: 12
EternalHarvest wrote:
Aliases and instances support is buggy, maybe it's because of that.

Yup, agree with that.
Would it be nice if sub ai_partyfollow will split into 3 type of route condition?
1st normal map routing
2nd Alliase map routing
3rd Instance map routing

Somehow i am not good in writing the code, but i hope to get help on writing this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[ Time : 0.057s | 17 Queries | GZIP : On ]