• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

Team/All Chat Control?

Status
Not open for further replies.
Level 5
Joined
Nov 27, 2007
Messages
85
Is it possible to control which chat mode a player uses (by default) - team chat (Ctrl-Enter) or all (Shift-Enter)?

It's a common problem in my map when during 1v1 or 1v2 the lone players (especially newcomers) use Ally Chat.
So their messages can't be seen by opposing team. Apparently it's no use, the obvious solution is to set the chat mode to All at the start of the map for that particular lone player. Is this possible?
 
Well, no, you can't really detect which players view what message. You can do this though:
  • Te
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Tri <gen> the event (Player - (Player((Integer A))) types a chat message containing <Empty String> as An exact match)
  • Tri
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - 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
              • ((Player((Integer A))) is an enemy of (Triggering player)) Equal to True //Boolean comparison, Player - Player is an enemy of Player
            • Then - Actions
              • Custom script: call DisplayTimedTextFromPlayer (Player(GetForLoopIndexA()), 0, 0, 5, GetPlayerName(GetTriggerPlayer()) + ": " + GetEventPlayerChatString())
            • Else - Actions
To get "Player(IntegerA)", when it asks you for a player, scroll to "Conversion - Convert player index to player".

The only thing this trigger lacks is the colors for each player: http://www.hiveworkshop.com/forums/jass-functions-413/player-color-utils-pcu-148188/
 
Status
Not open for further replies.
Top