Cohadar
master of fugue
- Reaction score
- 209
Have you ever wanted to see hero icons of your allied players?
(without being able to control them)
Now I have a problem with this, it works but for up to 5 players in one team.
(One hero icon and 4 allied icons are always shown)
So it is great idea for 5vs5 AoS maps
But if you want to make 7 player map (7 samurai, 7 illidans ...)
It does not work because wc3 reserves 3 hero slots for player's heroes,
so only 4 can be used for allies.
(see the attached map)
Can anyone find a solution for this to work for 7 players?
(without being able to control them)
JASS:
scope ShowAllyIcons initializer Init
//===========================================================================
// The trick is to give advanced control but not shared control
// That way you see allied hero icons, but cannot control them
//===========================================================================
private function SetAlliance takes player sourcePlayer, player otherPlayer returns nothing
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_VISION, true)
//call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_CONTROL, true)
call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_ADVANCED_CONTROL, true)
endfunction
//===========================================================================
private function Conditions takes nothing returns boolean
return true
endfunction
//===========================================================================
// Sets same alliances between 7 starting players
//===========================================================================
private function Actions takes nothing returns nothing
local integer i = 0
local integer j
loop
exitwhen i>=6
set j = i + 1
loop
exitwhen j>=7
call SetAlliance(Player(i), Player(j))
call SetAlliance(Player(j), Player(i))
set j = j + 1
endloop
set i = i + 1
endloop
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterTimerEventSingle( trig, 0.00 )
call TriggerAddCondition( trig, Condition( function Conditions ) )
call TriggerAddAction( trig, function Actions )
endfunction
endscope
Now I have a problem with this, it works but for up to 5 players in one team.
(One hero icon and 4 allied icons are always shown)
So it is great idea for 5vs5 AoS maps
But if you want to make 7 player map (7 samurai, 7 illidans ...)
It does not work because wc3 reserves 3 hero slots for player's heroes,
so only 4 can be used for allies.
(see the attached map)
Can anyone find a solution for this to work for 7 players?