- Joined
- Sep 18, 2007
- Messages
- 104
I have a trigger running on map initialization, I have 2 debug messages in this trigger, the first (1) works and appears after the initialization trigger action function is called, and the second (1a) is supposed to fire at the end of the intialization trigger action, but for some reason it doesn't. And when you see the comments like: "//Himiko", the above actions were just copied and pasted (the unit creation, adding to the group, and the loop).
JASS:
globals
group XiahouYuanUnits = CreateGroup()
group HimikoUnits = CreateGroup()
group GuoJiaUnits = CreateGroup()
group LiDianUnits = CreateGroup()
group YueJinUnits = CreateGroup()
group LiuBeiUnits = CreateGroup()
group GuanYuUnits = CreateGroup()
group ZhangFeiUnits = CreateGroup()
group MeiMeiUnits = CreateGroup()
group LiLiUnits = CreateGroup()
group MeiSanniangUnits = CreateGroup()
group ZhaoYunUnits = CreateGroup()
endglobals
function Init_Actions takes nothing returns nothing
local real x = GetRectCenterX(bj_mapInitialPlayableArea)
local real y = GetRectCenterY(bj_mapInitialPlayableArea)
//Xiahou Yuan
call CreateUnit(Player(0), 'O003', x, y, x)
call GroupAddUnit(XiahouYuanUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00B', x, y, x)
call GroupAddUnit(XiahouYuanUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Himiko
call CreateUnit(Player(1), 'H00f', x, y, x)
call GroupAddUnit(HimikoUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00C', x, y, x)
call GroupAddUnit(HimikoUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Guo Jia
call CreateUnit(Player(2), 'H00E', x, y, x)
call GroupAddUnit(GuoJiaUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00C', x, y, x)
call GroupAddUnit(GuoJiaUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Li Dian
call CreateUnit(Player(3), 'H00H', x, y, x)
call GroupAddUnit(LiDianUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'e000', x, y, x)
call GroupAddUnit(LiDianUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Yue Jin
call CreateUnit(Player(4), 'O005', x, y, x)
call GroupAddUnit(YueJinUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'e000', x, y, x)
call GroupAddUnit(LiDianUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Liu Bei
call CreateUnit(Player(5), 'O004', x, y, x)
call GroupAddUnit(LiuBeiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00C', x, y, x)
call GroupAddUnit(LiuBeiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Guan Yu
call CreateUnit(Player(6), 'H00G', x, y, x)
call GroupAddUnit(GuanYuUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00B', x, y, x)
call GroupAddUnit(GuanYuUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Zhang Fei
call CreateUnit(Player(7), 'O001', x, y, x)
call GroupAddUnit(ZhangFeiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 30
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00D', x, y, x)
call GroupAddUnit(ZhangFeiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Mei Mei
call CreateUnit(Player(7), 'E001', x, y, x)
call GroupAddUnit(MeiMeiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'e000', x, y, x)
call GroupAddUnit(MeiMeiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Li Li
call CreateUnit(Player(7), 'N000', x, y, x)
call GroupAddUnit(LiLiUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00C', x, y, x)
call GroupAddUnit(HimikoUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Mei Sanniang
call CreateUnit(Player(8), 'E002', x, y, x)
call GroupAddUnit(MeiSanniangUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00B', x, y, x)
call GroupAddUnit(MeiSanniangUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
//Zhao Yun
call CreateUnit(Player(9), 'O002', x, y, x)
call GroupAddUnit(ZhaoYunUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 50
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateUnit(GetOwningPlayer(bj_lastCreatedUnit), 'h00C', x, y, x)
call GroupAddUnit(ZhaoYunUnits, bj_lastCreatedUnit)
set bj_forLoopAIndex = (bj_forLoopAIndex + 1)
endloop
call BJDebugMsg("Debug1a")
endfunction
//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
local trigger Init = CreateTrigger()
call TriggerAddAction( Init, function Init_Actions )
call BJDebugMsg("Debug1")
endfunction
Last edited: