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: 170

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: 175
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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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