HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Spells with parallel missiles ?

09-17-2009, 12:39 PM#1
DanThanh
So, i want to fire 5 parallel missiles towards the target, i try to use XE fx for it, but i feel confuse, can anyone please make me a small sample so that i can learn it ?
-Below is the code, it gives me unexpected result !


Collapse JASS:
local unit     u   = GetTriggerUnit()
     local location loc = GetSpellTargetLoc()

     local real     x   = GetUnitX(u)
     local real     y   = GetUnitY(u)

     local real     ang = Atan2( GetLocationY(loc) - y, GetLocationX(loc) - x)

     local real     ang2
     local integer  i

     local real     mx
     local real     my

     local FiveMissile xc

  
        set ang2 = ang + bj_PI/2
        set i=0  
        loop               
            exitwhen (i==5)
            
            set mx = x + 75*Cos(ang2)
            set my = y + 75*Sin(ang2)


            set xc = FiveMissile.create(mx, my , ang) 
            

            set xc.fxpath             = "path"

            set xc.acceleration     = 1000.0
            set xc.maxSpeed       = 500.0 
            set xc.expirationTime = 2.0
            set xc.z                    = 50.0
            set xc.owner 
            set ang2= bj_PI + ang2 
            set i=i+1
        endloop



EDIT: Problem solved, please close this topic, thanks