Exfyre
hmm...
- Reaction score
- 60
I'm trying to make Units for all players, showing only their own units to each player.
This is supposed to get each unit in a rect that is not a hero, and then make a copy of it for each player, setting the transparency for non-owning players to 0%.
When run, each of the units are created correctly, but none of them are invisible to other players. (all players are allied)
This is supposed to get each unit in a rect that is not a hero, and then make a copy of it for each player, setting the transparency for non-owning players to 0%.
When run, each of the units are created correctly, but none of them are invisible to other players. (all players are allied)
JASS:
scope MapStart initializer Init
private function cc takes nothing returns boolean
local unit u = GetFilterUnit()
local boolean b = IsUnitType(u, UNIT_TYPE_HERO) == false
set u = null
return b
endfunction
private function Init takes nothing returns nothing
local integer i
local group g = CreateGroup()
local unit u
local unit z
call GroupEnumUnitsInRect(g, gg_rct_SS, Condition(function cc))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call SetUnitVertexColor(u, 255,255,255,0)
set i = 0
loop
set z = CreateUnit(Player(i), GetUnitTypeId(u), GetUnitX(u), GetUnitY(u), 270)
call SetUnitVertexColor(z, 255,255,255,0)
if GetLocalPlayer() == Player(i) then
call SetUnitVertexColor(z, 255,255,255,255)
endif
exitwhen i == 7
set i = i+1
endloop
endloop
endfunction
endscope