• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

SFX just visible for one player?

Status
Not open for further replies.
JASS:
  function AddSpecialEffectForPlayer takes string modelpath, real x, real y, player whichplayer returns effect      local string s = ""
      if GetLocalPlayer() == whichplayer then
         set s = modelpath
      endif
      return AddSpecialEffect(modelpath, x, y)
  endfunction
I'm not sure if you know jass, but this will do what you want without causing desyncs (a.k.a. server splits).

You can learn more about GetLocalPlayer() here: https://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/using-getlocalplayer-59368/
 
no, i dont know jass :S

but i should do:

when it sais "whichplayer" i shoul write the player i want the sfx to be displayed for ?

when it says "modelpath" i should write the model path i want \\ instead of \ ?

and x and y : should i replace them for real values of the point in map i want the sfx to be created at ?

now, should i destroy the sfx? should i null any variable? x and y are locals, so they wont interfere in any other global type of variable existant with the same name?
 
JASS:
//To use maskedpoptarts example you call the function in a trigger like so:
call AddSpecialEffectForPlayer("yourmodelhere", x_point_in_map, y_point, Player(playernumber))
//
 
Dont try that.

This is how it should be done:

JASS:
function AddLocalEffect takes player p, string path, real x, real y returns effect
    if GetLocalPlayer() != p then
       set path=""
    endif
    return AddSpecialEffect(path, x, y)
endfunction


If you are a GUI user, learn to Jass at least that much that you can do local effects without ruining your map.
 
Creating some handles locally indeed desyncs.

For example textags are expections, because their handle ids are preallocated or something. Dont know about other pseudo handles ( or non agents since 1.24 ? ) because I havent tested those.
 
Text Tag id's don't use the same stack as other handles, they are integers from 0 - 99, as I recall.

(Non-Weather) Effect id's are on the same stack as Unit id's, Group id's, etc...
 
Status
Not open for further replies.
Back
Top