# Preload Asset
Grammar — Preload key|Asset queue|Immediately/For Next Map
Flags —Native
|Action
Preloads an asset file. The file must be explicitly identified (it won’t work if you plug in a variable to that parameter). Preloading will force an asset or data entry to be loaded into memory before the map starts, rather than be loaded on demand as the map runs.
# Arguments
string
— Keybool
[ preset::PreloadQueue ] — Queue
Returns — void
native void PreloadAsset(string key, bool queue);
# Related
Category: Game / Preloading
- [F] —
void
— Preload Asset — ( PreloadAsset ) - [F] —
void
— Preload Image — ( PreloadImage ) - [F] —
void
— Preload Layout — ( PreloadLayout ) - [F] —
void
— Preload Model — ( PreloadModel ) - [F] —
void
— Preload Model Animation — ( libNtve_gf_PreloadModelAnimation ) - [F] —
void
— Preload Model Object — ( libNtve_gf_PreloadModelObject ) - [F] —
void
— Preload Movie — ( PreloadMovie ) - [F] —
void
— Preload Object — ( PreloadObject ) - [F] —
void
— Preload Scene — ( PreloadScene ) - [F] —
void
— Preload Script — ( PreloadScript ) - [F] —
void
— Preload Sound — ( PreloadSound ) - [F] —
void
— Preload Sound Object — ( libNtve_gf_PreloadSoundObject ) - [F] —
void
— Preload Soundtrack — ( libNtve_gf_PreloadSoundtrack ) - [F] —
void
— Preload Unit — ( libNtve_gf_PreloadUnit )
# Examples
# campaigns/voidstory.sc2campaign
// L995
PreloadAsset("Cutscenes\\UI_ArmyUnits.SC2Cutscene", false)
// L2088
PreloadAsset("Cutscenes\\UI_MissionLaunch.SC2Cutscene", false)
// L2089
PreloadAsset(("Cutscenes\\" + UserDataGetString("Maps", libVoiC_gf_PC_MapUserDataInstance(lp_mission), "VignetteScene", 1) + ".SC2Cutscene"), false)
// L2612
PreloadAsset("Cutscenes\\UI_ShipUpgrade.SC2Cutscene", false)
// L3140
PreloadAsset("Cutscenes\\UI_Starmap.SC2Cutscene", false)
# mods/heroesdata.stormmod
// L10911
PreloadAsset(CatalogFieldValueGet(c_gameCatalogModel, libCore_gf_GetModelLinkForUnitType(lv_unitType), "RequiredAnims[" + IntToString(lv_itAnimIndex) + "]", lp_player), false)
# mods/heroesdata.stormmod
— StartingExperienceLib.galaxy
// L978
PreloadAsset(libStEx_gv_mapCutsceneStrings[lv_itCutscene], false)