| 02-06-2007, 03:28 AM | #1 |
Got it working, but how do I add things to its Actions to loop? like in GUI JASS:function mfs takes nothing returns nothing local group g local location loc local integer l set l = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit()) set loc = GetUnitLoc(GetTriggerUnit()) set g = GetUnitsInRangeOfLocAll(200.00 * l, loc) call ForGroupBJ(g,function mfs) endfunction |
| 02-06-2007, 03:57 AM | #2 |
Guest | JASS:function Trig_Trigger_Func004A takes nothing returns nothing (your actions here) endfunction function Trig_Trigger_Actions takes nothing returns nothing local group g local location loc local integer l set l = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit()) set loc = GetUnitLoc(GetTriggerUnit()) set g = GetUnitsInRangeOfLocAll(( 200.00 * I2R(l) ), loc) call ForGroupBJ( g, function Trig_Trigger_Func004A ) endfunction |
| 02-06-2007, 04:05 AM | #3 |
JASS:function randomfunction takes nothing returns nothing //[all stuff to do in the forgroup] endfunction function mfs takes nothing returns nothing local group g local location loc local integer l set l = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit()) set loc = GetUnitLoc(GetTriggerUnit()) set g = GetUnitsInRangeOfLocAll(200.00 * l, loc) call ForGroupBJ(g,function randomfunction) endfunction |
| 02-07-2007, 12:11 AM | #4 |
Is that better than using FirstOfGroup() and looping through all the units in the group? |
| 02-07-2007, 12:17 AM | #5 |
ForGroup is faster, but the FirstOfGroup is helpful if everything needs to be kept in 1 function. |
| 02-07-2007, 12:24 AM | #6 |
Oh. Rep'd! |
