My friends and I have been playing a lot of the map named Lightcycles, and to our surprise, it was actually unlocked. So we've set about trying to add a team mode to it, because it adds a fun new dynamic. But, the map itself has all of the default blizzard UI turned off, which means that the normally "Toggle Ally Colors" button is gone, so the keybinding for it doesn't even work. I've been trying to add it back, but I just can't seem to figure it out. Any ideas?
The first time I hit alt+f, it turns on the team colors fine. All of the players change colors like expected. But hitting it again just doesn't do anything. The team colors just always stay on. Any ideas?
Local variables only exist for as long as the scope they're declared in does. Every time your trigger fires, it initializes "TeamColors" as a new Ally Color Setting with the default value. Because of this, it's always "Normal Colors" at the time you check its value, so your trigger will always set the triggering player's ally color setting to "Team Colors for Minimap and Game View".
One solution is to instead keep track of each player's setting using a global Ally Color Setting array which is indexed by player. Assuming you use the same variable name for the global, the correct trigger would look similar to this:
EventsUI-PlayerAnyPlayerpressesFkeyDownwithshiftExclude,controlExclude,altRequireLocalVariablesplayer=(Triggeringplayer)<Integer>ConditionsActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfTeamColors[player] == Normal Colors
Then
Variable - Set TeamColors[player] = Team Colors for Minimap and Game View
UI - Lock ally color settings for players in (Player group(player)) to TeamColors[player]
Else
Variable - Set TeamColors[player] = Normal Colors
UI - Lock ally color settings for players in (Player group(player)) to TeamColors[player]
My friends and I have been playing a lot of the map named Lightcycles, and to our surprise, it was actually unlocked. So we've set about trying to add a team mode to it, because it adds a fun new dynamic. But, the map itself has all of the default blizzard UI turned off, which means that the normally "Toggle Ally Colors" button is gone, so the keybinding for it doesn't even work. I've been trying to add it back, but I just can't seem to figure it out. Any ideas?
Here's what I have:
The first time I hit alt+f, it turns on the team colors fine. All of the players change colors like expected. But hitting it again just doesn't do anything. The team colors just always stay on. Any ideas?
Local variables only exist for as long as the scope they're declared in does. Every time your trigger fires, it initializes "TeamColors" as a new Ally Color Setting with the default value. Because of this, it's always "Normal Colors" at the time you check its value, so your trigger will always set the triggering player's ally color setting to "Team Colors for Minimap and Game View".
One solution is to instead keep track of each player's setting using a global Ally Color Setting array which is indexed by player. Assuming you use the same variable name for the global, the correct trigger would look similar to this:
Thanks! Worked perfectly.