- Joined
- Apr 23, 2011
- Messages
- 460
In my script to loop create a hero for each player, it's telling me when i try to compile script that it cannot convert the group to unit. What group is there in my script? I'm new to this.
Here is the full trigger script
JASS:
set udg_Hero[i]=CreateNUnitsAtLoc(1 , udg_Random[GetRandomInt(1 , 24)] , Player(i) , udg_tempLoc , bj_UNIT_FACING)
Here is the full trigger script
JASS:
function Trig_Random_Actions takes nothing returns nothing
local integer i = 0
set udg_tempLoc = (GetRectCenter(gg_rct_Hero_Spawn))
loop
exitwhen i > 11
set udg_Hero[i] = CreateUnitAtLoc( Player(i), udg_Random[GetRandomInt(1, 24)], udg_tempLoc, bj_UNIT_FACING)
set i = i + 1
endloop
call RemoveLocation(udg_tempLoc)
endfunction
//===========================================================================
function InitTrig_Random takes nothing returns nothing
local trigger RandomHero = CreateTrigger()
call TriggerRegisterDialogButtonEvent(RandomHero, udg_StartDialogButton[1])
call TriggerAddAction( RandomHero, function Trig_Random_Actions )
endfunction