The file to execute.
1.33.0 and above: Due to aggressive file caching by the game, the preload file is only loaded and read once. This means, updates to the saved preload file cannot be reloaded and old contents will be executed.
Runs the filename as a preload script, only if the filename has an extension. For Jass, the capabilities are very restricted.
Example (from blizzard.j):
if (doPreload) then call Preloader( "scripts\\HumanMelee.pld" ) endif
There're no restrictions for Lua code if you add it to Preload files (which are supposed to be in Jass), that's only possible with dirty hacks or manual editing. If the map runs in Lua mode, the Jass code is compiled using Jass2Lua before execution.
On pre-Reforged (version?) this only works if you have enabled the usage of local files in your registry. The registry key is
HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III\Allow Local Files\
Here are some ways to get the data out of the preload file into your map: To store multiple integers you can use
SetPlayerTechMaxAllowedto have a good 2d-array. Read via
SetPlayerNameis suited. To read use
Inside the preload script you can also use
ExecuteFuncto call your map-defined functions and interleave the preload script with your functions.
If you use
Preloaderto load some values into your map, these values are very likely to be different for each player (since the player might not even have local files enabled), so treat them as async values.
Also see the documentation of
Preloadto see how to properly get the data into the preload script.
- return type
- Source code
native Preloader takes string filename returns nothing