• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[System] Knockback3D

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
Yes, this is a characteristic of the system that needs to be re-looked in general. I suggest just modifying the script to suit your needs for now, because I'm not really active right now.

It might be possible to change MAX_HEIGHT_DESTROY_DESTRUCTABLE so that all destructables are hit? I don't remember.
I removed the destructable feature completely, for performance reasons, so unfortunately, not possible for me. ;)
 
Level 18
Joined
Nov 21, 2012
Messages
835
Oh dear, I wanted to use this system but it bugs at map borders, I made few tests and it bugs with this settings:
call Knockback3D_add(udg_TUnit, 1500.00, udg_TReal, 0.20)
I run this with event 'Unit X takes a damage', TUnit is attacked , TReal is angle in radians between attacker and attacked units. Near map border knockbacked unit not falls down as it should, also next knockbacks /by attacking it/ are not applied :(
Cokemonkey11, is there a chance to fix the system?
 

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,516
Oh dear, I wanted to use this system but it bugs at map borders, I made few tests and it bugs with this settings:
call Knockback3D_add(udg_TUnit, 1500.00, udg_TReal, 0.20)
I run this with event 'Unit X takes a damage', TUnit is attacked , TReal is angle in radians between attacker and attacked units. Near map border knockbacked unit not falls down as it should, also next knockbacks /by attacking it/ are not applied :(
Cokemonkey11, is there a chance to fix the system?

If you have a demo map I can take a look eventually, but at this time this script should be considered community-maintained.
 

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,516
Thanks Cokemonkey11 ;] now works fine
I added private static boolean hitDestructable after
// End Customizable Section
had compile error, I belive accidentially removed?

Good shout, that was another bug, yes. Fixed!

Can I safely "destroy" knockback on my heroes by calling
call Knockback3D.setVel(udg_TUnit, 0.00, 0.00, 0.00)

Yes you can, but two things to note:

* if the unit is in midair when you reset its velocity this way, it will stop and then accelerate downwards. If you want it to be removed from the system, you'll have to reset its flying height as well.
* If you have lots of units in your map all being knocked back at once, calling setVel might be expensive.
 
Level 7
Joined
Feb 9, 2021
Messages
301
Probably the author of the system is not active anymore. However, I noticed a couple of things:
1. When the KB is applied to a flying unit, it does not return to its previous height after fall
2. Flying units get too much KB compared to non flying
 
Level 23
Joined
Jan 1, 2009
Messages
1,608
Probably the author of the system is not active anymore. However, I noticed a couple of things:
1. When the KB is applied to a flying unit, it does not return to its previous height after fall
2. Flying units get too much KB compared to non flying
The wurst version of this package is part of the stdlib for some time and the latest version including these fixes can be found here wurstscript/WurstStdlib2
 
Level 7
Joined
Feb 9, 2021
Messages
301
The wurst version of this package is part of the stdlib for some time and the latest version including these fixes can be found here wurstscript/WurstStdlib2
Thanks for letting me know. My map is in vJass. Will i be able to use Wurst lib with my vJass code? I am asking not only because I want to to use this system, but because I am considering switching to Wurst. Also, does Wurst work for 1.26?

Also, the system now just has a filter for not selecting flying units... This does not fix the problem.
 
Last edited:
Level 7
Joined
Feb 9, 2021
Messages
301
Well that goes for the fact that 3D knockback on air units doesn't really make sense eh?
Why?

If there is an explosion, flying units will be similarly KBed. Also, in the situation where KB source is above flying units, the KB will send them down.

Maybe I don't get something. If so, it would be great if you could explain this to me.
 
Last edited:

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,516
@maxodors for advice on using wurst i recommend joining the wurst matrix chat channel

As to why we ignore flying units in kb3, check [knockback3] knockback3 ignore air units by default by Cokemonkey11 · Pull Request #387 · wurstscript/WurstStdlib2 for some notes. It would be nice to have a behavior that doesn't just ignore them but at this time it doesn't make sense to add an entire code path for that. Ideally a future wc3 patch would improve some blizzard natives so that flying units could be handled more nicely
 
Top