• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Preload units and abilities

Status
Not open for further replies.
Level 10
Joined
Mar 26, 2017
Messages
376
On my map I observe lag spikes when creating custom units for the first time, or when adding a big hero skill (25 levels) for the first time.

I would like to remove these spikes by making use of preloading. I'd prefer to make use of the function Preloader, which is described to preload the entire contents of a folder.

Is this the right approach? And what pathnames must I use for the folders that contain
-All custom textures
-All custom models
-All custom abilities

Many thanks!
 
Level 10
Joined
Mar 26, 2017
Messages
376
I mean this:

upload_2019-4-16_18-42-17.png


Using preplaced units would be my last resort if I cannot get this to work, but it seems to me all I need is the path name where the resources are stored.
 

Attachments

  • upload_2019-4-16_18-42-9.png
    upload_2019-4-16_18-42-9.png
    13.8 KB · Views: 29
Using preplaced units would be my last resort if I cannot get this to work, but it seems to me all I need is the path name where the resources are stored.
blizzard melee preloader only preloads stuff that can be adressed with a file path. Abilities are content in a file so one preloads them by adding them to an living unit or having preplaced units on the map with that abilities.

A preloader file is an name.pld file, it is imported into your map. The plds text content should somehow look like that:
JASS:
function PreloadFiles takes nothing returns nothing
    call Preload( "Abilities\\Spells\\Other\\Repair\\PeonRepair1.wav" )
    call Preload( "Abilities\\Spells\\Other\\Repair\\PeonRepair2.wav" )
    call Preload( "Abilities\\Spells\\Other\\Repair\\PeonRepair3.wav" )
    call Preload( "buildings\\Human\\AltarOfKings\\AltarOfKings.blp" )
    call Preload( "buildings\\human\\AltarofKings\\AltarofKings.mdx" )
    call Preload( "buildings\\Human\\AltarOfKings\\TrevSmokeA.blp" )
    call Preload( "Units\\Human\\Peasant\\PeasantYes4.wav" )
    call PreloadEnd( 6.0 )
endfunction
 
Last edited:
Level 10
Joined
Mar 26, 2017
Messages
376
So do I understand correctly I would need to merge my assets into a .pld file and then import that?
Or is a .pld file simply a text file that contains a script with a bunch of 'call Preload //' function calls?

If the latter is true, then I do not really see why you wouldn't simply put that same logic in a trigger.
 
Status
Not open for further replies.
Top