- Joined
- Oct 24, 2012
- Messages
- 6,545
requires return it also doesnt add unit u to group ?
umm i have this problem im not sure y this requires a return can anyone tell me y does this require a return ? also i have another problem w it y does it not add unit u to the group ?
notes: this is only for player 0 i have another for player 1 tht is the exact same thing except it doesnt require a return ?
umm i have this problem im not sure y this requires a return can anyone tell me y does this require a return ? also i have another problem w it y does it not add unit u to the group ?
JASS:
function Trig_Unit_Spawn_Red_all_Lvls_Actions takes nothing returns boolean
local integer LoopA = 1
local integer Unit_Runner
local real rx = GetRectCenterX(gg_rct_red_start)
local real ry = GetRectCenterY(gg_rct_red_start)
local real bx = GetRectCenterX(gg_rct_P11_Battleground_Spawn)
local real by = GetRectCenterY(gg_rct_P11_Battleground_Spawn)
local integer us
local integer ub
local unit u
call DisableTrigger( trg_Unit_Spawn_Red_all_Lvls )
set udg_Damage_Boss_Round_Count_Player[0] = udg_Damage_Boss_Round_Count_Player[0] + 1
set udg_EnemiesAlive_Counter_Player[0] = udg_Number_Of_Unit_Spawns_Player[0]//#of unit spawns is a selected number of spawns in the game
set udg_Boss_Bonus_Counter[0] = udg_Boss_Bonus_Counter[0] + 1//used for giving players mana to summon a boss
set Round_Player[0] = ( Round_Player[0] + 1 )
call MultiboardSetItemValueBJ( udg_MultiBoard_Game_Scores, 2, 2, I2S(Round_Player[0]) )
if ( udg_Round_Player[0] <= 31) then
set us = Unit_Runner_Spawn[Round_Player[0]]
set ub = Battlegrounds_Spawn[Round_Player[0]]
elseif ( udg_Round_Player[0] > 31) then
set us = Unit_Runner_Spawn[31]
set ub = Battlegrounds_Spawn[31]
endif
if ( udg_Boss_Bonus_Counter[0] == 5 ) then
set udg_Boss_Add_Mana_Boolean_Player[0] = true
set udg_Boss_Bonus_Counter[0] = 0
endif
loop //loops for spawning units into map for player 1 ( i do not use 0 for players gets annoying )
exitwhen LoopA > udg_Number_Of_Unit_Spawns_Player[0] // variable tht allows player to pick # of enemy units per round
set udg_Unit_Spawns_Red[LoopA] = CreateUnit(Player(11), us, rx, ry, 0)
call GroupAddUnit(Unit_Spawns_Group_Player[0], udg_Unit_Spawns_Red[LoopA])
call SetHeroLevel( udg_Unit_Spawns_Red[LoopA], ( Round_Player[0] - 30 ), false )
set EnemiesAlive_Player[0] = ( EnemiesAlive_Player[0] + 1 ) //multiboard variable enemies alive
call MultiboardSetItemValueBJ( udg_MultiBoard_Game_Scores, 2, 6, I2S(EnemiesAlive_Player[0]) )
call PolledWait( udg_Spawn_Speed_Player[0] )//set the speed between enemy spawns
set u = CreateUnit(Player(11), ub, bx, by, 0)
call GroupAddUnit(Battlegrounds_Group_Player[11], u)
set LoopA = LoopA + 1
endloop
set u = null
return false
endfunction
//===========================================================================
function InitTrig_Unit_Spawn_Red_all_Lvls takes nothing returns nothing
set trg_Unit_Spawn_Red_all_Lvls = CreateTrigger()
call TriggerRegisterPlayerEvent(trg_Unit_Spawn_Red_all_Lvls, Player(0), EVENT_PLAYER_END_CINEMATIC)
call TriggerRegisterPlayerChatEvent( trg_Unit_Spawn_Red_all_Lvls, Player(0), ( "-go" ), true )
call TriggerAddAction( trg_Unit_Spawn_Red_all_Lvls, function Trig_Unit_Spawn_Red_all_Lvls_Actions )
endfunction
JASS:
function Trig_Unit_Spawn_Blue_all_Lvls_Actions takes nothing returns nothing
local integer LoopB = 1
local integer Unit_Runner
local real rx = GetRectCenterX(gg_rct_blue_start)
local real ry = GetRectCenterY(gg_rct_blue_start)
local real bx = GetRectCenterX(gg_rct_P11_Battleground_Spawn)
local real by = GetRectCenterY(gg_rct_P11_Battleground_Spawn)
local integer us
local integer ub
local unit u
call DisableTrigger( trg_Unit_Spawn_Blue_all_Lvls )
set udg_Damage_Boss_Round_Count_Player[1] = ( udg_Damage_Boss_Round_Count_Player[1] + 1 )
set udg_EnemiesAlive_Counter_Player[1] = udg_Number_Of_Unit_Spawns_Player[1]
set udg_Boss_Bonus_Counter[1] = ( udg_Boss_Bonus_Counter[1] + 1 )
set Round_Player[1] = ( Round_Player[1] + 1 )
call MultiboardSetItemValueBJ( udg_MultiBoard_Game_Scores, 3, 2, I2S(udg_Round_Player[1]) )
if ( udg_Round_Player[0] <= 31) then
set us = Unit_Runner_Spawn[Round_Player[1]]
set ub = Battlegrounds_Spawn[Round_Player[1]]
elseif ( udg_Round_Player[1] > 31) then
set us = Unit_Runner_Spawn[31]
set ub = Battlegrounds_Spawn[31]
endif
if ( udg_Boss_Bonus_Counter[1] == 5 ) then
set udg_Boss_Add_Mana_Boolean_Player[1] = true
set udg_Boss_Bonus_Counter[1] = 0
endif
loop
exitwhen LoopB > udg_Number_Of_Unit_Spawns_Player[1]
set udg_Unit_Spawns_Blue[LoopB] = CreateUnit(Player(11), us, rx, ry, 0)
call GroupAddUnit(Unit_Spawns_Group_Player[1], udg_Unit_Spawns_Blue[LoopB])
call SetHeroLevel( udg_Unit_Spawns_Blue[LoopB], ( Round_Player[1] - 30 ), false )
set EnemiesAlive_Player[1] = ( EnemiesAlive_Player[1] + 1 )
call MultiboardSetItemValueBJ( udg_MultiBoard_Game_Scores, 3, 6, I2S(EnemiesAlive_Player[1]) )
call PolledWait( udg_Spawn_Speed_Player[1] )
set u = CreateUnit(Player(11), ub, bx, by, 0)
call GroupAddUnit(Battlegrounds_Group_Player[11], u)
set LoopB = LoopB + 1
endloop
set u = null
endfunction
//===========================================================================
function InitTrig_Unit_Spawn_Blue_all_Lvls takes nothing returns nothing
set trg_Unit_Spawn_Blue_all_Lvls = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( trg_Unit_Spawn_Blue_all_Lvls, Player(1) )
call TriggerRegisterPlayerChatEvent( trg_Unit_Spawn_Blue_all_Lvls, Player(1), ( "-go" ), true )
call TriggerAddAction( trg_Unit_Spawn_Blue_all_Lvls, function Trig_Unit_Spawn_Blue_all_Lvls_Actions )
endfunction
notes: this is only for player 0 i have another for player 1 tht is the exact same thing except it doesnt require a return ?
Last edited: