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

Is local hide possible?

Status
Not open for further replies.
Level 19
Joined
Jul 2, 2011
Messages
2,162
yes it's possible.

only their spells will show but projectiles won't..

uses the trigger.

unit hide...

simple as that. to reveal the unit only to some people you will have to ask someone who is behind a computer because well I'm not

I think it's also a trig

player... shared vision?

I'm not sure
 
If you hide a unit locally for one player, then any interactions that the unit does will cause a desync. Hidden units can do very few things, so when the controlling player orders the unit to do anything, those orders might not be reflected in the "hidden" version. Wc3 notices that the unit is out of sync between players, and kicks people.

That is why it is pretty much necessary to do something relating to invisibility. But it is actually a lot of work. I think I implemented something for it a long time ago, but I don't remember the details. Here are some pointers:
(1) Invisibility can be detected. Use that to your advantage. Let's say you want to hide a unit for all players except two. One way is to make a dummy unit for those two players with some sort of invisibility detection (with a very low sight radius), and periodically put it near that unit (e.g. every 0.03 seconds).
(2) Hiding projectiles is difficult. It is tough to do without triggering projectiles themselves.
(3) If two invisible units are stacked on top of each other, you might end up with a situation where you end up seeing units you shouldn't see. In my case, that wasn't possible because the hero was unique. But it might be possible in your map. It depends on what you want to hide the unit for.
(4) If you want invisibility detection in your game, you'll have to trigger it using a similar method (create a dummy unit and place it close). This is so that you won't see the units you want to be "hidden".
(5) Add the ability "Ghost" and "Permanent Invisibility" so that the unit will stay invisible even while attacking.

Experiment with it. It requires a lot of testing, but it worked decently well (I think) when I implemented it back then.

P.S. Moving to WEHZ.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Yes, you can locally hide a unit.
Yes, if you use it for what you want to use it for, your game will crash.
Yes, PurgeandFire did explain to you how a very good alternative can be made.

But I would like to know what you exactly need.
 
Level 12
Joined
May 20, 2009
Messages
822
Could you momentarily swap the unit out with a different unit that doesn't have a model? Then just make a new model using special effects or something over it, which iirc can be hidden/shown to local players using a trick. I suppose if you wanted animations that wouldn't work.
 
Level 15
Joined
Aug 14, 2007
Messages
936
Suggestion, mess around with ally properties if you intend the local system. The local don't work due to some network issues on the server end which is why you are here. The ally properties I am refering to is the sharing of vision to all allies. It is a good thing to have since the popularization of "DotA" but for this sake, I want you to do ally without shared vision. This also won't work if there is true sight (invisible detection of any sorts). As you may have imagined, you have to ignore the trolls saying "Where the fuck is true sight" and go ahead with your development (fuck them). Anyways, by integrating invisibility and non shared vision you have a magic coming in. Another thing, if you want to share vision manually for each unit, you can alter it with the Unit - Apply Vision of Unit to Player (I am sure I labelled it wrong but find it). This will allow you to control vision of any sorts and customize the wonderful and dreamy game you are looking for young one.
 
Level 4
Joined
Sep 13, 2014
Messages
106
Local unit hide can be achieved with GetLocalPlayer() and SetUnitVertexColor(). See my map for the WC3 fun mapmaking challenge, in the arena forum, it is unprotected. They can still attack and stuff, but if you were to prevent that for only certain people it would obviously cause a desync.

Edit: I attached my map to this post.

Edit Edit: Never mind, apparently you cannot attach a file to a post if you have already attached it to a post elsewhere. Here is the post: http://www.hiveworkshop.com/forums/2822840-post371.html
 
Status
Not open for further replies.
Top