• 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.

Need help with my first trigger enhanced spell

Status
Not open for further replies.
Level 3
Joined
Jul 29, 2006
Messages
61
Hello I'm new to these boards. I have been reading Daelin's Tutorial and am current;y trying to make my own spell.

The idea behind it is simple: A Non-Targetable AOE which knocks back everything in the area. I Can already move them a set distance instantly, but I would like to make it look more Realistic (so I can see them being knocked back instead of arbitrarily appearing away from the caster)

This is my Trigger thus far:
Code:
Bloodwind
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Bloodwind I 
    Actions
        Unit Group - Pick every unit in (Units within 512.00 of (Position of (Casting unit)) matching (((Owner of (Matching unit)) controller) Equal to Computer)) and do (Actions)
            Loop - Actions
                Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 512.00 towards (Angle from (Position of (Casting unit)) to (Position of (Picked unit))) degrees)
 
Level 3
Joined
Jul 29, 2006
Messages
61
wouldn't that happen to everyone matching the condition one at a time?

I'll try it anyway, thanks for the help

edit: they no longer move very far at all, They move 30 pixels then stop moving.
Heres my updated code:
Code:
Bloodwind
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Bloodwind I 
    Actions
        Set Caster = (Casting unit)
        Unit Group - Pick every unit in (Units within 512.00 of (Position of Caster) matching (((Owner of (Matching unit)) controller) Equal to Computer)) and do (Actions)
            Loop - Actions
                Set WaitTime = 0.01
                Set target = (Picked unit)
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 30.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 31.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
                Wait WaitTime seconds
                Unit - Move target instantly to ((Position of target) offset by 32.00 towards (Angle from (Position of Caster) to (Position of target)) degrees)
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
u need 2 variables. 1 unit type variable (and when u cast do 'set variable - set 'unit var' = casting unit) and a unit group var (set 'unit group var' = units within XXX range, or picked unit group or whatever u can choose) and at the seocnd triggers u fill in those vars
 
Level 3
Joined
Jul 29, 2006
Messages
61
but you cannot but a unitgroup variable into the code, the best I can do is add random unit and that would randomly push certain units away.
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
i know something. u still put every unit within range in a unit group variable. and in the seperate trigger u pick every unit in playable map area matching condition (and as condition: unit is in 'unit group var') then move the unit away. so now u pick all units in the map, and if the unit u picked is in the 'unit group var', u move it away from the 'casting unit var'
 
Level 3
Joined
Jul 29, 2006
Messages
61
ahh thanks, that will work

one problem: no unit in unit group condition.

edit: found it in boolean

edit2: I got it to work thanks :twisted:
 
Status
Not open for further replies.
Top