# 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
- Preload Asset —
void
— PreloadAsset - Preload Image —
void
— PreloadImage - Preload Layout —
void
— PreloadLayout - Preload Model —
void
— PreloadModel - Preload Model Animation —
void
— libNtve_gf_PreloadModelAnimation - Preload Model Object —
void
— libNtve_gf_PreloadModelObject - Preload Movie —
void
— PreloadMovie - Preload Object —
void
— PreloadObject - Preload Scene —
void
— PreloadScene - Preload Script —
void
— PreloadScript - Preload Sound —
void
— PreloadSound - Preload Sound Object —
void
— libNtve_gf_PreloadSoundObject - Preload Soundtrack —
void
— libNtve_gf_PreloadSoundtrack - Preload Unit —
void
— libNtve_gf_PreloadUnit
# Examples
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:995
// Implementation
PreloadLayout("UI\\Layout\\Custom\\LotV_ArmyUpgradeUI.SC2Layout", false);
PreloadAsset("Cutscenes\\UI_ArmyUnits.SC2Cutscene", false);
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:2088
else if (true) {
PreloadLayout("UI\\Layout\\Custom\\LotV_SoAMissionUIPanel.SC2Layout", false);
PreloadAsset("Cutscenes\\UI_MissionLaunch.SC2Cutscene", false);
PreloadAsset(("Cutscenes\\" + UserDataGetString("Maps", libVoiC_gf_PC_MapUserDataInstance(lp_mission), "VignetteScene", 1) + ".SC2Cutscene"), false);
autoA2F1B4E5_val = lp_mission;
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:2089
PreloadLayout("UI\\Layout\\Custom\\LotV_SoAMissionUIPanel.SC2Layout", false);
PreloadAsset("Cutscenes\\UI_MissionLaunch.SC2Cutscene", false);
PreloadAsset(("Cutscenes\\" + UserDataGetString("Maps", libVoiC_gf_PC_MapUserDataInstance(lp_mission), "VignetteScene", 1) + ".SC2Cutscene"), false);
autoA2F1B4E5_val = lp_mission;
if (autoA2F1B4E5_val == "PKorhal01") {
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:2612
// Implementation
PreloadLayout("UI\\Layout\\Custom\\LotV_ShipUpgradeUI.SC2Layout", false);
PreloadAsset("Cutscenes\\UI_ShipUpgrade.SC2Cutscene", false);
}
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:3140
// Implementation
PreloadLayout("UI\\Layout\\Custom\\LotV_StarmapUI.SC2Layout", false);
PreloadAsset("Cutscenes\\UI_Starmap.SC2Cutscene", false);
auto41CD678F_ae = CatalogEntryCount(c_gameCatalogLocation);
auto41CD678F_ai = 1;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:10911
lv_itAnimIndex = 0;
for ( ; lv_itAnimIndex <= auto8334E013_ae ; lv_itAnimIndex += 1 ) {
PreloadAsset(CatalogFieldValueGet(c_gameCatalogModel, libCore_gf_GetModelLinkForUnitType(lv_unitType), "RequiredAnims[" + IntToString(lv_itAnimIndex) + "]", lp_player), false);
}
return true;
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/StartingExperienceLib.galaxy:978
for ( ; ( (auto5AA971D1_ai >= 0 && lv_itCutscene <= auto5AA971D1_ae) || (auto5AA971D1_ai < 0 && lv_itCutscene >= auto5AA971D1_ae) ) ; lv_itCutscene += auto5AA971D1_ai ) {
if ((libStEx_gv_mapCutsceneStrings[lv_itCutscene] != "")) {
PreloadAsset(libStEx_gv_mapCutsceneStrings[lv_itCutscene], false);
}