# Preload Scene
Grammar — Preload file|Scene File queue|Immediately/For Next Map
Flags —Native
|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
string
— Filebool
<preset::PreloadQueue> — Queue
Returns — void
native void PreloadScene(string path, 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/liberty.sc2campaign — base.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.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/swarm.sc2campaign — base.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.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/swarmstoryutil.sc2mod — base.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);