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

[Trigger] Easy Knockback Function (GUI)

Status
Not open for further replies.
Level 7
Joined
Jun 20, 2007
Messages
255
Want a knockback huh? well lucky you i got one here ... take a look at this.
Make a trigger like this. Create two triggers knockback and push . Remove initialy from push so it doesnt go on forever.
BTW i think its good to have the unit stunned while being knockbacked its cooler then.

  • Knockback
  • Events: A unit Starts the effect of an ability
  • Conditions:(Ability being Cast) Equal to Stormbolt
  • Actions:Set caster = Casting Unit
  • Set target = (Target unit of ability being cast)
  • Set location = (Position of Caster)
  • Trigger: Turn on Push
  • Wait (The amount of time you want the target unit to be pushed away.)
  • Trigger: Turn of Push

Location is a point no specific no array
target is just a unit
caster is just a unit to but you got to use them right both got no array


Push

  • Event: Time Every 0.04 seconds of Game Time
  • Actions: Unit Move Target Instantly to location offset by ((distance between location and (position of target)) + 5.00 towards angle from location to position of target degrees.
 
Last edited:
Level 24
Joined
May 9, 2007
Messages
3,563
Hmm, what the problems with it are:

1) It can only effect one unit at a time. If another unit casts it at the same time then it changes the variables.

2)It "leaks". This is because you do not null the variables. To do so go like this.

  • Events: A unit Starts the effect of an ability
  • Conditions:(Ability being Cast) Equal to Stormbolt
  • Actions:Set caster = Casting Unit
  • Set target = (Target unit of ability being cast)
  • Set location = (Position of Caster)
  • Trigger: Turn on Push
  • Wait (The amount of time you want the target unit to be pushed away.)
  • Trigger: Turn of Push
  • call RemoveLocation(udg_location)
This fixes only one of the problems.

http://www.hiveworkshop.com/forums/showthread.php?t=35124 for more details.
 
Level 7
Joined
Jun 20, 2007
Messages
255
1: forgot to remove location yes im sorry
2: Well its more of a unique ability that only one unit has, i thought it could be used in an naruto map for instance its rasengan ( which only naruto can use)
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
*beep* *beep* beeep*
"Sir our sensors have detected a large quantity of fail in this sector."

Sorry to disappoint you, but this whole thing is a mess, it leaks, it's bad. It is not clear what is what between those trigger tags. You should clear your triggers before you post them. You should not post non-MUI stuff, you still didn't update the first post to remove leaks, you use wait.
 
Level 17
Joined
May 6, 2008
Messages
1,598
Want a knockback huh? well lucky you i got one here ... take a look at this.
Make a trigger like this. Create two triggers knockback and push . Remove initialy from push so it doesnt go on forever.
BTW i think its good to have the unit stunned while being knockbacked its cooler then.

  • Knockback
  • Events: A unit Starts the effect of an ability
  • Conditions:(Ability being Cast) Equal to Stormbolt
  • Actions:Set caster = Casting Unit
  • Set target = (Target unit of ability being cast)
  • Set location = (Position of Caster)
  • Trigger: Turn on Push
  • Wait (The amount of time you want the target unit to be pushed away.)
  • Trigger: Turn of Push

Location is a point no specific no array
target is just a unit
caster is just a unit to but you got to use them right both got no array


Push

  • Event: Time Every 0.04 seconds of Game Time
  • Actions: Unit Move Target Instantly to location offset by ((distance between location and (position of target)) + 5.00 towards angle from location to position of target degrees.

Good job!

Even the most stupid can figure this out. No offense.
 
Status
Not open for further replies.
Top