- Joined
- Sep 30, 2009
- Messages
- 698
I have a problem with the movement of my units in this trigger:
The spawn works fine, but the movements bugs.
Help will give +rep
JASS:
scope MoveAndSpawn initializer init
globals
private group g = CreateGroup()
private integer Ghoul = 'ugho'
private integer Necro = 'unec'
endglobals
private function Spawn_Actions takes nothing returns nothing
call GroupAddUnit(g, CreateUnit(Player(11), Ghoul, -1000.00, 800.00, 315.00))
call GroupAddUnit(g, CreateUnit(Player(11), Ghoul, -1000.00, 800.00, 315.00))
call GroupAddUnit(g, CreateUnit(Player(11), Necro, -1000.00, 800.00, 315.00))
endfunction
private function Move_Actions takes nothing returns nothing
local unit u
local group temp = g
loop
set u = FirstOfGroup(temp)
exitwhen u == null
call GroupRemoveUnit(temp, u)
call IssuePointOrder(u, "attack", 9300.00, -9600.00)
endloop
call DestroyGroup(temp)
endfunction
private function init takes nothing returns nothing
local trigger Move = CreateTrigger()
local trigger Spawn = CreateTrigger()
call TriggerRegisterTimerEvent(Move, 0.5, true)
call TriggerAddAction(Move, function Move_Actions)
call TriggerRegisterTimerEvent(Spawn, 10.00, true)
call TriggerAddAction(Spawn, function Spawn_Actions)
endfunction
endscope
The spawn works fine, but the movements bugs.
Help will give +rep