# Preload Object

Grammar — Preload id|Object in catalog|Catalog queue|Immediately/For Next Map
FlagsNative | Action

Preloads a data entry and its associated assets. The object 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 PreloadObject(
	int catalog,
	string id,
	bool queue,
);

Category: Game / Preloading

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tarcade.sc2map/MapScript.galaxy:4008

    }

    PreloadObject(c_gameCatalogUnit, ("SS_Fighter"), false);
    PreloadImage("Assets\\Textures\\loading-agria.dds", false);
    PreloadImage("Assets\\Textures\\loading-aiur.dds", false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:7334

void gf_PreloadUnitStoryMap (unit lp_unit) {
    // Implementation
    PreloadObject(c_gameCatalogUnit, (UnitGetType(lp_unit)), false);
    UnitLoadModel(lp_unit);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10092

            lv_indexMerc = libCamp_gv_tS_MercID[autoC6EE7E59_i];
            if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_Locked) == false)) {
                PreloadObject(c_gameCatalogModel, (libCamp_gf_MercPortraitModel(lv_indexMerc)), false);
            }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10331

        lv_missionID = libCamp_gf_PlanetMission(lv_indexPlanet);
        if ((lv_missionID != libCamp_ge_MapID_MapNone)) {
            PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_missionID))), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetIconModel(lv_indexPlanet)), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetModel(lv_indexPlanet)), false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10332

        if ((lv_missionID != libCamp_ge_MapID_MapNone)) {
            PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_missionID))), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetIconModel(lv_indexPlanet)), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetModel(lv_indexPlanet)), false);
        }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10333

            PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_missionID))), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetIconModel(lv_indexPlanet)), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetModel(lv_indexPlanet)), false);
        }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:28709

    gf_PreloadRoomIfCondition(ge_RoomID_RoomMarSara, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomMarSara);
    PreloadObject(c_gameCatalogModel, ("AdjutantPortrait"), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    PreloadMovie("Assets\\Textures\\briefing_video_traynor01_00.ogv", false);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:29025

    gf_PreloadRoomIfCondition(ge_RoomID_RoomMarSara, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomMarSara);
    PreloadObject(c_gameCatalogModel, ("AdjutantPortrait"), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorTychus));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:29158

    gf_PreloadRoomIfCondition(ge_RoomID_RoomBridge, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomBridge);
    PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_ge_ContactID_ContactHanson)), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorTychus));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:29569

    gf_PreloadRoomIfCondition(ge_RoomID_RoomBridge, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomBridge);
    PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_ge_ContactID_ContactSwann)), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorHanson));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:29730

    gf_PreloadRoomIfCondition(ge_RoomID_RoomBridge, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomBridge);
    PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_ge_ContactID_ContactSwann)), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorHorner));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tarcade.sc2mapMapScript.galaxy:4008

    }

    PreloadObject(c_gameCatalogUnit, ("SS_Fighter"), false);
    PreloadImage("Assets\\Textures\\loading-agria.dds", false);
    PreloadImage("Assets\\Textures\\loading-aiur.dds", false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:7334

void gf_PreloadUnitStoryMap (unit lp_unit) {
    // Implementation
    PreloadObject(c_gameCatalogUnit, (UnitGetType(lp_unit)), false);
    UnitLoadModel(lp_unit);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10092

            lv_indexMerc = libCamp_gv_tS_MercID[autoC6EE7E59_i];
            if ((libCamp_gf_MercStatusCheck(lv_indexMerc, libCamp_ge_StoryMercStatus_Locked) == false)) {
                PreloadObject(c_gameCatalogModel, (libCamp_gf_MercPortraitModel(lv_indexMerc)), false);
            }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10331

        lv_missionID = libCamp_gf_PlanetMission(lv_indexPlanet);
        if ((lv_missionID != libCamp_ge_MapID_MapNone)) {
            PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_missionID))), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetIconModel(lv_indexPlanet)), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetModel(lv_indexPlanet)), false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10332

        if ((lv_missionID != libCamp_ge_MapID_MapNone)) {
            PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_missionID))), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetIconModel(lv_indexPlanet)), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetModel(lv_indexPlanet)), false);
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10333

            PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_gf_MissionContact(lv_missionID))), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetIconModel(lv_indexPlanet)), false);
            PreloadObject(c_gameCatalogModel, (libCamp_gf_PlanetModel(lv_indexPlanet)), false);
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:28709

    gf_PreloadRoomIfCondition(ge_RoomID_RoomMarSara, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomMarSara);
    PreloadObject(c_gameCatalogModel, ("AdjutantPortrait"), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    PreloadMovie("Assets\\Textures\\briefing_video_traynor01_00.ogv", false);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:29025

    gf_PreloadRoomIfCondition(ge_RoomID_RoomMarSara, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomMarSara);
    PreloadObject(c_gameCatalogModel, ("AdjutantPortrait"), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorTychus));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:29158

    gf_PreloadRoomIfCondition(ge_RoomID_RoomBridge, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomBridge);
    PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_ge_ContactID_ContactHanson)), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorTychus));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:29569

    gf_PreloadRoomIfCondition(ge_RoomID_RoomBridge, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomBridge);
    PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_ge_ContactID_ContactSwann)), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorHanson));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:29730

    gf_PreloadRoomIfCondition(ge_RoomID_RoomBridge, true);
    gf_BriefingPreloadScreens(ge_RoomID_RoomBridge);
    PreloadObject(c_gameCatalogModel, (libCamp_gf_ContactPortraitModel(libCamp_ge_ContactID_ContactSwann)), false);
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorRaynor));
    gf_PreloadUnitStoryMap(gf_ActorUnit(ge_ActorID_ActorHorner));

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3439

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogModel, (lp_id), lp_queue);
}

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3445

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogSound, (lp_id), lp_queue);
}

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3451

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogSoundtrack, (lp_soundtrack), lp_queue);
}

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:3457

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogUnit, (lp_unit), lp_queue);
}

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:2935

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogModel, (lp_id), lp_queue);
}

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:2941

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogSound, (lp_id), lp_queue);
}

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:2947

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogSoundtrack, (lp_soundtrack), lp_queue);
}

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:2953

    // Automatic Variable Declarations
    // Implementation
    PreloadObject(c_gameCatalogUnit, (lp_unit), lp_queue);
}

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/%2810%29trymemode.stormmap/MapScript.galaxy:416

    Wait(0.125, c_timeGame);
    if ((gv_allyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_AllyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_AllyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/%2810%29trymemode.stormmap/MapScript.galaxy:417

    if ((gv_allyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_AllyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_AllyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);
        gv_allyHeroLoaded = true;

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/%2810%29trymemode.stormmap/MapScript.galaxy:459

    Wait(0.125, c_timeGame);
    if ((gv_enemyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_EnemyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_EnemyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/%2810%29trymemode.stormmap/MapScript.galaxy:460

    if ((gv_enemyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_EnemyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_EnemyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);
        gv_enemyHeroLoaded = true;

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/(10)trymemode.stormmapmap/MapScript.galaxy:416

    Wait(0.125, c_timeGame);
    if ((gv_allyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_AllyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_AllyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/(10)trymemode.stormmapmap/MapScript.galaxy:417

    if ((gv_allyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_AllyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_AllyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);
        gv_allyHeroLoaded = true;

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/(10)trymemode.stormmapmap/MapScript.galaxy:459

    Wait(0.125, c_timeGame);
    if ((gv_enemyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_EnemyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_EnemyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/(10)trymemode.stormmapmap/MapScript.galaxy:460

    if ((gv_enemyHeroLoaded == false)) {
        PreloadObject(c_gameCatalogHero, (gv_pLAYER_AI_EnemyHero), false);
        PreloadObject(c_gameCatalogSkin, CatalogFieldValueGet(c_gameCatalogHero, gv_pLAYER_AI_EnemyHero, "SkinArray[" + IntToString(0) + "]", c_playerAny), false);
        Wait(4.0, c_timeGame);
        gv_enemyHeroLoaded = true;

mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmodbase.stormdata/LibPVEB.galaxy:603

    }

    PreloadObject(c_gameCatalogHero, (libPVEB_gv_pBNPCHeroes[lv_index].lv_hero), false);
    lv_unitTypeString = CatalogFieldValueGet(c_gameCatalogHero, lp_hero, "Unit", c_playerAny);
    libPVEB_gv_pBNPCHeroes[lv_index].lv_unitType = (lv_unitTypeString);

mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmodbase.stormdata/LibPVEB.galaxy:613

    libCore_gf_DataLoadHeroDataIntoIndex(lp_hero, libPVEB_gv_pBNPCHeroes[lv_index].lv_player);
    libCore_gf_DataLoadSkinDataIntoIndex(lp_skin, libPVEB_gv_pBNPCHeroes[lv_index].lv_player);
    PreloadObject(c_gameCatalogSkin, (libPVEB_gv_pBNPCHeroes[lv_index].lv_skin), false);
    libGame_gv_players[libPVEB_gv_pBNPCHeroes[lv_index].lv_player].lv_disableMount = true;
    if ((libPVEB_gv_pBNPCHeroes[lv_index].lv_radiusScaledHero != lp_hero)) {

mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmodbase.stormdata/LibPVEM.galaxy:810

    }

    PreloadObject(c_gameCatalogHero, (libPVEM_gv_pvENPCHeroes[lv_index].lv_hero), false);
    lv_unitTypeString = CatalogFieldValueGet(c_gameCatalogHero, lp_hero, "Unit", c_playerAny);
    libPVEM_gv_pvENPCHeroes[lv_index].lv_unitType = (lv_unitTypeString);

mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmodbase.stormdata/LibPVEM.galaxy:820

    libCore_gf_DataLoadHeroDataIntoIndex(lp_hero, libPVEM_gv_pvENPCHeroes[lv_index].lv_player);
    libCore_gf_DataLoadSkinDataIntoIndex(lp_skin, libPVEM_gv_pvENPCHeroes[lv_index].lv_player);
    PreloadObject(c_gameCatalogSkin, (libPVEM_gv_pvENPCHeroes[lv_index].lv_skin), false);
    libGame_gv_players[libPVEM_gv_pvENPCHeroes[lv_index].lv_player].lv_disableMount = true;
    if ((libPVEM_gv_pvENPCHeroes[lv_index].lv_radiusScaledHero != lp_hero)) {