# Preload Unit
Grammar — Preload unit|Unit queue|Immediately/For Next Map
Flags —Action
Preloads a unit and its associated assets. The unit 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
[ gamelink::Unit ] — Unit Typebool
[ preset::PreloadQueue ] — Queue
Returns — void
void libNtve_gf_PreloadUnit(string lp_unit, bool lp_queue);
# Related
Category: Game / Preloading
- [F] —
void
— Preload Asset — ( PreloadAsset ) - [F] —
void
— Preload Image — ( PreloadImage ) - [F] —
void
— Preload Layout — ( PreloadLayout ) - [F] —
void
— Preload Model — ( PreloadModel ) - [F] —
void
— Preload Model Animation — ( libNtve_gf_PreloadModelAnimation ) - [F] —
void
— Preload Model Object — ( libNtve_gf_PreloadModelObject ) - [F] —
void
— Preload Movie — ( PreloadMovie ) - [F] —
void
— Preload Object — ( PreloadObject ) - [F] —
void
— Preload Scene — ( PreloadScene ) - [F] —
void
— Preload Script — ( PreloadScript ) - [F] —
void
— Preload Sound — ( PreloadSound ) - [F] —
void
— Preload Sound Object — ( libNtve_gf_PreloadSoundObject ) - [F] —
void
— Preload Soundtrack — ( libNtve_gf_PreloadSoundtrack ) - [F] —
void
— Preload Unit — ( libNtve_gf_PreloadUnit )
# Examples
# campaigns/liberty.sc2campaign
// L688
libNtve_gf_PreloadUnit(gv_levelWavePlaneType[(lp_level)][lv_index], false)
// L4026
libNtve_gf_PreloadUnit(gv_powerupTypeUnitTypes[lv_index], false)
// L739
libNtve_gf_PreloadUnit("TarsonisEngineFast", false)
// L12674
libNtve_gf_PreloadUnit(UnitGetType(lv_indexUnit), false)
// L12863
libNtve_gf_PreloadUnit(UnitGetType(lv_indexUnit), false)
// L37127
libNtve_gf_PreloadUnit("SMAnnabelle", false)
// L37132
libNtve_gf_PreloadUnit("SMBralik", false)
// L37136
libNtve_gf_PreloadUnit("SMHall", false)
// L37257
libNtve_gf_PreloadUnit(UnitGetType(gf_ActorUnit(ge_ActorID_ActorKachinsky)), false)
// L37258
libNtve_gf_PreloadUnit(UnitGetType(gf_ActorUnit(ge_ActorID_ActorEarl)), false)
// L37259
libNtve_gf_PreloadUnit(UnitGetType(gf_ActorUnit(ge_ActorID_ActorAnnabelle)), false)
// L481
libNtve_gf_PreloadUnit("Urun", false)
// L482
libNtve_gf_PreloadUnit("Mohandar", false)
// L483
libNtve_gf_PreloadUnit("Selendis", false)
// L688
libNtve_gf_PreloadUnit(gv_levelWavePlaneType[(lp_level)][lv_index], false)
// L4026
libNtve_gf_PreloadUnit(gv_powerupTypeUnitTypes[lv_index], false)
// L739
libNtve_gf_PreloadUnit("TarsonisEngineFast", false)
// L12674
libNtve_gf_PreloadUnit(UnitGetType(lv_indexUnit), false)
// L12863
libNtve_gf_PreloadUnit(UnitGetType(lv_indexUnit), false)
// L37127
libNtve_gf_PreloadUnit("SMAnnabelle", false)
// L37132
libNtve_gf_PreloadUnit("SMBralik", false)
// L37136
libNtve_gf_PreloadUnit("SMHall", false)
// L37257
libNtve_gf_PreloadUnit(UnitGetType(gf_ActorUnit(ge_ActorID_ActorKachinsky)), false)
// L37258
libNtve_gf_PreloadUnit(UnitGetType(gf_ActorUnit(ge_ActorID_ActorEarl)), false)
// L37259
libNtve_gf_PreloadUnit(UnitGetType(gf_ActorUnit(ge_ActorID_ActorAnnabelle)), false)
// L481
libNtve_gf_PreloadUnit("Urun", false)
// L482
libNtve_gf_PreloadUnit("Mohandar", false)
// L483
libNtve_gf_PreloadUnit("Selendis", false)
# campaigns/libertystory.sc2campaign
// L9662
libNtve_gf_PreloadUnit(libCamp_gv_tS_StoryRoomUnitTypes[lv_roomIndex][lv_index], true)
// L9670
libNtve_gf_PreloadUnit(libCamp_gv_tS_StoryActorUnitTypes[(lp_actor)], true)
# campaigns/swarmstoryutil.sc2mod
// L1529
libNtve_gf_PreloadUnit((CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap), "Unit", 1)), false)
// L1692
libNtve_gf_PreloadUnit((CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission), "Unit", c_playerAny)), false)
# campaigns/voidstory.sc2campaign
// L2065
libNtve_gf_PreloadUnit(libVoiC_gf_PC_ArmyCategoryUnitType(libVoiC_gf_MissionArmyCategoryUnlocked(lp_mission)), false)
// L3152
libNtve_gf_PreloadUnit(libVoiC_gf_PC_ArmyCategoryUnitType(libVoiC_gf_MissionArmyCategoryUnlocked(lv_indexMission)), false)
# mods/heroesdata.stormmod
// L10875
libNtve_gf_PreloadUnit(libGame_gv_players[lv_itPlayer].lv_heroData.lv_unitType, false)