Normal Attack = Knockback, How?

L

Lyserg

Guest
Hi. Well, I wanted to make normal attack do a knockback (for unit owned by player and also creeps) , so I tried to do it like this:

Code:
Events:

-Map Initialization


Conditions:

-


Actions:

Set Attacker = (Attacking unit)

Set AttackedOne = (Attacked unit)

Set PointOfAttacker = (Attacker)

And then

Code:
Events:

Unit - A unit is attacked


Conditions:

(Attacked Unit) equal to AttackedOne


Actions:

Special Effect - Create a special effect attached to the origin of AttackedOne using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl

Unit - Move AttackedOne instantly to (PointOfAttacker offset by ((Distance between PointOfAttacker and (Position Of AttackedOne)) + 5.00) towards (Angle from PointOfAttacker to (Position of AttackedOne)) degrees)

Well, that's that, its not working nor did i expect it to work, im new at this, but could you help me to make it work? tnx in advance ^_^
 

BlackRose

Forum User
Reaction score
239
There is no value in AttackedOne because you set it at Initiatlization.... so therefore it doesn't do anything, null unit.
 
L

Lyserg

Guest
So, i should just set it to be Time - Time Elapsed action or? What should I do to make it work?
 

BlackRose

Forum User
Reaction score
239
Well, what what are you doing? Is it a skill? Is it chance? Like Bash, (if not, you would probably kill anything easily 1 on 1).
 
L

Lyserg

Guest
Actually, i want every attack to do it...i always thought its dumb that units are just standing in one spot and pwning each other...there should always be a little knock back, like when u punch someone in the face and that person gets knocked back...its actually for an rpg map, i want combat to be fast and fun, not just stand in one spot and attack and as I said, its not just for players, creeps would knock back too...knock back gives a feeling that battle is really happening, makes it alive...i considered doing it as a critical, but i first want to see how will it work like this...
 

BlackRose

Forum User
Reaction score
239
Notes:
+Unit is Attacked, it happens before they even take damage.
+That would be hard to do, every thing knockback. Warcraft III is not like that.
 
L

Lyserg

Guest
I guess i'll do it as a critical then... :|

EDIT:
Just tell me, since critical strike is passive, i can't really do condition as "Ability being cast equal to critical strike" right? so...how should I do it?
 

k0sA

New Member
Reaction score
9
Put your first functions to the beginning of the second function ;)

Code:
Set Attacker = (Attacking unit)

Set AttackedOne = (Attacked unit)

Set PointOfAttacker = (Attacker)

Special Effect - Create a special effect attached to the origin of AttackedOne using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl

Unit - Move AttackedOne instantly to (PointOfAttacker offset by ((Distance between PointOfAttacker and (Position Of AttackedOne)) + 5.00) towards (Angle from PointOfAttacker to (Position of AttackedOne)) degrees
 
L

Lyserg

Guest
Oook, it works now, BUT its totally different than i imagined...its like they're switching places, warping...i don't know. I attached the map, download and see for yourself...
 

Attachments

  • knock.w3x
    17.3 KB · Views: 171

Charapanga

New Member
Reaction score
46
Code:
Events
A unit is attacked
Conditions NONE
Actions
Set attacked one = Attacked unit
Set attacking one = attacking unit
Set attacked one point = position of Attacked one
Set attacking one point = position of attacking one
turn on trigger 2
wait 1 second
turn off trigger 2
Trigger 2...
Code:
event
Every 0.03 seconds 
Conditions none
actions move attacked one instantly to attacked one point offset by -5 towards angle between attacked one point and attacking one point degrees

it's freehand, just do triggers like this and you'll be fine

EDIT: Trigger 2 should be initially off
 
L

Lyserg

Guest
Much better now, but still it doesn't really knock him back, it moves him back instantly just as the action says...is there any way to do a sliding knockback...? if you know what I mean, if not, how could i do it for a critical strike, I tried with event: skill is being casted, condition: skill being cast equal to critical strike, and then the knock back triggers for actions, but its not working at all, sorry for the trouble :|

EDIT: ah, i see you mentioned slide while i was posting. No, it doesn't slide, it just teleports him back...it looks cool, but it would be MUCH better with actual sliding...
 

Samael88

Evil always finds a way
Reaction score
181
Do you want it so that the unit has an item to be able to nockback?
Should it only affect one type of unit?
Should it only affect a single unit?
Should it be only on normal attack?
Give correct and specific answers for this and I will alter my premade really simple nockback to fit you need:thup:

Edit:
Code:
actions move attacked one instantly to attacked one point offset by [B]-5[/B] towards angle between attacked one point and attacking one point degrees
That will move him backwards for 5 distance.
This may work better:
Code:
actions move attacked one instantly to attacked one point offset by [B]5[/B] towards angle between [B]attacking one[/B] point and [B]attacked one[/B] point degrees
 
L

Lyserg

Guest
Hm, yeah, it sure is sliding, I tried your tirgger you wrote on post before, but its not sliding for a normal attack, maybe I did something wrong, I uploaded now with this what i've did...so can you please check it out and fix the mistakes so that sliding works? :x
 

Attachments

  • knock.w3x
    17.4 KB · Views: 177
L

Lyserg

Guest
Amazing! Exactly what I wanted, tnx! :3 just a quick question, is there a way to get rid of stopping of unit when its attacked and knocked back? im sure you noticed that :]
 

Charapanga

New Member
Reaction score
46
Amazing! Exactly what I wanted, tnx! :3 just a quick question, is there a way to get rid of stopping of unit when its attacked and knocked back? im sure you noticed that :]

Whenever it's forcefully moving it's animation is stopping and since he is taking time to swing and his animation is stopping every 0.03 seconds he will never finish the swing, it's either slide or warp, both have same effect on attacks...
 
L

Lyserg

Guest
I see. Well, thanks a lots, this is great, wanted to show you, but don't want to upload anymore, make an illidan your hero and change his attack speed to max, leave that other blue footman, start the map and start pwning footman, it looks so amazing! I guess it will all be about speed in my map, i'll have to add some special skill for avoiding range attacks, only for melee heroes. Also don't forget to add the dust effect to origin...its so awesome now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top