[JASS] preloading

Status
Not open for further replies.
Put them in a container structure, an array for example and gradually traverse it, so the lag the preload causes won't be as accumulated at one point in time. At least the stuff you do not need at the beginning of the game or which is only optionally appearing may be prioritized less. This is only an idea and should prove more/less feasible in different types of games.
 
Just add/remove. Everything else would be too hard to grasp because of the different natures of individual abilities. With 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.
 
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
 
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

dont forget

JASS:
call RemoveUnit(u)
set u = null
 
Status
Not open for further replies.
Back
Top