• 🏆 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!

Knockback Unit

Level 13
Joined
Nov 22, 2006
Messages
1,260
lol, i'm glad this function didn't have any major bugs, i was kinda expecting that someone will report something already, i guess i'm just lucky :D (with a lot of previous help from you guys)

i MAY try to modify it a bit, look at your posts etc, but i didn't do jass for a long time now, i have to get into track again :D
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
I also have one thing to mention here ;)
It is actually the same efficiency thing as with your Jump System,
You create a unit for every Destructable you kill (you check for it to be a tree),,
Just do as you did with the Jump sys there, a global unit, and move it
(Dont forget to order it to stop again,,)

EDIT:
I have seen this before, and it is kinda strange to me:
JASS:
set Total = Total + 1
set Ar[Total - 1] = dat

Just flip those two, and remove the -1 from the (now) second line,,
I though you already knew that =P
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I also have one thing to mention here ;)
It is actually the same efficiency thing as with your Jump System,
You create a unit for every Destructable you kill (you check for it to be a tree),,
Just do as you did with the Jump sys there, a global unit, and move it
(Dont forget to order it to stop again,,)

EDIT:
I have seen this before, and it is kinda strange to me:
JASS:
set Total = Total + 1
set Ar[Total - 1] = dat

Just flip those two, and remove the -1 from the (now) second line,,
I though you already knew that =P

Thanks for the help, but I don't feel like editing this anymore. There are much better knockback systems on wc3c or thehelper. The jump function, however, isn't so common.

Yeah, someone already pointed out that calculation thing, but I didn't fix it because I think there was something wrong with that, however, I can't remember what. Also, it's not really a problem.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
you are creating a new rect every time you check for trees
you are creating a new unit every time you check if that dest is a tree
SetUnitX/Y will knock units into environment and make them stuck there
(better use some item to check pathing there first)
IsTerrainPathable is crap because it does not detect trees since they are placed after blizzard ran its crappy path mapping stuff or something
GetLocationZ has the ability to desync.
if you use it wrong
e.g. if you are using thunder clap (don't know if it was this special effect but might be) the terrain will not be deformed with special graphic setting and therefore GetLocationZ will return a different value
but you should not use terrain deforming special effects any way since they can cause lag in multi player maps with mass doodads and players and units in certain cases
however GetLocationZ is obsolete for path checking since there is some item trick
(i wrote a tutorial about it :)
(not really finished yet bout it soon will be)
 
Top