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

Vision for only one player

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
579
Hi there.
Let's say two of my players treat each other as allies with shared vision.
Is there any way for one player to see the entire map so that the other one didn't (without making them allies without shared vision)?

Thanks for help in advance :)
 
Level 13
Joined
Oct 12, 2016
Messages
769
Well, you could disable shared vision for a moment, then reveal the map for player X, and then afterwards make them have shared vision again.
By definition, shared vision means that: they will share all vision.
If there's another way around that, I imagine it would be extremely difficult.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
JASS:
native CreateFogModifierRect takes player forWhichPlayer, fogstate whichState, rect where, boolean useSharedVision, boolean afterUnits returns fogmodifier
The function to create visibility modifiers contains a boolean useSharedVision. It might be helpful in this situation.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
What if we use a dummy player that has the whole map revealed for himself and is shared with P2 ?

In theory (just thinking about it) sharing vision is what your units can see, not what you or your allies can see, so you'd be sharing only the vision of yourself, not you and your allies.
E.g. if we do: P1 <> P2 < P3, P1 should not see what P3 sees, P3 is the dummy player.

50/50 to be wrong, depending how Blizzard have coded the shared vision mechanics.

Regards
-Ned
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
The dummy player solution from Ned seems to work the best.
Using a visibility modifier as I described above only works partially. The vision is not shared, but the area is explored, so the black mask is removed, whereas the fog of war still exists.

So if you have a player free, use that dummy player.
 
Level 10
Joined
Mar 17, 2012
Messages
579
What if we use a dummy player that has the whole map revealed for himself and is shared with P2 ?

In theory (just thinking about it) sharing vision is what your units can see, not what you or your allies can see, so you'd be sharing only the vision of yourself, not you and your allies.
E.g. if we do: P1 <> P2 < P3, P1 should not see what P3 sees, P3 is the dummy player.

50/50 to be wrong, depending how Blizzard have coded the shared vision mechanics.

Regards
-Ned
I don't think I quite catch you. Could you explain on the expample or show me the piece of trigger with that? :)
 
Level 9
Joined
Apr 23, 2011
Messages
527
I don't think I quite catch you. Could you explain on the expample or show me the piece of trigger with that? :)

Say Player 3 (Teal) is the dummy player:
  • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across (Playable map area)
  • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
  • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
  • Player - Make Player 3 (Teal) treat Player 2 (Blue) as an Ally with shared vision
Should work, I tried it on a test map.
 
Last edited:
Level 10
Joined
Mar 17, 2012
Messages
579
Say Player 3 (Teal) is the dummy player:
  • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across (Playable map area)
  • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
  • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
  • Player - Make Player 3 (Teal) treat Player 2 (Blue) as an Ally with shared vision
Should work, I tried it on a test map.
But then it will reveal the entire map to the ally and I need the map to be revealed to only one player who is allied with 5 more.
If I make a vision modifier, it reveals the map to everyone in the alliance.
 
Level 9
Joined
Apr 23, 2011
Messages
527
But then it will reveal the entire map to the ally and I need the map to be revealed to only one player who is allied with 5 more.
If I make a vision modifier, it reveals the map to everyone in the alliance.

AFAIR when I tested this, I switched player slots and I did not get vision when I was Player 1.
The logic that goes is that since Player 1 isn't in an alliance with Player 3 (who has the visibility modifier), it will not receive the all-map vision?

I might be wrong, have you tried it on your end?
 
Level 10
Joined
Mar 17, 2012
Messages
579
AFAIR when I tested this, I switched player slots and I did not get vision when I was Player 1.
The logic that goes is that since Player 1 isn't in an alliance with Player 3 (who has the visibility modifier), it will not receive the all-map vision?

I might be wrong, have you tried it on your end?

I guess I foun the solution, thanks :)
 
Status
Not open for further replies.
Top