Doomhammer
Bob Kotick - Gamers' corporate spoilsport No. 1
- Reaction score
- 67
Hey,
I'm sure you've all seen the Starcraft 2 ingame preview trailer. I really liked the way the zealots can now rapidly leap to a position thus greatly improving their melee fighting capabilities. I tried to emulate that with wc3. Well, first I was a bit disappointed, since in wc3 only one unit actually casts the spell, even if a bunch of the same unit type is selected. So even out of ten selected units with the blink ability, only one will actually blink to the position.
To get that right, I wrote this little trigger, which I used on satyrs with a modified blink ability. Now it's real fun moving and blinking them around in a bunch. Here's my simpleton trigger:
little annotation: my map only got 6 players, that's why 'exitwhen i>5' in the trigger.
I'm sure you've all seen the Starcraft 2 ingame preview trailer. I really liked the way the zealots can now rapidly leap to a position thus greatly improving their melee fighting capabilities. I tried to emulate that with wc3. Well, first I was a bit disappointed, since in wc3 only one unit actually casts the spell, even if a bunch of the same unit type is selected. So even out of ten selected units with the blink ability, only one will actually blink to the position.
To get that right, I wrote this little trigger, which I used on satyrs with a modified blink ability. Now it's real fun moving and blinking them around in a bunch. Here's my simpleton trigger:
JASS:
function OneId_filter takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit()) == bj_groupEnumTypeId and GetWidgetLife(GetFilterUnit()) > 0.4
endfunction
function GroupBlink takes nothing returns nothing
local group g=CreateGroup()
local boolexpr b=Filter(function OneId_filter)
local unit u=GetOrderedUnit()
if GetIssuedOrderId()==OrderId("blink") then
call DisableTrigger(gg_trg_Order)
set bj_groupEnumTypeId=039;n00M039;
call GroupEnumUnitsSelected(g, GetOwningPlayer(u), b)
call GroupPointOrder(g,"blink",GetOrderPointX(),GetOrderPointY())
call TriggerSleepAction(0.2)
call EnableTrigger(gg_trg_Order)
endif
call DestroyGroup(g)
call DestroyBoolExpr(b)
set u=null
set b=null
set g=null
endfunction
function InitTrig_Order takes nothing returns nothing
local integer i=0
set gg_trg_Order = CreateTrigger()
loop
exitwhen i>5
call TriggerRegisterPlayerUnitEvent(gg_trg_Order,Player(i), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
call TriggerAddAction(gg_trg_Order, function GroupBlink)
set i=i+1
endloop
endfunction
little annotation: my map only got 6 players, that's why 'exitwhen i>5' in the trigger.