HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making a CollisionMissile spin

11-10-2006, 08:05 PM#1
SFilip
Well I've been trying to do this for some time now, but simply can't come up with a smooth formula.
What I want is to create a CollisionMissile that spins around a certain point, always at the distance of 100, at the speed of 500 for example. Now how would I calculate the Angle Speed for this? And what does the Angle Speed represent exactly?
Thanks in Advance
11-10-2006, 08:33 PM#2
Captain Griffen
Collapse JASS:
function SetAngleAroundPoint takes unit u, location centre, real ang, real dis returns nothing
    local real rad = ang * bj_DEGTORAD
    call SetUnitX(u, GetLocationX(centre) + dis * Cos(rad))
    call SetUnitY(u, GetLocationY(centre) + dis * Sin(rad))
    call SetUnitFacing(u, ang + 90)
endfunction

Obviously the angle will increment by a certain amount each loop based upon the speed and the size of the circle, so:

speed / (2pi*r) * time gap
11-11-2006, 02:19 AM#3
Vexorian
Quote:
Originally Posted by SFilip
Well I've been trying to do this for some time now, but simply can't come up with a smooth formula.
What I want is to create a CollisionMissile that spins around a certain point, always at the distance of 100, at the speed of 500 for example. Now how would I calculate the Angle Speed for this? And what does the Angle Speed represent exactly?
Thanks in Advance
collisionmissile's AngleSpeed is addition per second to the angle in degrees. It is hard to explain...

Well a normal CollisionMissile goes through angle F but if there is an anglespeed of 4.0 then F will be modiffied each cycle.

Cycles depend on the cs options, most of the times it is 0.04 unless I really changed it to 0.035 in the last version, but well. F should be added 4 each second, but since the cycle is 0.04 it will be incremented by 0.16 each 0.04s cycle.

But I think that for your problem you should better create a normal collision missile and calculate how much time it will take for it to get to the distance of 100 and then wait that time and spin the collision missile there. AFAIK there is a function to manually change the direction of the CollisionMissile