Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prehit #146

Open
Leodinas opened this issue Jun 8, 2018 · 7 comments
Open

prehit #146

Leodinas opened this issue Jun 8, 2018 · 7 comments

Comments

@Leodinas
Copy link

Leodinas commented Jun 8, 2018

Prehit causes an attack animation error

@coruja747
Copy link
Collaborator

I did some tests here and confirmed

COMBAT_PREHIT breaks the anim because it will set swing delay = 0.1s, but the swing delay can't be faster than anim delay (0.7s) otherwise it will break the anim

anyway, combat swing is composed by:
swing start -> anim delay (0.7 sec) -> hit -> wait until next swing start (x.x sec)
and the only thing COMBAT_PREHIT does is reduce this anim delay 0.7s to 0.1s --only on first hit--, which doesn't seems to have any difference leave it enabled or disabled, both options are visually the same

as far I know, the COMBAT_PREHIT was created many yeas ago to avoid an old bug where ppl start the swing to put the target into war mode, then run some steps away to come back and make the target hit first, flagging the target as criminal instead the attacker. COMBAT_PREHIT was created to make the first attack hit instantly and avoid this. But today COMBAT_PREHIT is not needed anymore, you can use AttackingIsaCrime=1 to make the attacker criminal instantly just by starting the attack (even without hit)

so COMBAT_PREHIT doesn't cause any big changes on swing delay, doesn't fix nothing and it will also break the animation. Maybe the best solution for this problem is just disable this feature

@fjgo86
Copy link
Member

fjgo86 commented Jun 9, 2018

COMBAT_PREHIT was added years back as backwards compatibility, at some point the delay check was fucked on some version and people loved that pvp mode when you could charge your swing and land it when you get close (if you think of it, it's something you would do in real life, just have your weapon ready to hit when you approach your enemy), but it was not desired so they fixed it ... and people asked for it since players loved it, hence the flag was added back.

@coruja747
Copy link
Collaborator

my fault, I forgot this 2nd functionality of COMBAT_PREHIT to "pre-load" the swing and instantly hit (0.0s delay) when the target comes nearby

but anyway doing some quick tests, this 1st hit seems to be the same even with COMBAT_PREHIT enabled or disabled, because the current animation speed (0.7s) is faster than the old anim speed, so it already works like an "native COMBAT_PREHIT" (and its also more realistic give an fast swing instead hit instantly with 0.0s delay and no anim :P)

maybe COMBAT_PREHIT made some difference many years ago using the old (slow) anim speed, but today using the new (fast) anim speed I can't see any big difference. Can you do some tests to check this?

@Leodinas
Copy link
Author

Leodinas commented Jul 17, 2018

https://youtu.be/Vt_hjda6fXQ
attack hit npc or player , the animation is not complete!
client.exe 6061 sphere.exe Compiled: Jul 17 2018 (03:38:49) [build 643 / Git hash 95a32e7]

@Leodinas
Copy link
Author

Will it fix?

@coruja747
Copy link
Collaborator

yea as I said on previous post, this issue is confirmed. But the main question is: COMBAT_PREHIT will set the attack delay to 0ms, and setting this 0ms delay will also play the animation and immediatelly call the next swing action in 0ms, which will break the animation being played

so maybe the best fix is just disable COMBAT_PREHIT. I tested a quick combat using both COMBAT_PREHIT enabled and disabled, and both seems to be the same thing. So it makes more sense just remove COMBAT_PREHIT from source instead keep using it

you can disable COMBAT_PREHIT and get exactly the same 0ms result using this simple trigger:

ON=@HitTry
LOCAL.AnimDelay=0

but as I said, this makes the attack speed/anim too fast and will break the animation. Default value is 7ms, which is already fast and works perfectly. Any value lower than 7 will make the animation incomplete skipping some frames (0 will skip most frames and will break it completely, 6 will just skip some frames)

@Leodinas
Copy link
Author

Can it work like source X, but it will display an error animation when switching weapons, and it has not been fixed!
Would it be better if the two merged with each other?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants