Warcraft III resources & community, 2003–2006 · archived

Special Effect for Player at loc

not rated
Submitted by fuglyFunctions0 downloads
ok first thing first
I DIDN'T COME UP WITH THIS FUNCTION
it was thought up a while ago but i guess never posted and i forget who came up with it. Any way it creates a special effect that only 1 player can see. it does this by localy moving the target loc. this does not cause a desync.

Source

function AddSpecialEffectLocForPlayer takes player who, location where, string modelName returns effect
local location x = Location(0,0) //Set this to somewhere that no one can see.
local effect e = null
if GetLocalPlayer() == who then
   set x = where
endif
set e = AddSpecialEffectLoc(modelName, x)
call RemoveLocation(x)
return e
endfunction

Comments

4
why cant you do
function AddSpecialEffectLocForPlayer takes player who, location where, string modelName returns nothing if GetLocalPlayer() == who then call AddSpecialEffectLoc(modelName, where) endfunction

? it doesnt return a specialeffect but it is still created

function AddSpecialEffectLocForPlayer takes player who, location where, string modelName returns effect
    if GetLocalPlayer() != who then
        set modelName = ""
    endif
    return AddSpecialEffectLoc(modelName, where)
endfunction


much better
Copy it into the custom script section of your map(In the trigger editor in the list on the very top, has your map's name).
Then when you want to use it do the following:
Custom Script: call AddSpecialEffectLocForPlayer(Player,Location,Modelname)

You can also use it this way for example:
Custom Script: set udg_SomeEffectVariable = AddSpecialEffectLocForPlayer(Player,Location,Modelname)

Then you'll also get the created effect in the variable udg_SomeEffectVariable which is the GUI Variable "SomeEffectVariable".

function AddSpecialEffectLocForPlayer takes player who, location where, string modelName returns effect
local location x = Location(0,0) //Set this to somewhere that no one can see.
local effect e = null
if GetLocalPlayer() == who then
set x = where
endif
set e = AddSpecialEffectLoc(modelName, x)
call RemoveLocation(x)
return e
endfunction

Hm...how could "I use this...