vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

[Snippet] AddSpecialEffectZ

Purgeandfire · 10958

0 Members and 1 Guest are viewing this topic.

[Snippet] AddSpecialEffectZ
on: August 09, 2012, 05:28:22 PM
Category: Effect
Language: vJASS

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.
Code: jass
  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 effect
  9. *
  10. *******************************************************************/
  11.  
  12.     globals
  13.         private destructable platform
  14.         private effect zEffect
  15.     endglobals
  16.  
  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 zEffect
  22.     endfunction
  23.  
  24. endlibrary
« Last Edit: December 19, 2017, 12:10:54 PM by moyack »



Re: [Snippet] AddSpecialEffectZ
Reply #1 on: August 09, 2012, 09:12:27 PM

Simplicity is the best. Approved of course :)


Re: [Snippet] AddSpecialEffectZ
Reply #2 on: August 13, 2012, 07:37:03 PM

I just interest with the title, but i don't understand how to set it :( :( Y.Y Y.Y
But, can that special effect add on invisible unit?? But that effect will show, even the unit are invisible. ( Like DotA - Nightcrawler ultimate )



Re: [Snippet] AddSpecialEffectZ
Reply #3 on: August 13, 2012, 09:43:44 PM

This basically allows you to have a z coordinate (elevation) for your effects. It just lets you have effects in air.

For units, you can just use the native AddSpecialEffectTarget()



Re: [Snippet] AddSpecialEffectZ
Reply #4 on: August 14, 2012, 12:06:10 AM

Oh, ok i understand now ;) ;)
Z is ^ @.@
Thank'z ;) ;)
+ REPT



 

Power of Corruption - A Warcraft III altered melee map   Chaos Realm - The world of Game modders and wc3 addicts     WC3JASS.com - The JASS Vault   Jetcraft - A Starcraft II mod