Hello at all, I got a strange bug which I can't seem to solve.
When a player start to do some sparring with another mobile (player/npc), after some minute it is correctly attacking it suddenly lose the target.
The attacking player remain in war mode, but the attack target is lost.
Enabling debug mode, I see (for example)
"set_opponent(0x123456, 0x000000)"
just after the player lose target.
I swear that it isn't required to do anything to make this happen.
I am using pol release 096.
I would like to ask what can cause the POL to change the player target without any action actually happening. There is some system event which do this?
Thank you
Xeon
Player lose attack target after some minute
Re: Player lose attack target after some minute
Well, I've done some investigation.
Premise: my combat is using the "Attack" syshook, which return always "1".
As stated in the POL 096 changelog, if this syshook return 0 the POL core handle the attack by itself, otherwise it don't do anything.
It seems that the POL core do something to it interval variables that, using the Attack syshook, it don't do.
I will explain with some server log.
These are the ones using the attack syshook:
Client#15: message 0x5
set_opponent(0x08581b28,0x0855f338)
reset_swing_timer(0x08581b28)
schedule_attack(0x08581b28)
clocks[speed] = (100*15000)/((50+100)*40)
clocks=250
reset_swing_timer(0x0855f338)
schedule_attack(0x0855f338)
clocks[speed] = (100*15000)/((100+100)*40)
clocks=187
Client#15: message 0xbf
Client#15: message 0x34
Client#11: message 0xbf
Client#11: message 0x34
swing_task_func(0x0855f338)
get_attackable_opponent(0x0855f338): checking opponent_of, 0x08581b28
check_attack_after_move(0x0855f338): opponent is 0000000000
swing_task_func(0x08581b28)
get_attackable_opponent(0x08581b28): checking opponent, 0x0855f338
check_attack_after_move(0x08581b28): opponent is 0000000000
These are the logs without it, or having it returning a 0:
Client#3: message 0x5
set_opponent(0x08581cc8,0x0855da98)
reset_swing_timer(0x08581cc8)
schedule_attack(0x08581cc8)
clocks[speed] = (100*15000)/((51+100)*46)
clocks=215
reset_swing_timer(0x0855da98)
schedule_attack(0x0855da98)
clocks[speed] = (100*15000)/((100+100)*40)
clocks=187
Client#3: message 0x34
Client#5: message 0xbf
Client#5: message 0x34
swing_task_func(0x0855da98)
get_attackable_opponent(0x0855da98): checking opponent_of, 0x08581cc8
check_attack_after_move(0x0855da98): opponent is 0000000000
swing_task_func(0x08581cc8)
get_attackable_opponent(0x08581cc8): checking opponent, 0x0855da98
check_attack_after_move(0x08581cc8): opponent is 0x0855da98
If you look at the underlined lines, you can see that when the POL core don't handle the attack it don't set in its memory the target of the player. If its combat core run, the player target is set.
Apart from upgrading the POL core...there is something I can script in my syshook to make the POL memorize the player target?
Premise: my combat is using the "Attack" syshook, which return always "1".
As stated in the POL 096 changelog, if this syshook return 0 the POL core handle the attack by itself, otherwise it don't do anything.
It seems that the POL core do something to it interval variables that, using the Attack syshook, it don't do.
I will explain with some server log.
These are the ones using the attack syshook:
Client#15: message 0x5
set_opponent(0x08581b28,0x0855f338)
reset_swing_timer(0x08581b28)
schedule_attack(0x08581b28)
clocks[speed] = (100*15000)/((50+100)*40)
clocks=250
reset_swing_timer(0x0855f338)
schedule_attack(0x0855f338)
clocks[speed] = (100*15000)/((100+100)*40)
clocks=187
Client#15: message 0xbf
Client#15: message 0x34
Client#11: message 0xbf
Client#11: message 0x34
swing_task_func(0x0855f338)
get_attackable_opponent(0x0855f338): checking opponent_of, 0x08581b28
check_attack_after_move(0x0855f338): opponent is 0000000000
swing_task_func(0x08581b28)
get_attackable_opponent(0x08581b28): checking opponent, 0x0855f338
check_attack_after_move(0x08581b28): opponent is 0000000000
These are the logs without it, or having it returning a 0:
Client#3: message 0x5
set_opponent(0x08581cc8,0x0855da98)
reset_swing_timer(0x08581cc8)
schedule_attack(0x08581cc8)
clocks[speed] = (100*15000)/((51+100)*46)
clocks=215
reset_swing_timer(0x0855da98)
schedule_attack(0x0855da98)
clocks[speed] = (100*15000)/((100+100)*40)
clocks=187
Client#3: message 0x34
Client#5: message 0xbf
Client#5: message 0x34
swing_task_func(0x0855da98)
get_attackable_opponent(0x0855da98): checking opponent_of, 0x08581cc8
check_attack_after_move(0x0855da98): opponent is 0000000000
swing_task_func(0x08581cc8)
get_attackable_opponent(0x08581cc8): checking opponent, 0x0855da98
check_attack_after_move(0x08581cc8): opponent is 0x0855da98
If you look at the underlined lines, you can see that when the POL core don't handle the attack it don't set in its memory the target of the player. If its combat core run, the player target is set.
Apart from upgrading the POL core...there is something I can script in my syshook to make the POL memorize the player target?
Re: Player lose attack target after some minute
Well, bug fixed.
...
In the "Attack" syshook, I put
...
...
In the "Attack" syshook, I put
Code: Select all
SetScriptController(parms.attacker);...
Re: Player lose attack target after some minute
It's called auto-education
. Hehe