arrow seen by 1 player

Status
Not open for further replies.

bigdog117

B

bigdog117

is it possible to create an arrow above a unit and have it seen by a specific player

think of the select hero ability where it shows the arrow above the hero that is selected. i want that but where it doesnt auto select the unit, and able to select enemies.

also if all of that is possible, i want the arrow to only be seen when the unit with the ability is selected.
 
To make something seen only by a specific player you need to you the GetLocalPlayer() function. For it to show a special effect for only 1 player and not cause desyncs you need the code to be like this:
JASS:
local string s = ""
local effect e
if GetLocalPlayer() == YOUR_PLAYER then
    set s = YOUR_EFFECT
endif
set e = AddSpecialEffectTarget(s, YOUR_UNIT, "overhead")
set s = null
 
For the GUI solution, you simply use

  • Special Effect - Create Special Effect On Unit
For an arrow, you just check the Special Effect models or you can use an imported model.

WROOOONG!

Cause I felt like it.

The_Reborn_Devil's way is correct, however. (Although it will leak cause you'll find it difficult to destroy the arrow later without adding something else).

But why null s?
 
Status
Not open for further replies.
Back
Top