13 years
edited 8 years
Another simple snippet. It is the good ol' technique to make an effect have a Z-coordinate, allowing it to float Z units above the ground.
It works by creating an invisible platform, adding the effect, and then removing the platform.
Note: Creating too many at a time can cause short lag spikes. If this occurs, you may want to switch to use invisible dummy units instead.
It works by creating an invisible platform, adding the effect, and then removing the platform.
Note: Creating too many at a time can cause short lag spikes. If this occurs, you may want to switch to use invisible dummy units instead.
library SpecialEffectZ /* v1.0.0.0
*******************************************************************
*
* Allows you to add a special effect with a Z value.
*
*******************************************************************
*
* function AddSpecialEffectZ takes string model, real x, real y, real z returns effect
*
*******************************************************************/
globals
private destructable platform
private effect zEffect
endglobals
function AddSpecialEffectZ takes string model, real x, real y, real z returns effect
set platform = CreateDestructableZ('OTip', x, y, z, 0, 1, 0)
set zEffect = AddSpecialEffect(model, x, y)
call RemoveDestructable(platform)
return zEffect
endfunction
endlibrary