• 🏆 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] AoE Knockback not working

Status
Not open for further replies.
Level 10
Joined
Jun 10, 2007
Messages
557
Okay, I've been pouring over these triggers for hours now and I just can't figure out what I'm doing wrong.

What this spell is supposed to do is stun all nearby enemies (done via war stomp, the base ability), knock them back and increase the caster's strength by 5% per enemy affected for 6 seconds. All of this works fine, except that it never knocks affected enemies back. It stuns them just fine and gives proper strength gain, but the knockback just refuses to do anything.

Here are my 3 triggers (and the trigger that initializes the hashtables). If anybody could possibly find out what's wrong I will be so grateful. Thanks in advance!

  • Hashtables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set FuriousBellowBuff = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set FuriousBellowKB = (Last created hashtable)
  • Furious Bellow Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Furious Bellow (Barbarian)
    • Actions
      • Unit Group - Add (Triggering unit) to FuriousBellowBuffGroup
      • Set Location = (Position of (Triggering unit))
      • Set Group = (Units within 250.00 of Location matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
      • Hashtable - Save (((Strength of (Triggering unit) (Exclude bonuses)) / 20) x (Number of units in Group)) as 0 of (Key (Triggering unit)) in FuriousBellowBuff
      • Hashtable - Save 6.00 as 1 of (Key (Triggering unit)) in FuriousBellowBuff
      • Hero - Modify Strength of (Triggering unit): Add (((Strength of (Triggering unit) (Exclude bonuses)) / 20) x (Number of units in Group))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to FuriousBellowKBGroup
          • Set Location2 = (Position of (Picked unit))
          • Set FuriousBellowKBAngle = (Angle from Location to Location2)
          • Set FuriousBellowKBTime = 0.52
          • Set FuriousBellowKBDistance = 25.00
          • Hashtable - Save FuriousBellowKBAngle as 0 of (Key (Picked unit)) in FuriousBellowKB
          • Hashtable - Save FuriousBellowKBTime as 1 of (Key (Picked unit)) in FuriousBellowKB
          • Hashtable - Save FuriousBellowKBDistance as 2 of (Key (Picked unit)) in FuriousBellowKB
          • Custom script: call RemoveLocation (udg_Location2)
      • Animation - Add the alternate animation tag to (Triggering unit)
      • Custom script: call RemoveLocation (udg_Location)
      • Custom script: call DestroyGroup (udg_Group)
  • Furious Bellow Knockback
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FuriousBellowKBGroup and do (Actions)
        • Loop - Actions
          • Set Location = (Position of (Picked unit))
          • Set FuriousBellowKBAngle = (Load 0 of (Key (Picked unit)) from FuriousBellowKB)
          • Set FuriousBellowKBTime = (Load 1 of (Key (Picked unit)) from FuriousBellowKB)
          • Set FuriousBellowKBDistance = (Load 2 of (Key (Picked unit)) from FuriousBellowKB)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FuriousBellowKBTime Greater than 0.00
            • Then - Actions
              • Set Location2 = (Location offset by FuriousBellowKBDistance towards FuriousBellowKBAngle degrees)
              • Unit - Move (Picked unit) instantly to Location2
              • Special Effect - Create a special effect at Location2 using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • Hashtable - Save (FuriousBellowKBTime - 0.04) as 1 of (Key (Picked unit)) in FuriousBellowKB
              • Custom script: call RemoveLocation (udg_Location2)
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in FuriousBellowKB
              • Unit Group - Remove (Picked unit) from FuriousBellowKBGroup
          • Custom script: call RemoveLocation (udg_Location)
  • Furious Bellow Buff
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FuriousBellowBuffGroup and do (Actions)
        • Loop - Actions
          • Set FuriousBellowBuffAmount = (Load 0 of (Key (Picked unit)) from FuriousBellowBuff)
          • Set FuriousBellowBuffTime = (Load 1 of (Key (Picked unit)) from FuriousBellowBuff)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FuriousBellowBuffTime Greater than 0.00
            • Then - Actions
              • Hashtable - Save (FuriousBellowBuffTime - 1.00) as 1 of (Key (Picked unit)) in FuriousBellowBuff
            • Else - Actions
              • Hero - Modify Strength of (Picked unit): Subtract FuriousBellowBuffAmount
              • Animation - Remove the alternate animation tag to (Picked unit)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in FuriousBellowBuff
              • Unit Group - Remove (Picked unit) from FuriousBellowBuffGroup
 
Level 10
Joined
Jun 10, 2007
Messages
557

Duly noted; I'll give it a shot if there's no solution available to my current trigger. The reasons for this being that I don't want to destroy destructibles or bounce off of walls, and I just prefer to do things myself and learn from them rather than using systems from a can.

Is the looping trigger initially off? Turn it on then when the ability is cast.

It's not turned off or disabled.

Use Game - Display text message to see whether units are added into the group and that the are looped for example.

After trying this; units are being added to the group Group, but never to FuriousBellowKBGroup.
 
Level 10
Joined
Jun 10, 2007
Messages
557
- you should save the location as well...

The unit is being moved relative to its current position each time, so no need to store and load a position across multiple positions.

- this >>> FuriousBellowKBTime - 0.04 >>> FuriousBellowKBTime + 0.04 coz Time will reach the max distance right?...

FuriousBellowKBTime begins at 0.52 and is reduced by 0.04 every time the loop runs. Thus it will be reduced to 0.00 at the 13th loop, and then the loop will stop, which is intentional.

- FuriousBellowBuffTime Less Than FuriousBellowKBDistance...

So? The time variables are literally nothing more than timers; the numbers are reduced every time the loop runs, and when they hit 0.00 the loop stops. They are completely separate from and never interact with distance or any other variable.
 
Level 10
Joined
Jun 10, 2007
Messages
557
I'll give you a sample of mass knockback, wait and see what I mean...

EDIT:
Here, just to show you what I mean, but it is strongly recommended to use Bribe's Knockback2D

Hmm, that's peculiar - it works for me in the test map, but when I copy-paste it into my own map (changing only the ability that activates it), it no longer does anything. Is there some conflict with moving units and war stomp, or something?

Not that big of a deal though, I suppose; I'll give 2D Knockback a shot as soon as I've got time.
 
Status
Not open for further replies.
Top