• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Invisibility question

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Invisibility is a flag. It affects either all players (on) or no players (off). As such it is not possible.

However, you could reveal it for all but specific players. If you give all other players detection of the unit then it will be "invisible" as far as the flag is concerned but not invisible to those players.

Yes, using GetLocalPlayer().
No, that would control invisibility for specific clients, not players. On those clients it would either not be invisible to all players, or be invisible to all players. It will also more than likely cause the clients to OOS if used in combat.
 
Level 25
Joined
May 11, 2007
Messages
4,651
A very shitty way of only making it invisible for a player:
Give the unit the invisibility ability.

Then for all the players that should be able to see the invisible unit, make give them the true sight ability to their units. You can use a spellbook to hide the icon if you want.

For the player who should not see the invisible unit, simply do not give the true sight ability to hen.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
A very shitty way of only making it invisible for a player:
Give the unit the invisibility ability.

Then for all the players that should be able to see the invisible unit, make give them the true sight ability to their units. You can use a spellbook to hide the icon if you want.

For the player who should not see the invisible unit, simply do not give the true sight ability to hen.

Might work in an ideal world where no players ally with each other.
 
Level 11
Joined
Jan 23, 2015
Messages
788
A very shitty way of only making it invisible for a player:
Give the unit the invisibility ability.

Then for all the players that should be able to see the invisible unit, make give them the true sight ability to their units. You can use a spellbook to hide the icon if you want.

For the player who should not see the invisible unit, simply do not give the true sight ability to hen.

But that will also show the other nearby invisible units. I wonder how dust works, does it reveal invisible only to the owner of the caster or to everyone?

Invisibility is a flag. It affects either all players (on) or no players (off). As such it is not possible.

However, you could reveal it for all but specific players. If you give all other players detection of the unit then it will be "invisible" as far as the flag is concerned but not invisible to those players.

Yes, using GetLocalPlayer().

No, that would control invisibility for specific clients, not players. On those clients it would either not be invisible to all players, or be invisible to all players. It will also more than likely cause the clients to OOS if used in combat.

Are you talking about the trigger "flag"? I can't understand you well.
 
Level 11
Joined
Jan 23, 2015
Messages
788
You see, that's exactly what I need! :D
I'll create a dummy unit at the position of the invisible unit, and cast dust (which AOE is modified to 1 and duration to 1 sec) every 1 sec if it fulfills the condition. What do you say about that?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You should not use the GetLocalPlayer for this because this affects unit's behavior.
(Yes it does.)

As DSG and LDZ mentioned:
What you could do is make them invisible to all players and for the ones who should see them, you could give those a dummy unit with true sight.

However... why not give that dummy unit a dummy true sight with 1 range?
That dummy will follow the target in a 0.03 interval so it will keep the other in sight.
It will also not show nearby invisible units as the range is too low for that.

That would be the best guess I think...
However, there might be another way to achieve what you want.
 
Level 11
Joined
Jan 23, 2015
Messages
788
You should not use the GetLocalPlayer for this because this affects unit's behavior.
(Yes it does.)

As DSG and LDZ mentioned:
What you could do is make them invisible to all players and for the ones who should see them, you could give those a dummy unit with true sight.

However... why not give that dummy unit a dummy true sight with 1 range?
That dummy will follow the target in a 0.03 interval so it will keep the other in sight.
It will also not show nearby invisible units as the range is too low for that.

That would be the best guess I think...
However, there might be another way to achieve what you want.

lol, well that idea sounds better haha, alright thank you all guys, problem solved! :)
 
Status
Not open for further replies.
Top