HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Effects only veiwable by one player?

08-24-2006, 03:24 PM#1
darkwulfv
I know this can be done using dummy units, move triggers, and shade's ghost, but is there any other way to make an ability only seeable by one player? This may sound stupid, but im asking becuase I thought about PSI, and wanted enemies to be like "wtf?". If you can't, no big deal i was just wondering while i had the thought in mind.
08-24-2006, 03:27 PM#2
Rising_Dusk
You might consider...

Collapse JASS:
if GetLocalPlayer() == YourPlayer then
    call DestroyEffect(AddSpecialEffect("Some\\Effect\\Here.mdx", x, y))
endif
I hear there may be issues with creating handles for local player.
Someone else is bound to know more.
08-24-2006, 03:27 PM#3
blu_da_noob
I assume you mean 'effect' instead of ability. And if so, yes.

Collapse JASS:
local string s = "your//effect//path.here"
if GetLocalPlayer() != PlayerToSeeEffect then
    set s = ""
endif
call AddSpecialEffect(s,x,y) //or whichever one you are using, pass s as the model string parameter

Edit: whee crossposting. Creating an effect (or any handle) for only one player may cause a desync, creating and immediately destroying for only one player may possibly be ok, but there is no real need since the method I posted above is safe.
08-24-2006, 03:29 PM#4
Rising_Dusk
Hrm... That's pretty cool.
I'd have to test it to see how it worked, but it looks perfectly fine.

That could lead to some really cool spell ideas. :D
08-24-2006, 04:40 PM#5
DioD
Last posted code is safe but
Collapse JASS:
local string s = "your//effect//path.here"
if GetLocalPlayer() != PlayerToSeeEffect then
    set s = ""
endif
call AddSpecialEffect(s,x,y)
set s = ""
this just for sync string var, after effect created var will became same for all players.
If you will not sync strings save/load will become unsafe.
08-24-2006, 07:55 PM#6
UnMi
Quote:
this just for sync string var, after effect created var will became same for all players.
If you will not sync strings save/load will become unsafe.
-.-...What?
08-24-2006, 08:01 PM#7
Naakaloh
He's saying that there are issues with saving and loading the game if the string has different values for different players.
08-24-2006, 08:03 PM#8
Thunder_Eye
saving and loading might bug if the string would remain being different to some players
EDIT: bah to slow
08-25-2006, 05:39 AM#9
PipeDream
Of course this only matters when you're sleeping later, but this is one of those places to be pedantic and safe.

BTW, I expect that it doesn't matter whether you do it != (set to "") or == (set to "path") because the string numbers are assigned at compile time for literals.