• 🏆 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!

Showing/Hiding a unit for a specific player

Status
Not open for further replies.
Level 16
Joined
Aug 7, 2009
Messages
1,403
*Solved*

As the name says, I want to hide two of my heroes for everyone, except for their owners (they should be able to see one another). Has anyone found a way to do it?

Thing that I've tried so far:
-Permanent Invisibility: has already failed me, casting a spell or performing an attack will break it for a couple of seconds.
-Vertex colours: do not affect particle emitters, they remain perfectly visible.

I'd be very grateful if someone could help me out, might also include their name on the credits, because this is a very important thing that I want to get work really bad.
 
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
This is what you want but you should look for something else really
JASS:
if not GetLocalPlayer() == Player(0) then
    call ShowUnit(whichunit, false)
endif
because:
if the hidden unit interacts with any handle(i think, I know if it interacts with units) it will desync(idk who but it will).
For instance if the hidden unit attacks someone for who the unit is hidden it will desync for 100%
 
The problem is most likely with selecting. Even if you do stuff with vertex colors you can still select. You can always try locally setting the scale or fly height (in addition to the vertex colors) and perhaps that may work, but I am not sure how you will solve the selection problem.

You may have to mess with invisibility a bit, since it ends up being the cleanest solution. Whenever the unit attacks or breaks it, re-add invisibilty. If permanent invisibility doesn't work in that situation, you can try a modded sorceress invisibility spell. To get rid of the annoying model + sound, you coud import a blank model over the invisibility model's path. (unless they let you change the buff's effect by itself, I don't remember)
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
@edo494: the heroes wouldn't even have to attack or do anything, using ShowUnit in a local block will create a different pathing map for different players, so only crossing them would cause desync.

PurgeandFire111: doesn't SetUnitScale modify the unit's pathing? I was thinking of using it myself, but I wasn't sure if it's safe to use it. I think I'll give it a try in the following days (depends on my friend, really), hopefully it'll work.

P.s: Sorcerer's Invisibility also breaks upon casting a spell or performing an attack :S
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I have no experience with GetLocalPlayer :D so I only though of what could happen :D

Also Im not 100% sure but i think any invisible will be broke upon damage.
But if i think about it slark(murloc) in dota has invisible which doesnt break when he damages so idk really :D
At least this shows its possible
edit:
oy, ive found something:

Apiv, Agho, Aeth (Permanent Invisibility, Ghost, Ghost Visible): These abilities make units invisible without the tradeoffs of setting them invisible with triggers. Often this is a better solution than pausing units or adding locust. Units with permanent invisibility will lose their invisibility temporarily while they are attacking. So the ability can be used to create units like spirit wolfs at level three. Units that have both Permanent Invisibility and Ghost stay hidden, even while they are attacking. The Aeye (Sentry Ward) spell adds permanent invisibility to the summoned unit automatically by the way.
on http://www.wc3c.net/showthread.php?t=81742
 
Status
Not open for further replies.
Top