• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Vision of ally

Status
Not open for further replies.
Level 12
Joined
Jun 1, 2010
Messages
748
I use war/ally system. What I want it that when I type -map information and the player number I can see all ally buildings and units. Of course the player that you wish to have shared vision must be ally.

I saw this in Total War. Also, how to make the player who is asked to -accept or -decline? If it is a computer, it should not be asked to accept or decline.

I ask this because this would probably require variables and I know little about variables.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I use war/ally system. What I want it that when I type -map information and the player number I can see all ally buildings and units. Of course the player that you wish to have shared vision must be ally.

I saw this in Total War. Also, how to make the player who is asked to -accept or -decline? If it is a computer, it should not be asked to accept or decline.

I ask this because this would probably require variables and I know little about variables.

ok i made something like that in gui

here we check if players on map is user/playing and is ally, if yes then make dialog button, u get only cancel button
  • Ally dialog 1
    • Events
      • Player - Player 1 (Red) types a chat message containing -map as An exact match
      • Player - Player 2 (Blue) types a chat message containing -map as An exact match
      • Player - Player 3 (Teal) types a chat message containing -map as An exact match
      • Player - Player 4 (Purple) types a chat message containing -map as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -map as An exact match
      • Player - Player 6 (Orange) types a chat message containing -map as An exact match
      • Player - Player 7 (Green) types a chat message containing -map as An exact match
      • Player - Player 8 (Pink) types a chat message containing -map as An exact match
      • Player - Player 9 (Gray) types a chat message containing -map as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -map as An exact match
    • Conditions
    • Actions
      • Set plNR = (Player number of (Triggering player))
      • Set DialogOn[plNR] = True
      • Dialog - Clear AllyDialog[plNR]
      • Dialog - Change the title of AllyDialog[plNR] to Diplomacy
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player number of (Triggering player)) Not equal to (Integer A)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player((Integer A))) controller) Equal to User
                  • ((Player((Integer A))) slot status) Equal to Is playing
                  • ((Triggering player) is an ally of (Player((Integer A)))) Equal to True
                • Then - Actions
                  • Custom script: set udg_Ally_Dialog_Button[GetForLoopIndexA()] = DialogAddButton(udg_AllyDialog[udg_plNR], ( GetPlayerName(ConvertedPlayer(GetForLoopIndexA())) + ": Shared Vision Request!" ),0)
                • Else - Actions
            • Else - Actions
      • Custom script: set udg_Ally_Dialog_Button[0] = DialogAddButton(udg_AllyDialog[udg_plNR], "Cancel",0)
      • Dialog - Show AllyDialog[plNR] for (Player(plNR))
Prepare the reply dialog for request target

  • Ally dialog 2
    • Events
      • Dialog - A dialog button is clicked for AllyDialog[1]
      • Dialog - A dialog button is clicked for AllyDialog[2]
      • Dialog - A dialog button is clicked for AllyDialog[3]
      • Dialog - A dialog button is clicked for AllyDialog[4]
      • Dialog - A dialog button is clicked for AllyDialog[5]
      • Dialog - A dialog button is clicked for AllyDialog[6]
      • Dialog - A dialog button is clicked for AllyDialog[7]
      • Dialog - A dialog button is clicked for AllyDialog[8]
      • Dialog - A dialog button is clicked for AllyDialog[9]
      • Dialog - A dialog button is clicked for AllyDialog[10]
    • Conditions
    • Actions
      • Set plNR = (Player number of (Triggering player))
      • Set DialogOn[plNR] = False
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ally_Dialog_Button[(Integer A)] Equal to (Clicked dialog button)
            • Then - Actions
              • Set TempNr = (Integer A)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is an ally of (Player(TempNr))) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DialogOn[TempNr] Equal to True
            • Then - Actions
              • Set Ally_Request[(Player number of (Player(TempNr)))] = 0
              • Set PlayerGroup = (Player group((Player(TempNr))))
              • Game - Display to PlayerGroup for 15.00 seconds the text: ((Name of (Triggering player)) + want share vision with you but he busy at moment.)
              • Custom script: call DestroyForce(udg_PlayerGroup)
            • Else - Actions
              • Set DialogOn[TempNr] = True
              • Set Ally_Request[TempNr] = plNR
              • Dialog - Create a dialog button for AllyDialog[TempNr] labelled Reply to Shared Vis...
              • Custom script: set udg_Reply_Ally_Dialog_Button[0] = DialogAddButton(udg_AllyDialog[udg_TempNr], ( "Accept!" ),0)
              • Custom script: set udg_Reply_Ally_Dialog_Button[1] = DialogAddButton(udg_AllyDialog[udg_TempNr], ( "Decline " + GetPlayerName(ConvertedPlayer(udg_TempNr)) ),0)
        • Else - Actions
          • Set PlayerGroup = (Player group((Player(TempNr))))
          • Game - Display to PlayerGroup for 15.00 seconds the text: ((Name of (Player(TempNr))) + is enemy, cant make shared vision with enemy.)
          • Custom script: call DestroyForce(udg_PlayerGroup)
if request target clicked to accept then we make shared ally vision

  • Ally dialog 3
    • Events
      • Dialog - A dialog button is clicked for AllyDialog[1]
      • Dialog - A dialog button is clicked for AllyDialog[2]
      • Dialog - A dialog button is clicked for AllyDialog[3]
      • Dialog - A dialog button is clicked for AllyDialog[4]
      • Dialog - A dialog button is clicked for AllyDialog[5]
      • Dialog - A dialog button is clicked for AllyDialog[6]
      • Dialog - A dialog button is clicked for AllyDialog[7]
      • Dialog - A dialog button is clicked for AllyDialog[8]
      • Dialog - A dialog button is clicked for AllyDialog[9]
      • Dialog - A dialog button is clicked for AllyDialog[10]
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • Reply_Ally_Dialog_Button[1] Equal to (Clicked dialog button)
          • Reply_Ally_Dialog_Button[0] Equal to (Clicked dialog button)
    • Actions
      • Set plNR = (Player number of (Triggering player))
      • Set DialogOn[plNR] = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Reply_Ally_Dialog_Button[1] Equal to (Clicked dialog button)
        • Then - Actions
          • Player - For (Triggering player), turn Shared vision On toward (Player(Ally_Request[plNR]))
          • Player - For (Player(Ally_Request[plNR])), turn Shared vision On toward (Triggering player)
        • Else - Actions
          • Set PlayerGroup = (Player group((Player(Ally_Request[plNR]))))
          • Game - Display to PlayerGroup for 15.00 seconds the text: ((Name of (Triggering player)) + refused your request.)
          • Custom script: call DestroyForce(udg_PlayerGroup)
      • Set Ally_Request[plNR] = 0
this work with simple "-map" dont need player number, but dont tested yet because i cant test without lan or something, but i give the demo map, try it and if u have question then u can ask.

triggers simple u can copy paste to ur map
 

Attachments

  • Ally system.w3x
    19.4 KB · Views: 49
Status
Not open for further replies.
Top