- Joined
- Oct 10, 2010
- Messages
- 71
Hello, I've started with JASS and I've encoutered first problem
Problem is whenever loop is fired, it gets all units from "Picked_enemies" group and moves "u" unit to their localization
Code:
loop
set temp_unit = FirstOfGroup(picked_enemies)
exitwhen temp_unit == null
call PauseUnit(temp_unit,true)
call SetUnitX(u,GetUnitX(temp_unit))
call SetUnitY(u,GetUnitY(temp_unit))
call GroupRemoveUnit(picked_enemies, temp_unit)
call SetUnitAnimation(u,"Attack")
call UnitDamageTarget(u,temp_unit,500,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_METAL_LIGHT_CHOP)
call PauseUnit(temp_unit,false)
call PolledWait(0.3)
call DisplayTimedTextToForce( GetPlayersAll(), 30, "Zaatakowano na " + R2S(GetUnitX(temp_unit)) + "," + R2S(GetUnitY(temp_unit)) )
endloop
Problem is whenever loop is fired, it gets all units from "Picked_enemies" group and moves "u" unit to their localization