Warcraft III resources & community, 2003–2006 · archived

Alright, I've been trying to program my own knockback...

2 posts
#1

Alright, I've been trying to program my own knockback...

And I've created two different spells (both just triggers, no JASS). Unfortunately, something's wrong with both of them.

The first one I based off of Pushback Nova, simply based off the pushback part (I'm eventually going to make it a stat-based spell, so I need to trigger the damage separately). The problem with it is that whenever I use it, the enemies all get pushed back in the same direction. This remains after I move around some, too. (the spell is based off howl of terror. The howl effect lasts .60 seconds)

Knockback
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Howl of Terror) Equal to True)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is alive) Equal to True
                        ((Picked unit) is A ground unit) Equal to True
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 15.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Picked unit))) degrees)
                        Wait 0.10 seconds
                        Unit - Remove All buffs from (Picked unit)
                    Else - Actions
                        Do nothing


As for the second spell I tried to program, it was based off of This topic. The spell has 2 parts (and is based off battle roar). The problem with this one is...well, it does nothing besides the regular effects of the spell.

First part:
Sword Whirl
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sword Whirl 
    Actions
        Unit Group - Add all units of (Units within 450.00 of (Position of (Triggering unit))) to swordwhirl


And the second part:
Sword whirl 2
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units within 700.00 of (Position of (Triggering unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is in swordwhirl) Equal to True
                    Then - Actions
                        Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 300.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Picked unit))) degrees)
                    Else - Actions
                        Do nothing


So...any help? I'd be glad to get any advice on getting either one of these abilities to work.
#2
For the first spell

Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 15.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Picked unit))) degrees)

there is no triggering unit. The event is time based.

For the second spell

Unit Group - Pick every unit in (Units within 700.00 of (Position of (Triggering unit))) and do (Actions)
Loop - Actions


instantly to ((Position of (Picked unit)) offset by 300.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Picked unit))) degrees)

Same issue. There is NO triggering unit for those triggers. Therefore, it records the position of the triggering unit as 0,0.

3rd problem: This has so many leaks, you're gonna lag so hard your unborn firstborn is gonna feel it.
--donut3.5--
The conversation continued. After wc3sear.ch closed, 1 further reply was posted to this thread on The Hive Workshop. Read them there →