Stuck at attacking monster

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderators: Moderators, Developers

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Stuck at attacking monster

#1 Post by sofax222 »

I found a stuck problem.
After searching as targeting on some one monster to attack, the char stucks !
The char just stop walking to approach the monster that is targeted....
Then I trace the code in src/AI/Attack.pm. I found some one code line,
in the "sub main".
The original code line is :

Code: Select all

.......
   } elsif ($realMonsterDist > $args->{attackMethod}{maxDistance}
     && timeOut($args->{ai_attack_giveup}, 0.5)) {
      # The target monster moved; move to target
      $args->{move_start} = time;
      $args->{monsterPos} = {%{$monsterPos}};
.......
I do not know what the "timeOut($args->{ai_attack_giveup}, 0.5)" mean is !?
It seems to be check the attacking give up time out, but what is the "0.5" ?
So. I change to:

Code: Select all

.......
   } elsif ($realMonsterDist > $args->{attackMethod}{maxDistance}
     && !timeOut($args->{ai_attack_giveup})) {
      # The target monster moved; move to target
      $args->{move_start} = time;
      $args->{monsterPos} = {%{$monsterPos}};
.......
And then my char never stuck on attacking !

I update to SVN 7695
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Stuck at attacking monster

#2 Post by EternalHarvest »

Code: Select all

I do not know what the "timeOut($args->{ai_attack_giveup}, 0.5)" mean is !?
It seems to be check the attacking give up time out, but what is the "0.5" ?
With one argument, timeOut uses "time" and "timeout" keys from a hash.
With two arguments, it uses them for time and timeout.

It probably should be:

Code: Select all

timeOut($args->{ai_attack_giveup}{time}, 0.5)
as default timeout for ai_attack_giveup is quite different.

The same issue exists in homunculus AI (src/AI/Slave.pm).
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Stuck at attacking monster

#3 Post by kLabMouse »

Please Fix both (AttackAI and SlaveAI). so the TimeOut is checked.
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Stuck at attacking monster

#4 Post by sofax222 »

kLabMouse wrote:Please Fix both (AttackAI and SlaveAI). so the TimeOut is checked.
Ok, I will find the same issue exists in homunculus AI (src/AI/Slave.pm).
And, Fix it as soon ass possible !
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Stuck at attacking monster

#5 Post by kLabMouse »

sofax222 wrote:
kLabMouse wrote:Please Fix both (AttackAI and SlaveAI). so the TimeOut is checked.
Ok, I will find the same issue exists in homunculus AI (src/AI/Slave.pm).
And, Fix it as soon ass possible !
Oh. Yeah. You have Access to SVN. So use it. It's RLY Easy to use with Turtoise SVN.
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Stuck at attacking monster

#6 Post by sofax222 »

I alreay update the src/AI/Slave.pm with the same problem !
It is in SVN 7698
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Stuck at attacking monster

#7 Post by kLabMouse »

Moved to Fixed Bug's.
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Stuck at attacking monster

#8 Post by sofax222 »

kLabMouse wrote:Moved to Fixed Bug's.
What action sholud I select to submit ?
Which posts should I selected to submit, all ?
User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Stuck at attacking monster

#9 Post by kLabMouse »

sofax222 wrote:
kLabMouse wrote:Moved to Fixed Bug's.
What action sholud I select to submit ?
Which posts should I selected to submit, all ?
I use "Quick-mod tools: Move Topic" and un-mark "Leave shadow topic in place" when moving topic.
If you don't have the "Quick-mod tools", just ask. I'll add them to you.
sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Stuck at attacking monster

#10 Post by sofax222 »

kLabMouse wrote:
sofax222 wrote:
kLabMouse wrote:Moved to Fixed Bug's.
What action sholud I select to submit ?
Which posts should I selected to submit, all ?
I use "Quick-mod tools: Move Topic" and un-mark "Leave shadow topic in place" when moving topic.
If you don't have the "Quick-mod tools", just ask. I'll add them to you.
Where is the "Quick-mod tools" should be shown ?
I can not find it !
So, I has no this function !?