HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

special effect question

02-16-2006, 04:28 AM#1
Linera
Can I show a special effect using triggers to only 1 player without desync?
02-16-2006, 06:16 AM#2
Jacek
I don't think so... creating units, doodads etc. for one player cause desync, so probably special effect. Best way would be just check it.
02-16-2006, 06:26 AM#3
Linera
ok
02-16-2006, 09:34 AM#4
Blade.dk
Yes you can. You can make the effect use an invisible path for some playes, should make it work. Something like this:

Collapse JASS:
    local string path = "blah\\blah\\blah.mdx"
    if GetLocalPlayer() != <player that shall see the effect> then
        set path = ""
    endif
    call AddSpecialEffect(path, 0, 0)
02-16-2006, 12:38 PM#5
Chuckle_Brother
Isn't it just easier to use this?

Collapse JASS:
if (GetLocalPlayer() == <Viewing Player>) then
     //Set that funky stuff
endif
02-16-2006, 01:00 PM#6
Anitarf
"Set that funky stuff"? Mind actually writing some code rather than giving some vague pseudocode that could mean anything?
02-16-2006, 01:06 PM#7
Chuckle_Brother
I'm sorry, I posted this under the obviously false hope that those reading it may, just somehow, take note of the name of this thread and realize what he could POSSIBLY be doing in the IF statement. Forgive me for laboring under that assumption, and allow me to correct it.

Collapse JASS:
if (GetLocalPlayer() == <Viewing Player>) then
    call AddSpecialEffect("MODELPATH HERE", XReal, YReal)
endif
02-16-2006, 01:09 PM#8
Blade.dk
That would cause desyncs as the effect only would be created for one player.

In my exmple it only changes a string locally, so the effect is actually created for all players, so it won't desync.
02-16-2006, 01:12 PM#9
Chuckle_Brother
Hmm, interesting, that may fix some of the problems I had with a dupe I made of a mirror image spell
02-16-2006, 02:12 PM#10
Jacek
Blade's way creates special effect which is invisible.
02-16-2006, 07:26 PM#11
Linera
this keeps giving an error:
Collapse JASS:
function Trig_creation_Actions takes nothing returns nothing
    local string path1 = "Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl"
    if GetLocalPlayer() != player(1) then
        set path1 = ""
    endif
    call AddSpecialEffect(path1, 0, 0)
endfunction

//===========================================================================
function InitTrig_creation takes nothing returns nothing
    set gg_trg_creation = CreateTrigger(  )
    call TriggerAddAction( gg_trg_creation, function Trig_creation_Actions )
endfunction
and how can i put it on a unit?
02-16-2006, 07:40 PM#12
Anitarf
The function name is Player(), not player(). Also, player indexes start with 0 in Jass.
02-16-2006, 07:41 PM#13
Linera
there is no such player as player 0
02-16-2006, 07:45 PM#14
Anitarf
There is in Jass, it's the same as Player 1 in GUI.
02-16-2006, 07:45 PM#15
Linera
how can i put it on a unit?

unless jass has no possible way to...