Warcraft III resources & community, 2003–2006 · archived

Need help with my first trigger enhanced spell

9 posts
#1

Need help with my first trigger enhanced spell

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:
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)
#2
use offset by 30 then wait 0.03 sec and copy and paste that action again, then again wait 0.03 sec and paste it (go on with this till how long u want) now it moves alittle bit backwards every 0.03 sec
#3
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:
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)
#4
ow i forgot. waits in loop dont work. u must make a seperate trigger with the event: every 0.03 sec of the game and as action paste that action. then turn the trigger on if u cast the spell
#5
but how would I relate the caster and the target to that trigger?
#6
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
#7
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.
#8
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'
#9
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: