- Joined
- Jul 1, 2008
- Messages
- 1,314
Hey guys,
i got this trigger. I want it to create, when executed, simply 4 units in 3 random rectangles.
I tried to add a Debugg-Message, and this Jass-Trigger isnt even executed, because the Message isnt shown at the screen.
Can you help me?
Thanks in advance,
Emm-A-
i got this trigger. I want it to create, when executed, simply 4 units in 3 random rectangles.
I tried to add a Debugg-Message, and this Jass-Trigger isnt even executed, because the Message isnt shown at the screen.
Can you help me?
JASS:
function Hirsche_Check takes nothing returns boolean
local unit U = GetEnumUnit()
if GetUnitTypeId(U) == 'nder' or GetUnitTypeId(U) == 'n007' then
set U = null
return true
endif
set U = null
return false
endfunction
function Hirsche_Spawn_Actions takes nothing returns nothing
local location array SpawnRects
local integer random = GetRandomInt(0,2)
local group Hirsche = CreateGroup()
call GroupEnumUnitsInRect(Hirsche, GetPlayableMapRect(), Condition(function Hirsche_Check))
set SpawnRects[0] = Location(GetRectCenterX(gg_rct_1),GetRectCenterY(gg_rct_1))
set SpawnRects[1] = Location(GetRectCenterX(gg_rct_2),GetRectCenterY(gg_rct_2))
set SpawnRects[2] = Location(GetRectCenterX(gg_rct_3),GetRectCenterY(gg_rct_3))
// Zuviele Hirsche?
if CountUnitsInGroup(Hirsche) < 50 then
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'hf00',SpawnRects[random],270.00)
set random = GetRandomInt(0,2)
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'nder',SpawnRects[random],270.00)
set random = GetRandomInt(0,2)
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'nder',SpawnRects[random],270.00)
// Goldhirsch
set random = GetRandomInt(0,2)
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'hfoo',SpawnRects[random],270.00)
endif
// i put the test message here, it does not getting executed!
// reset
call RemoveLocation(SpawnRects[0])
call RemoveLocation(SpawnRects[1])
call RemoveLocation(SpawnRects[2])
set SpawnRects[0] = null
set SpawnRects[1] = null
set SpawnRects[2] = null
call DestroyGroup(Hirsche)
set Hirsche = null
endfunction
//==== Init Trigger Hirsche Spawn ====
function InitTrig_Hirsche_Spawn takes nothing returns nothing
local trigger Hirsche_Spawn = CreateTrigger()
call TriggerAddAction(Hirsche_Spawn, function Hirsche_Spawn_Actions)
set Hirsche_Spawn = null
endfunction
Thanks in advance,
Emm-A-