- Joined
- May 4, 2007
- Messages
- 2,260
Hi guys, here I am again. This time i need help with the reward system for my map.
It basically creates a well ordered army in a square battle position. But I have a trouble. My arrays don't work.
As you can see, it creates 4 melee dwarfs warriors. Then orders their row to move 95 meters forwards.
After that creates a second row of units. And there is the problem. The unit are created, but they don't seem to get the order. They just don't move forward. Can you guys tell me why ?
It basically creates a well ordered army in a square battle position. But I have a trouble. My arrays don't work.
JASS:
//creates a row of 4 melee dwarfs
//variables:
//local integer counter = 0
//local unit array m //it ill store the melee dwarfs
loop
exitwhen (counter == 4)
set m[counter] = CreateUnit(c, 'h00B', x, y, 270.00)
call UnitApplyTimedLife(CreateUnit(c, 'h01B', x, y, 0.00),'BTLF',1.00)
call SetUnitInvulnerable(m[counter], true)
call SetUnitMoveSpeed( m[counter], ( GetUnitDefaultMoveSpeed(m[counter])/2))
set x = x + 95
set counter = counter + 1
endloop
set counter = 0
set y = 4545.0
set x = -6160.0
//orders this created row to move forwards
loop
exitwhen (counter == 4)
call IssuePointOrder(m[counter], "move", x, y)
set x = x + 95
set counter = counter + 1
endloop
call TriggerSleepAction(0.75)
//creates a second row of melee dwarfs
set counter = 5
set x = -6160.0
set y = 5335.5
loop
exitwhen (counter == 9)
set m[counter] = CreateUnit(c, 'h00B', x, y, 270.00)
call UnitApplyTimedLife(CreateUnit(c, 'h01B', x, y, 0.00),'BTLF',1.00)
call SetUnitInvulnerable(m[counter], true)
call SetUnitMoveSpeed( m[counter], ( GetUnitDefaultMoveSpeed(m[counter])/2))
set x = x + 95
set counter = counter + 1
endloop
//orders the second row to move forwards
set counter = 5
set y = 4635.0
set x = -6160.0
loop
exitwhen (counter == 9)
call IssuePointOrder(m[counter], "move", x, y)
set x = x + 95
set counter = counter + 1
endloop
After that creates a second row of units. And there is the problem. The unit are created, but they don't seem to get the order. They just don't move forward. Can you guys tell me why ?