# Preload Asset

Grammar — Preload key|Asset queue|Immediately/For Next Map
FlagsNative | 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

Returns — void

native void PreloadAsset(string key, bool queue);

Category: Game / Preloading

# Examples

# campaigns/voidstory.sc2campaign

VoidCampaignUILib.galaxy

// 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

GameLib.galaxy

// 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)