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

Status
Not open for further replies.
Level 4
Joined
Apr 2, 2008
Messages
65
can someone please just tell me exactly what to do to add knock back to my spell. Okay my spell is bassically a buff that gives a unit more dmg that lasts for 5 seconds and once it hits a target the buff is gone and i want to make knock back to the spell once it hits an opponent. ill give rep if u tell me :D

Thank You To Those Who Will Help Me
 
Level 4
Joined
Apr 2, 2008
Messages
65
then what do i do in jass? i still dont know how to make the knock back in jass if you tell me how to do it in jass i will still be happy, i mean how can you learn how to do knock back with my small knowledge of jass? i need some help and experience first, then i can start doing it all on my own. AND YES i have looked at tutorials and have jass craft
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Do you have any experience with programming ?
Do you know vJass ?
Use JNGP (Jass New Gen Pack) instead of JassCraft, its much better.
Do you know how to use Handlevars or any other script to move locals from function to function ? (in case you don't know vJass)
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
To GhostWolf: Questions are not the solution and don't force people to learn the stuff you want.

To ReGnerA: Knockback in GUI isn't a big deal, well, you should do it with a attack detection trigger which triggers only when the attacking unit has the buff, then a timer starts with 0.01 or 0.02 (0.02 lags less), you should take the real, the position and a extra position in the attack detection time, you set the position to the position of the attacked unit and the facing of the attacked in the real, each time the timer expires you set the extra position to the position with a polar offset ( maybe 3 diameter away from the current location of the attacked unit) and use the facing calculated by -180* and then you move the attacked unit to the extra position, then destroy the loaction, this loops through to move the unit constantly to make it look like a slide. Maybe you want to build in a real which counts the current knock back distance and a if then else which triggers at a certain distance knocked back and stops the knock by stopping the timer.

Problem is just, that is not MUI. So just useable by one unit at the same time.
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
well, one thing that could make it easier for everyone to help you is

do you want the Knockback to be instant or overtime? Do you want the unit to instantly move backwards or being pushed a little bit all the time until he reaches the position?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
To GhostWolf: Questions are not the solution and don't force people to learn the stuff you want.

If I or any other person make a code for someone, I would want him to actually understand it and not use it blindly, because if he does, the next time he will need something similar he will need help again.

Problem is just, that is not MUI. So just useable by one unit at the same time.
If you want a MUI knock back you must use Jass.

Mind to explain how exactly a knock back that isn't even MPI help ?

do you want the Knockback to be instant or overtime? Do you want the unit to instantly move backwards

Do people even call that a knock back ? :<
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Well, I dunno what a map he creates, for a Hero AoS it is good enough to make single working spells, and I think you could make my Knock Back Idea mui with a behind each variable a array which equals to the Player Number of the current Player. So it should work i think.

The reason to help those people is just for being friendly and helpful, and i think thats what the hive community lost, so i try to wake it up as good as i can.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Also what's the reason for us to help someone that is new and with 2 posts.

If you help people for the rep, please leave the hive and go live on a long lost island :<

Well, I dunno what a map he creates, for a Hero AoS it is good enough to make single working spells, and I think you could make my Knock Back Idea mui with a behind each variable a array which equals to the Player Number of the current Player. So it should work i think.

It will be MPI (one unit per player) and that is fine with most maps.
 
Level 4
Joined
Apr 2, 2008
Messages
65
okay i introduced myself; and also redscore okay so all i got right now is

event:a unit is attacked

condition:attacking unit equal to Unit (cutom unit variable)
attacking unit has buff equal to roar

actions: For each [interger A]from 1 to X amount, do Actions
Loop- Actions
Wait for .02 seconds
(this is the part where u make extra spot which i dont know how to do lol) then make unit move instantly to the extra spot by polar offset of 3 by -180 degrees to the extra spot ( i dont know how to do this part)
 
Last edited:
Level 13
Joined
Mar 16, 2008
Messages
941
Your first 'extraspot' is 'Position of (Knocked Unit)'.
Your second 'extraspot' is a 'PolarProjectionBJ' with your First spot as start, a distance (I recommend more then 3 or it will be veeeeery slow, 150 per second is nothing) and an angle. The angle is 'Angle between units', of your attacker and the knocked unit, you should store it in a variable at the start or your attacker can move and control the unit :p

Don't forget to use variables also for locations, or it will leak horrible (100 points per second x.x)

For sure that isn't even MPI, if you want so you have to use a timer
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • You don't need to null globals.
  • You don't need to create a special effect variable.
  • Where is the slowing down part ?
  • This isn't even MPI.
  • Why are you setting KnockDistance if its value is 0 ?
  • A timer with 0.01 expiration value is laggy. People usually use 0.04.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
  • You don't need to null globals.
  • You don't need to create a special effect variable.
  • Where is the slowing down part ?
  • This isn't even MPI.
  • Why are you setting KnockDistance if its value is 0 ?
  • A timer with 0.01 expiration value is laggy. People usually use 0.04.

GhostWolf is actually right about this. There is no need to null global variables. Also, 0.01 is a really really fast refresh rate ( 100 FPS ). I'd suggest using 0.03 ( 33.33 FPS, barely noticeable difference ). About the rest, I didn't actually look at the code, but I'd suppose that GhostWolf was right about it too.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
People do have their own will, yes, but people usually prefer good things over shitty things. If you cannot accept that, then you are retarded.

There's always time to learn some easy Jass syntax. But if you say so, master, I will leave this thread forever and let you marinate in your GUI awesomeness.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
redscores, if he would want to create his own knock back then fine, but since he asked for it, it means that he doesn't want to create his own or to change it.
Therefor, I don't see why not give him a good Jass code with an explanation on how to call and use it.
So he asked this in the GUI section. Does this mean he knew that knock backs can't be global in GUI and only be awesome in Jass, and thus meaning he actually wants a crappy knock back ?
I don't think so :ugly:

And I am simply giving you advice, you don't have to listen to me or to get mad at me for it.

01001000 01001001 01001110 01000100 01011001 00101100 00100000 01101001 01100110 00100000 01111001 01101111 01110101 00100000 01101101 01100001 01101011 01100101 00100000 01101001 01110100 00100000 00101000 01111001 01101111 01110101 00100000 01101011 01101110 01101111 01110111 00100000 01110111 01101000 01100001 01110100 00101001 00100000 01101001 01101100 01101100 00100000 01100110 01101001 01101110 01100100 00100000 01111001 01101111 01110101 00100000 01101000 01101111 01110101 01110011 01100101 00100000 01100001 01101110 01100100 00100000 01101011 01101001 01101100 01101100 00100000 01111001 01101111 01110101 00100000 01110111 01101000 01100101 01101110 00100000 01111001 01101111 01110101 00100000 01110011 01101100 01100101 01100101 01110000 00101110
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
True, whatever, i did the knock back now :D if he wants a mui knockback do it for him, but i think hes satisified with my one. (btw i think you could do a MUI knock back in a AoS map in GUI, because, you can have max 4 timers open per hero (4 spells), or 8 (will never happen, mostly 4 too not), and you have around 10 heroes, or 12, so 4x12 = 48, you could use a big array, to do that)
 
Status
Not open for further replies.
Top