• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] preloading

Status
Not open for further replies.
Level 26
Joined
Aug 18, 2009
Messages
4,097
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.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
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
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
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.
Top