• 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.

arrow seen by 1 player

Status
Not open for further replies.
Level 2
Joined
Oct 5, 2008
Messages
7
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.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
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
 
Level 8
Joined
Mar 20, 2007
Messages
224
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.
Top