# Load Unit Model
Grammar — Load model for u
Flags —Native
|Action
Loads a unit model.
# Arguments
unit
— Unit
Returns — void
native void UnitLoadModel(unit inUnit);
# Related
Category: Unit / Basic
- Unit Show Kill Display —
void
— UnitShowKillDisplay - Unit Can Path To Point —
bool
— UnitPathableToPoint - Unit Can Path To Unit —
bool
— UnitPathableToUnit - Create Units With Default Facing —
void
— libNtve_gf_CreateUnitsWithDefaultFacing - Create Units With Point Facing —
void
— libNtve_gf_CreateUnitsAtPoint2 - Create Units Facing Angle —
unitgroup
— UnitCreate - Create Units Facing Point —
unitgroup
— libNtve_gf_UnitCreateFacingPoint - Last Created Unit —
unit
— UnitLastCreated - Last Created Units —
unitgroup
— UnitLastCreatedGroup - Original Caster Of Unit —
unit
— UnitGetOriginalCaster - Effect That Created Unit —
string
<gamelink::Effect> — UnitGetOriginalEffect - Replace Unit —
void
— libNtve_gf_ReplaceUnit - Last Replaced Unit —
unit
— libNtve_gf_LastReplacedUnit - Change Owner —
void
— UnitSetOwner - Unit Owner Changes —
void
— TriggerAddEventUnitChangeOwner - Old Unit Owner —
int
— EventUnitOwnerOld - New Unit Owner —
int
— EventUnitOwnerNew - Rescue Unit —
void
— libNtve_gf_RescueUnit - Rescue Unit Group —
void
— libNtve_gf_RescueUnit2 - Kill Unit —
void
— UnitKill - Revive Unit —
void
— UnitRevive - Remove Unit —
void
— UnitRemove - Owner Of Unit —
int
— UnitGetOwner - Unit Is Alive —
bool
— UnitIsAlive - Unit Is Valid —
bool
— UnitIsValid - Unit Group Is Dead —
bool
— libNtve_gf_UnitGroupIsDead - Move Unit Instantly —
void
— UnitSetPosition - Make Unit Face Angle —
void
— UnitSetFacing - Make Unit Face Point —
void
— libNtve_gf_MakeUnitFacePoint - Position Of Unit —
point
— UnitGetPosition - Goal Position Of Unit —
point
— UnitGetGoalPosition - Facing Angle Of Unit —
fixed
— UnitGetFacing - Pause/Unpause Unit —
void
— libNtve_gf_PauseUnit - Pause/Unpause All Units —
void
— UnitPauseAll - Sleep/WakeUp Unit —
void
— libNtve_gf_SleepUnit - Show/Hide Unit —
void
— libNtve_gf_ShowHideUnit - Share Vision of Unit —
void
— libNtve_gf_ShareVisionofUnit - Unit Is Paused —
bool
— libNtve_gf_UnitIsPaused - Unit Is Sleepiing —
bool
— libNtve_gf_UnitIsSleepiing - Unit Is Hidden —
bool
— libNtve_gf_UnitIsHidden - Unit Is Visible To Player —
bool
— libNtve_gf_UnitIsVisibleToPlayer - Set Unit Custom Value —
void
— UnitSetCustomValue - Custom Value Of Unit —
fixed
— UnitGetCustomValue - Unit Enters/Leaves Region —
void
— TriggerAddEventUnitRegion - Triggering Region —
region
— EventUnitRegion - Unit Enters/Leaves Point —
void
— TriggerAddEventUnitRangePoint - Unit Enters/Leaves Range Of Unit —
void
— TriggerAddEventUnitRange - Triggering Range Unit —
unit
— EventUnitRangeUnit - Unit In Region —
bool
— libNtve_gf_UnitInRegion - Triggering Unit —
unit
— EventUnit - Load Unit Model —
void
— UnitLoadModel - Unload Unit Model —
void
— UnitUnloadModel - Agent Of Player For Unit —
unit
— UnitAgent - Change Empty Unit Variables In Events —
void
— UnitEventSetNullVariableInvalid - Name of Unit —
text
— UnitGetName - Ideal Harvester Count —
int
— UnitIdealWorkerCount - Current Harvester Count —
int
— UnitCurrentWorkerCount
# Examples
campaigns/liberty.sc2campaign — base.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:7335
// Implementation
PreloadObject(c_gameCatalogUnit, (UnitGetType(lp_unit)), false);
UnitLoadModel(lp_unit);
}
campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2map — MapScript.galaxy:7335
// Implementation
PreloadObject(c_gameCatalogUnit, (UnitGetType(lp_unit)), false);
UnitLoadModel(lp_unit);
}
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zstorychar.sc2map/MapScript.galaxy:803
lib281DEC45_gf_ChangeRoom(lib281DEC45_ge_Rooms_StoryRoomVoid);
UnitLoadModel(UnitFromId(53));
libNtve_gf_SendActorMessageToUnit(UnitFromId(53), "AliasAdd ZScenePlanet");
libNtve_gf_SendActorMessageToUnit(UnitFromId(53), "ExternalFinderAdd");
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zstoryexpedition.sc2map/MapScript.galaxy:805
lib281DEC45_gf_ChangeRoom(lib281DEC45_ge_Rooms_StoryRoomVoid);
UnitLoadModel(UnitFromId(36));
libNtve_gf_SendActorMessageToUnit(UnitFromId(36), "AliasAdd ZScenePlanet");
libNtve_gf_SendActorMessageToUnit(UnitFromId(36), "ExternalFinderAdd");
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zstorychar.sc2map — MapScript.galaxy:803
lib281DEC45_gf_ChangeRoom(lib281DEC45_ge_Rooms_StoryRoomVoid);
UnitLoadModel(UnitFromId(53));
libNtve_gf_SendActorMessageToUnit(UnitFromId(53), "AliasAdd ZScenePlanet");
libNtve_gf_SendActorMessageToUnit(UnitFromId(53), "ExternalFinderAdd");
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zstoryexpedition.sc2map — MapScript.galaxy:805
lib281DEC45_gf_ChangeRoom(lib281DEC45_ge_Rooms_StoryRoomVoid);
UnitLoadModel(UnitFromId(36));
libNtve_gf_SendActorMessageToUnit(UnitFromId(36), "AliasAdd ZScenePlanet");
libNtve_gf_SendActorMessageToUnit(UnitFromId(36), "ExternalFinderAdd");
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:312
for ( ; auto37E86738_u <= UnitGroupCount(auto37E86738_g, c_unitCountAll) ; auto37E86738_u += BoolToInt(lv_indexUnit == UnitGroupUnit(auto37E86738_g, auto37E86738_u)) ) {
lv_indexUnit = UnitGroupUnit(auto37E86738_g, auto37E86738_u);
UnitLoadModel(lv_indexUnit);
}
}
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:2111
for ( ; auto4D646238_u <= UnitGroupCount(auto4D646238_g, c_unitCountAll) ; auto4D646238_u += BoolToInt(lv_indexUnit == UnitGroupUnit(auto4D646238_g, auto4D646238_u)) ) {
lv_indexUnit = UnitGroupUnit(auto4D646238_g, auto4D646238_u);
UnitLoadModel(lv_indexUnit);
}
UISetWorldVisible(PlayerGroupAll(), true);
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:2696
if ((lv_indexUnit != lib281DEC45_gf_CharacterUnit("Evolution Master")) && (lv_indexUnit != lib281DEC45_gf_CharacterUnit("Kerrigan"))) {
if ((lp_loadUnload == true)) {
UnitLoadModel(lv_indexUnit);
libNtve_gf_SendActorMessageToUnit(lv_indexUnit, "AnimCancelActiveBlends Default");
}
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:3325
}
else if (auto0D8868E4_val == lib281DEC45_ge_Rooms_StoryRoomEggRoom) {
UnitLoadModel(lib281DEC45_gf_CharacterUnit("Evolution Master"));
lib281DEC45_gf_ZSS_ApplyAliases();
SoundSetReverb("Reverb_EggRoom", 1.0, true, true);
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:3405
}
else if (auto2C44F216_val == lib281DEC45_ge_Rooms_StoryRoomEggRoom) {
UnitLoadModel(lib281DEC45_gf_CharacterUnit("Evolution Master"));
}
else {
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:1754
UnitGroupAdd(libVCST_gv_pS_RoomUnits[(lp_room)], lp_unit);
if ((libVCST_gf_CurrentRoom() == lp_room)) {
UnitLoadModel(lp_unit);
libVCST_gf_PS_ApplyAliases();
libVCST_gf_PS_ApplyAllFidgets();
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:2252
if (lv_indexUnit == null) { break; }
if ((UnitGroupHasUnit(libVCST_gv_pS_RoomUnits[(libVCST_gv_pS_LastRoom)], lv_indexUnit) == false)) {
UnitLoadModel(lv_indexUnit);
}
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCST.galaxy:1566
UnitGroupAdd(libNCST_gv_nS_RoomUnits[(lp_room)], lp_unit);
if ((libNCST_gf_CurrentRoom() == lp_room)) {
UnitLoadModel(lp_unit);
libNCST_gf_NS_ApplyAliases();
libNCST_gf_NS_ApplyAllFidgets();
mods/missionpacks/novacampaign.sc2mod — base.sc2data/LibNCST.galaxy:1936
lv_indexUnit = UnitGroupUnit(auto8F428406_g, auto8F428406_u);
if ((UnitGroupHasUnit(libNCST_gv_nS_RoomUnits[(libNCST_gv_nS_LastRoom)], lv_indexUnit) == false)) {
UnitLoadModel(lv_indexUnit);
}