# Preload Unit

Grammar — Preload unit|Unit queue|Immediately/For Next Map
FlagsAction

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 Type
  • bool [ preset::PreloadQueue ] — Queue

Returns — void

void libNtve_gf_PreloadUnit(string lp_unit, bool lp_queue);

Category: Game / Preloading

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// 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

CampaignLib.galaxy

// 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

Lib281DEC45.galaxy

// 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

VoidCampaignUILib.galaxy

// 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

GameLib.galaxy

// L10875
libNtve_gf_PreloadUnit(libGame_gv_players[lv_itPlayer].lv_heroData.lv_unitType, false)