• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

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