HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Two questions (unrelated)

07-03-2009, 11:55 AM#1
Cheezeman
Slowing a special effect
Is there any other way to slow a special effect, than changing a unit's model file and using SetUnitTimeScale?
I've tried attaching a special effect to a dummy unit using the dummy.mdx and slowing the dummy down, but it doesn't work either

PolarProjectionBJ (evil...)
This is how it looks like (to save you time):
Collapse JASS:
function PolarProjectionBJ takes location source, real dist, real angle returns location
    local real x = GetLocationX(source) + dist * Cos(angle * bj_DEGTORAD)
    local real y = GetLocationY(source) + dist * Sin(angle * bj_DEGTORAD)
    return Location(x, y)
endfunction

As you can see it returns a location.
Will this clean up the location?
Collapse JASS:
set SomeLoc = PolarProjectionBJ( source, dist, angle )
call DestroyLocation( SomeLoc )
set SomeLoc = null

Or will the returned location in PolarProjectionBJ leak aswell (meaning you have to extract the x and y coordinates instead), giving you two total leaks?

Don't worry, I'm not using the PolarProjectionBJ in any way, it'll just give me a more general understanding of functions returning locations.
07-03-2009, 12:13 PM#2
Anitarf
Well, your code does leak the source loc, but not the location returned by PolarProjectionBJ.

As for the special effect, I don't think there's any way to slow it down.
07-03-2009, 01:21 PM#3
Tyrande_ma3x
There is.
Don't attach the special effect to the dummy, use the special effect as the dummy's model. Then use SetUnitTimeScale accordingly and it works for you.
07-03-2009, 03:15 PM#4
Cheezeman
Quote:
Originally Posted by Anitarf
Well, your code does leak the source loc, but not the location returned by PolarProjectionBJ.
Yeah I didn't bother to write down I was removing source aswell.
Anyway you pretty much answered my question, thank you.