# 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.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:995

    // Implementation
    PreloadLayout("UI\\Layout\\Custom\\LotV_ArmyUpgradeUI.SC2Layout", false);
    PreloadAsset("Cutscenes\\UI_ArmyUnits.SC2Cutscene", false);
}

campaigns/voidstory.sc2campaignbase.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.sc2campaignbase.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.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:2612

    // Implementation
    PreloadLayout("UI\\Layout\\Custom\\LotV_ShipUpgradeUI.SC2Layout", false);
    PreloadAsset("Cutscenes\\UI_ShipUpgrade.SC2Cutscene", false);
}

campaigns/voidstory.sc2campaignbase.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.stormmodbase.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.stormmodbase.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);
        }