Changing b/w team and ffa modes, and All/Allies chat

Curo

Why am I still playing this game...?
Reaction score
109
My map has 2 forces of 4-man teams. When the game starts, you can choose to keep the teams, or change it to free for all. When free for all (FFA) is chosen, I use a trigger to have all players treat all other players as enemies.

My problem is that when FFA is chosen, the default chat group is still Allies, even though you have no allies. Most players don't realize this, and keep typing to Allies without switching to All chat, and thus their chat messages get lost.

Is there any way to change which chat group a player talks to (via trigger or other WE function)?

My only idea was to have the game start off as FFA, and use triggers to change into teams if the players so desire. Still though, the default chat group will now be All. And there also may be problems with players not knowing which team they are on, since the game room wouldn't be divided into teams.
 

Corleone

New Member
Reaction score
44
This should do the trick:
JASS:
function Trig_Text_message_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), ( ( "[" + ( GetPlayerName(GetTriggerPlayer()) + "]" ) ) + ( ": " + GetEventPlayerChatString() ) ) )
endfunction

//===========================================================================
function InitTrig_Text_message takes nothing returns nothing
    set gg_trg_Text_message = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Text_message, Player(0), "", true )
    call TriggerAddAction( gg_trg_Text_message, function Trig_Text_message_Actions )
endfunction



It's a very simple function that checks whether a player has typed a non-empty chat message. Then it simply shows that text message to every player.

EDIT: This trigger can of course easily be modified to show the message to a player's allies.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top