• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Trigger does not knockback

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
  • Barrier of the Wind King
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Barrier of the Wind King (based in taunt)
    • Actions
      • Set SpellPoint[0] = (Position of (Casting unit))
      • Environment - Create a ((Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit)))) x 0.40) second Depression ripple deformation at SpellPoint[0] with starting radius 220.00, ending radius 300.00, and depth 64.00, using 1.00 second ripples spaced 50.00 apart
      • Environment - Stop (Last created terrain deformation) over 1.00 seconds
      • Unit - Create 1 BWK Effect for (Owner of (Casting unit)) at SpellPoint[0] facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
      • Unit Group - Pick every unit in (Units within 110.00 of SpellPoint[0] matching (((Owner of (Picked unit)) is an enemy of (Owner of (Casting unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set tempunit[1] = (Picked unit)
          • Set tempinteger[0] = (20 + ((Level of Barrier of the Wind King (based in taunt) for (Casting unit)) x 30))
          • Set temppoint = (Position of (Picked unit))
          • Set tempinteger[1] = (Integer((Angle from SpellPoint[0] to temppoint)))
          • Set tempreal = (0.50 + (0.30 x (Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit))))))
          • Custom script: call KnockbackEx(udg_tempunit[1], udg_tempinteger[0], udg_tempinteger[1] * bj_DEGTORAD, udg_tempreal, -250, 2, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", "origin")
          • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
Well, it only spawn the effect of terrain and the unit, but does not knockback every one in 220AoE from the center T.T

About the KnockbackEx(u, d, a, w, r, t, s, p)
* unit u = the unit being knockbacked
* real d = the distance the unit is knockbacked to
* real a = the angle (direction of the knockback) in RADIANS
* real w = the duration of the knockback
* real r = the radius of tree destroying, but there's a new trick: if you put a negative number as the radius, the unit will stop knockbacking when it gets in that range of a tree and if you put a positive value, the unit will destroy trees when it gets in that range of a tree (if you don't want any of those, just put 0)
* integer t = type 0 means no effect (both s and p should be ""), type 1 means periodic effect (meaning you should put "" as the attachment point, parameter p), type 2 means a special effect attached on the unit and destroyed when the knockback is finished (this is where you use parameter p)
* string s = the path to the special effect you want to use (periodic), that effect will be destroyed immediatelly (you can put "" if you don't want a special effect)
* string p = used for type 2, it's the attachment point of the effect, "chest" is default (so if you put "", it will be "chest")
 
Level 25
Joined
Jun 5, 2008
Messages
2,573
You need an second trigger:
Trigger push effect(if you want an slide effect)
  • Events - Every 0.03 seconds
  • Conditions
  • Actions
    • - Unit Group - Pick every unit in *Unit Group* and do actions
      • - Unit move instantly for *x* towards *your angle(i think it's in your case tempinteger[1])* facing *angle*
Or just add this if you want an instant push:
  • Barrier of the Wind King
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Barrier of the Wind King (based in taunt)
  • Actions
  • Set *Unit Group* = Units within 110 of SpellPoint[0] matching *your conditions*
  • Set SpellPoint[0] = (Position of (Casting unit))
  • Environment - Create a ((Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit)))) x 0.40) second Depression ripple deformation at SpellPoint[0] with starting radius 220.00, ending radius 300.00, and depth 64.00, using 1.00 second ripples spaced 50.00 apart
  • Environment - Stop (Last created terrain deformation) over 1.00 seconds
  • Unit - Create 1 BWK Effect for (Owner of (Casting unit)) at SpellPoint[0] facing Default building facing degrees
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
  • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
  • Unit Group - Pick every unit in (*Unit Group* and do (Actions)
  • Loop - Actions
    • Set tempunit[1] = (Picked unit)
    • Set tempinteger[0] = (20 + ((Level of Barrier of the Wind King (based in taunt) for (Casting unit)) x 30))
    • Set temppoint = (Position of (Picked unit))
    • Set tempinteger[1] = (Integer((Angle from SpellPoint[0] to temppoint)))
    • Set tempreal = (0.50 + (0.30 x (Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit))))))
    • Unit move instantly for *x* towards *your angle* facing *angle*
    • Custom script: call KnockbackEx(udg_tempunit[1], udg_tempinteger[0], udg_tempinteger[1] * bj_DEGTORAD, udg_tempreal, -250, 2, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", "origin")
    • Custom script: call RemoveLocation(udg_temppoint)
    • Custom script: call RemoveLocation(udg_SpellPoint[0])
  • custom script: call DestroyGroup(udg_*Unit Group*)
I myself use this for the push effect:
  • Events - Every 0.03 seconds
  • Conditions
  • Actions
    • - Unit Group - Pick every unit in *Unit Group* and do actions
      • - Set *picked unit point* = Position of picked unit
      • - Unit move instantly for *x* towards (angles from *caster point* to *picked unit point*) facing *unit position of casting unit*
      • - Custom script:call RemoveLocation(udg_*picked unit point*)
This bellow is if you want the slide effect:
Also see what number is best situated for the *x* value.
Also define the duration of the push effect, etc if you put *x* = 10 then it should run 22 times, multiply that with 0.03 and add:
  • Barrier of the Wind King
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Barrier of the Wind King (based in taunt)
  • Actions
  • Set SpellPoint[0] = (Position of (Casting unit))
  • Set *Unit Group* = Units within 110 of SpellPoint[0] matching *your conditions*
  • Environment - Create a ((Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit)))) x 0.40) second Depression ripple deformation at SpellPoint[0] with starting radius 220.00, ending radius 300.00, and depth 64.00, using 1.00 second ripples spaced 50.00 apart
  • Environment - Stop (Last created terrain deformation) over 1.00 seconds
  • Unit - Create 1 BWK Effect for (Owner of (Casting unit)) at SpellPoint[0] facing Default building facing degrees
  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
  • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
  • Trigger turn on *push effect*
  • Unit Group - Pick every unit in *Unit Group* and do (Actions)
  • Loop - Actions
    • Set tempunit[1] = (Picked unit)
    • Set tempinteger[0] = (20 + ((Level of Barrier of the Wind King (based in taunt) for (Casting unit)) x 30))
    • Set tempinteger[1] = (Integer((Angle from SpellPoint[0] to temppoint)))
    • Set tempreal = (0.50 + (0.30 x (Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit))))))
    • Custom script: call KnockbackEx(udg_tempunit[1], udg_tempinteger[0], udg_tempinteger[1] * bj_DEGTORAD, udg_tempreal, -250, 2, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", "origin")
    • Custom script: call RemoveLocation(udg_temppoint)
    • Custom script: call RemoveLocation(udg_SpellPoint[0])
  • wait *y(22 x 0.03)* seconds
  • trigger turn off *push effect*
  • custom script: call DestroyGroup(udg_*Unit Group*)
 
Level 12
Joined
Mar 23, 2008
Messages
942
????
I have the knockback trigger already, it works, its just not working in THAT trigger.

  • call KnockbackEx(udg_tempunit[1], udg_tempinteger[0], udg_tempinteger[1] * bj_DEGTORAD, udg_tempreal, -250, 2, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", "origin")
In my other triggers that function works, but its not working in THAT trigger, I wanna know why.

Edit: Also, thanks silvenon for the knockback system!
 
Level 12
Joined
Mar 23, 2008
Messages
942
owner of Matching units, not Picked units.
Thanks sir, now it works ^^

  • Barrier of the Wind King
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Barrier of the Wind King (based in taunt)
    • Actions
      • Set SpellPoint[0] = (Position of (Casting unit))
      • Environment - Create a ((Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit)))) x 0.40) second Depression ripple deformation at SpellPoint[0] with starting radius 220.00, ending radius 300.00, and depth 64.00, using 1.00 second ripples spaced 50.00 apart
      • Environment - Stop (Last created terrain deformation) over 1.00 seconds
      • Unit - Create 1 BWK Effect for (Owner of (Casting unit)) at SpellPoint[0] facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
      • Set tempgroup = (Units within 220.00 of SpellPoint[0] matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Set tempunit[1] = (Picked unit)
          • Set tempinteger[0] = (20 + ((Level of Barrier of the Wind King (based in taunt) for (Casting unit)) x 30))
          • Set temppoint = (Position of (Picked unit))
          • Set tempinteger[1] = (Integer((Angle from SpellPoint[0] to temppoint)))
          • Set tempreal = (0.50 + (0.30 x (Real((Level of Barrier of the Wind King (based in taunt) for (Casting unit))))))
          • Custom script: call KnockbackEx(udg_tempunit[1], udg_tempinteger[0], udg_tempinteger[1] * bj_DEGTORAD, udg_tempreal, -250, 2, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", "origin")
          • Custom script: call RemoveLocation(udg_temppoint)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
      • Custom script: call DestroyGroup(udg_tempgroup)
 
Status
Not open for further replies.
Top