A string containing a file name to autoload when dependencies are met.
Note: Autoloading must be enabled if you specify a file name to load. See Check.paths for more information.
1.0
lazy
Constant
By default, Check.doWhen() will attempt to autoload missing dependencies.
If you want to prevent autoloading, specify Check.LAZY_LOAD
See Check.paths for more information on autoloading.
1.0
Return Values
Value
Type
Notes
Util.js version
true
Boolean
The dependencies were available and the task has been performed.
1.0
false
Boolean
One or more of the dependency checks failed and the task has not yet been performed.
The task will be queued until missing dependencies become available.
1.0
<error>
Error
An error occurred, usually due to one of the following reasons:
Invalid parameters
A dependency specified Check.NOT_LOADED and the associated file was already loaded
The dependencies were all met and the task was processed, but the task generated an errror
1.0
Notes
The Check.doWhen() function is most commonly used for lazy loading diagnostic routines. Diagnostic routines are not required for normal gameplay, so they can be lazy loaded to reduce game start-up times and RAM consumption.
You can use the "loaddiag" chat command (part of Chat API) to load Diag API at any time during a game, which in turn will cause all the lazy-loaded diagnostic routine scripts to be loaded.
Example
Note: In these examples, it's assumed the 'self' variable is already defined. For more information on that variable, see Self Descriptor Object.
Lazy load Diag.Cache.js when Diag.js becomes available.