- Joined
- Oct 24, 2012
- Messages
- 6,545
wats the best way to preload items / abilities / units ? thanks
Preload
you can load single resource paths but you want the full object with its other properties anyway. That will also cover its used resources, at least those that are immediately needed such like the icon or model.private function preloadAbilities takes nothing returns nothing
local unit u
local integer Loop = 0
set u = CreateUnit( Player(11), 'hfoo', 0, 0, 0)
call ShowUnit( u, false)
loop
exitwhen Loop > 39
call UnitAddAbility( u, abilityIDS[Loop])
call UnitRemoveAbility( u, abilityIDS[Loop])
set Loop = Loop + 1
endloop
set u = null
endfunction
i did this and it works perfectly
JASS:private function preloadAbilities takes nothing returns nothing local unit u local integer Loop = 0 set u = CreateUnit( Player(11), 'hfoo', 0, 0, 0) call ShowUnit( u, false) loop exitwhen Loop > 39 call UnitAddAbility( u, abilityIDS[Loop]) call UnitRemoveAbility( u, abilityIDS[Loop]) set Loop = Loop + 1 endloop set u = null endfunction
thx for all ur help i added rep to u on the other one so cant add more u definitely deserve it tho very insight full and on topic thx a lot
call RemoveUnit(u)
set u = null