HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Indicators That Only One Player Can See? Possible?

01-15-2008, 07:30 PM#1
Salbrismind
Basically on my map I need some kind of indicator like a circle or object over a units head that only one player can see. So if player one is only supposed to it then no one else not even his allies can see. I was just going to use an invisible object that teleports to the target unit but allies would likely see it too.

Does anyone know a way to do this?
01-15-2008, 07:35 PM#2
burningice95
you can dispaly special effects with GetLocalPlayer
01-16-2008, 04:04 AM#3
DioD
add empty effect for everyone and correct to local player
01-16-2008, 04:11 AM#4
Burning Rose
Can you do that with a sound too?
01-16-2008, 04:31 AM#5
Ammorth
yes, just make sure you initialize the sound for all players, but only play it for the local player.
01-16-2008, 04:36 AM#6
Burning Rose
Awesome, cool.
01-16-2008, 07:49 PM#7
Salbrismind
Can effects be static? Such a solid circle or icon that follows a unit?
01-16-2008, 08:05 PM#8
burningice95
Quote:
Originally Posted by Salbrismind
Can effects be static? Such a solid circle or icon that follows a unit?

Yes.
01-16-2008, 08:19 PM#9
Salbrismind
Okay, i will try special effects, thanks for the help.
01-16-2008, 11:17 PM#10
Salbrismind
I can't find the command for jass or the thing for gui, how do I do what your asking exactly?
01-16-2008, 11:43 PM#11
TaintedReality
Collapse JASS:
local string sfx = ""
if(GetLocalPlayer()==YOURPLAYER) then
    set sfx = "SFX you want to show"
endif
call AddSpecialEffectTarget(sfx,TARGETWIDGET,ATTACHPOINT)

So the sfx is a null string for everyone but that specific player.
01-16-2008, 11:46 PM#12
Ammorth
no... you should do this:

Collapse JASS:
local string sfx = "SFX you want to show"
if(GetLocalPlayer()!=YOURPLAYER) then
    set sfx = ""
endif
call AddSpecialEffectTarget(sfx,TARGETWIDGET,ATTACHPOINT)

This accounts for a possible string table error (creates the string for all players) vs some players not having the proper strings in the proper indexes (could desync).
01-17-2008, 12:20 AM#13
TaintedReality
Ohh yeah, makes sense. Wasn't sure which way to go with it but I guess I chose wrong =P.
01-17-2008, 02:02 AM#14
Salbrismind
Has that exact code worked? Or is something supposed to be an array? I don't see how that could actually.
One there is no action like "Display effect for player" and you don't tell that effect creation action anything about the players your working with so how exactly does it know which player to show the effect to?
01-17-2008, 03:35 AM#15
Tide-Arc Ephemera
Things you can't do with the GetLocalPlayer() voodoo are things that physically affect gameplay, such as units, damage and doodads.

As far as I know, the given code will work. The way GetLocalPlayer() works is by manipulating or causing trigger data to occur on a specific player's computer as opposed to all computers.

Here's something on how that code works specifically:

1. Initialize a string that selects which special effect will players will see
2a. On a single selected machine, the player is not looped
2b. On the rest of the machines, the other players will be looped and the string will be set to nothing
3. The special effect withing the given string will be created for all players, since for most players it is nulled, it will not show anything to them

Hope that helped.