Imitating Observer on defeat? HELP

Status
Not open for further replies.
Soo, I wam tryign to create a command that when you type -obs you become an observer and you can see the whole map. However the problem is that your ally can see it too!
I want to fix this problem, I tried few things but without result. I post the triggers here.

I want the surrendering player to become observer and see the whole map without sharing it to his allies and also to share full unit control when he becoems observer.

  • Obs Command
    • Events
      • Player - Player 1 (Red) types a chat message containing -obs as An exact match
      • Player - Player 2 (Blue) types a chat message containing -obs as An exact match
      • Player - Player 3 (Teal) types a chat message containing -obs as An exact match
      • Player - Player 4 (Purple) types a chat message containing -obs as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -obs as An exact match
      • Player - Player 6 (Orange) types a chat message containing -obs as An exact match
      • Player - Player 7 (Green) types a chat message containing -obs as An exact match
      • Player - Player 8 (Pink) types a chat message containing -obs as An exact match
      • Player - Player 9 (Gray) types a chat message containing -obs as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -obs as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -obs as An exact match
      • Player - Player 12 (Brown) types a chat message containing -obs as An exact match
    • Conditions
    • Actions
      • Set TempInt = (Player number of (Triggering player))
      • Set TempPlayer = (Player(TempInt))
      • Set TempObsCommInt = (TempInt - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsObserver[TempInt] Equal to False
        • Then - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by TempPlayer) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Stop
          • Game - Display to (All players) for 30.00 seconds the text: ((Name of TempPlayer) + |r surrendered! He is now an observer.)
          • Player Group - Pick every player in (All allies of TempPlayer) and do (Actions)
            • Loop - Actions
              • Player - Make TempPlayer treat (Picked player) as an Neutral
              • Player - For TempPlayer, turn Full shared units On toward (Picked player)
          • Set IsObserver[TempInt] = True
          • -------- make obs --------
          • Custom script: call SetPlayerState(Player(udg_TempObsCommInt),PLAYER_STATE_OBSERVER,1)
          • Visibility - Create an initially Enabled visibility modifier for TempPlayer emitting Visibility across (Playable map area)
          • Visibility - Enable (Last created visibility modifier)
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,861
It looks like it should work. Maybe try something like this?
  • Example
    • Events
      • Player - Player 1 (Red) types a chat message containing -obs as An exact match
    • Conditions
    • Actions
      • Set VariableSet TempPlayer = (Triggering player)
      • Set VariableSet PlayerG = (Player group(TempPlayer))
      • Set VariableSet AlliesG = (All allies of TempPlayer.)
      • Player Group - Make PlayerG treat AlliesG as an Neutral
      • Player Group - Pick every player in AlliesG and do (Actions)
        • Loop - Actions
          • Player - For TempPlayer, turn Full shared units On toward (Picked player)
          • Player - For TempPlayer, turn Shared vision Off toward (Picked player)
 
Status
Not open for further replies.
Top