Warcraft III: MapsModelsSkinsIconsSpellsToolsTutorials
WC3 JASS: Code SnippetsJASS and vJASS Spells and SystemsJass Tutorials
Chat @Discord

Author Topic: [Snippet] AddSpecialEffectZ  (Read 9535 times)

  • Rookie - level 1
  • *
  • Posts: 41
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 13
    • View Profile
[Snippet] AddSpecialEffectZ
« on: August 09, 2012, 05:28:22 PM »
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  [Select]
  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: August 09, 2012, 08:45:29 PM by Purgeandfire »

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 981
  • WC3 Models: 5
  • WC3 Tutorials: 11
  • WC3 Tools: 10
  • WC3 Maps: 11
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 5
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Re: [Snippet] AddSpecialEffectZ
« Reply #1 on: August 09, 2012, 09:12:27 PM »
Simplicity is the best. Approved of course :)

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Rookie - level 3
  • ***
  • Posts: 123
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 3
  • A FRENGERS
    • View Profile
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 )

  • Rookie - level 1
  • *
  • Posts: 41
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 13
    • View Profile
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()

  • Rookie - level 3
  • ***
  • Posts: 123
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 3
  • A FRENGERS
    • View Profile
Re: [Snippet] AddSpecialEffectZ
« Reply #4 on: August 14, 2012, 12:06:10 AM »
Oh, ok i understand now ;) ;)
Z is ^ @.@
Thank'z ;) ;)
+ REPT

 

[Snippet] Group Units in line, with distance and optional spread-value

Started by rvonsonsnadtzBoard Codes & Snippets

Replies: 5
Views: 11447
Last post March 13, 2013, 06:52:16 PM
by rvonsonsnadtz
[Snippet] Single Player Detector

Started by moyackBoard Codes & Snippets

Replies: 12
Views: 21008
Last post March 13, 2013, 12:48:49 PM
by Magtheridon96
[Snippet] Simple Unit Indexer

Started by moyackBoard Codes & Snippets

Replies: 17
Views: 25829
Last post September 30, 2013, 08:07:19 AM
by moyack
[Snippet] Disable Transmission Skip

Started by PurgeandfireBoard Codes & Snippets

Replies: 2
Views: 8730
Last post July 02, 2013, 01:34:55 PM
by Purgeandfire
[Snippet] Timed Effects

Started by moyackBoard Codes & Snippets

Replies: 0
Views: 7399
Last post January 09, 2012, 07:03:32 PM
by moyack
Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
  Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!