14 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.
1 library SpecialEffectZ /* v1.0.0.0
2 *******************************************************************3 *4 * Allows you to add a special effect with a Z value.5 *6 *******************************************************************7 *8 * function AddSpecialEffectZ takes string model, real x, real y, real z returns effect9 *10 *******************************************************************/11 12 globals13 private destructable platform
14 private effect zEffect
15 endglobals16 17 function AddSpecialEffectZ takes string model, real x, real y, real z returns effect
18 set platform = CreateDestructableZ('OTip', x, y, z, 0, 1, 0)
19 set zEffect = AddSpecialEffect(model, x, y)
20 call RemoveDestructable(platform)
21 return zEffect22 endfunction23 24 endlibrary