# Preload Scene

Grammar — Preload file|Scene File queue|Immediately/For Next Map
FlagsNative | Action

Preloads a scene 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 PreloadScene(string path, bool queue);

Category: Game / Preloading

# Examples

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

    for ( ; ( (auto1063B0D9_ai >= 0 && lv_index <= auto1063B0D9_ae) || (auto1063B0D9_ai <= 0 && lv_index >= auto1063B0D9_ae) ) ; lv_index += auto1063B0D9_ai ) {
        if ((gv_sceneFile[(lp_sceneID)][lv_index] != null)) {
            PreloadScene(gv_sceneFile[(lp_sceneID)][lv_index], false);
        }

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

    for ( ; ( (auto1063B0D9_ai >= 0 && lv_index <= auto1063B0D9_ae) || (auto1063B0D9_ai <= 0 && lv_index >= auto1063B0D9_ae) ) ; lv_index += auto1063B0D9_ai ) {
        if ((gv_sceneFile[(lp_sceneID)][lv_index] != null)) {
            PreloadScene(gv_sceneFile[(lp_sceneID)][lv_index], false);
        }

campaigns/swarm.sc2campaignbase.sc2maps/maps/campaign/swarm/zstorylab.sc2map/MapScript.galaxy:102


    SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "ZLab02MusicCutscene_PreMission", c_soundtrackCueAny, c_soundtrackIndexAny, false);
    PreloadScene("Cutscenes/zDebrief_Lab01.SC2Cutscene", false);
    Wait(1.5, c_timeReal);
    lib281DEC45_gf_PlayScriptedConversation("zDebrief_Lab01", c_conversationSkipSimple, 0x00000001 | 0x00000004, null);

campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zstorylab.sc2mapMapScript.galaxy:102


    SoundtrackPlay(PlayerGroupAll(), c_soundtrackCategoryMusic, "ZLab02MusicCutscene_PreMission", c_soundtrackCueAny, c_soundtrackIndexAny, false);
    PreloadScene("Cutscenes/zDebrief_Lab01.SC2Cutscene", false);
    Wait(1.5, c_timeReal);
    lib281DEC45_gf_PlayScriptedConversation("zDebrief_Lab01", c_conversationSkipSimple, 0x00000001 | 0x00000004, null);

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:414

    // Implementation
    if ((GameIsTestMap(true) == true)) {
        PreloadScene("Cutscenes\\zScripted_ZAdjutantIntro.SC2Cutscene", false);
        lib281DEC45_gf_ChangeRoom(lib281DEC45_ge_Rooms_StoryRoomVoid);
        lib281DEC45_gf_StartStoryActivity(lib281DEC45_ge_StoryActivities_Cinematic);