# Model Swap

Grammar — ModelSwap model variation
FlagsFunction

Constructs and returns a ModelSwap actor message. This message will swap the current model of an actor with an model to the specified Model and Variation number.

# Arguments

  • string<gamelink::Model> — Model
  • int — Variation

Returns — string<actormsg>

string libNtve_gf_ModelSwap(
	string lp_model,
	int lp_variation,
);

Category: Actor / Message Constructors

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/thorner05s.sc2map/MapScript.galaxy:955

    UnitGroupAdd(gv_lab02DominionUnitGroup, gv_turret08);
    UnitGroupAdd(gv_lab02DominionUnitGroup, gv_turret09);
    ActorSend(ActorFromDoodad(DoodadFromId(235)), libNtve_gf_ModelSwap("HybridHoldingCellDeath", 0));
    ActorSend(ActorFromDoodad(DoodadFromId(235)), "AnimPlay '' Death PlayForever");
    auto33CC760C_g = UnitGroup(null, c_playerAny, RegionFromId(16), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterHidden - 32))), 0);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/thorner05s.sc2mapMapScript.galaxy:955

    UnitGroupAdd(gv_lab02DominionUnitGroup, gv_turret08);
    UnitGroupAdd(gv_lab02DominionUnitGroup, gv_turret09);
    ActorSend(ActorFromDoodad(DoodadFromId(235)), libNtve_gf_ModelSwap("HybridHoldingCellDeath", 0));
    ActorSend(ActorFromDoodad(DoodadFromId(235)), "AnimPlay '' Death PlayForever");
    auto33CC760C_g = UnitGroup(null, c_playerAny, RegionFromId(16), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterHidden - 32))), 0);

mods/core.sc2modbase.sc2data/TriggerLibs/NativeLib.galaxy:5448

    // Automatic Variable Declarations
    // Implementation
    libNtve_gf_SendActorMessageToUnit(lp_unit, libNtve_gf_ModelSwap(lp_model, lp_percent));
    if ((StringLength(lp_textures) > 0)) {
        libNtve_gf_SendActorMessageToUnit(lp_unit, MakeMsgTextureSelectBySlot("main", c_textureSlotComponentDefault, ("BestMatch " + lp_textures)));

mods/core.stormmodbase.stormdata/TriggerLibs/NativeLib.galaxy:4640

    // Automatic Variable Declarations
    // Implementation
    libNtve_gf_SendActorMessageToUnit(lp_unit, libNtve_gf_ModelSwap(lp_model, lp_percent));
    if ((StringLength(lp_textures) > 0)) {
        libNtve_gf_SendActorMessageToUnit(lp_unit, MakeMsgTextureSelectBySlot("main", c_textureSlotComponentDefault, ("BestMatch " + lp_textures)));

mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmodbase.stormdata/LibPVEB.galaxy:2223

        UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration);
    }
    ActorSend(libNtve_gf_MainActorofUnit(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer]), libNtve_gf_ModelSwap(libCore_gf_GetModelLinkForUnitType(UnitGetType(lv_deadHero)), 0));
    ActorSend(libNtve_gf_MainActorofUnit(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer]), libNtve_gf_Signal("Stunned"));
    libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer] = UnitLastCreated();

mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmodbase.stormdata/LibPVEM.galaxy:1821

        UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration);
    }
    ActorSend(libNtve_gf_MainActorofUnit(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer]), libNtve_gf_ModelSwap(libCore_gf_GetModelLinkForUnitType(UnitGetType(lv_deadHero)), 0));
    ActorSend(libNtve_gf_MainActorofUnit(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer]), libNtve_gf_Signal("Stunned"));
    libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer] = UnitLastCreated();

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:218

    autoEE4E787F_val = UnitGetType(lp_deadHero);
    if (autoEE4E787F_val == "HeroAlexstraszaDragon") {
        ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lp_deadPlayer]), libNtve_gf_ModelSwap(libCore_gf_GetModelLinkForUnitType("HeroAlexstrasza"), 0));
    }
    else {

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:221

    }
    else {
        ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lp_deadPlayer]), libNtve_gf_ModelSwap(libCore_gf_GetModelLinkForUnitType(UnitGetType(lp_deadHero)), 0));
    }
    ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lp_deadPlayer]), libNtve_gf_Signal("Taunt"));

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1127


        }
        ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer]), libNtve_gf_ModelSwap("HitTestFuzzy_Cyliner", 0));
        ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer]), libNtve_gf_SetOpacity(0.0, 0));
        ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer]), libNtve_gf_SetScale(2.0, 2.0, 4.5, 0.0));

mods/heromods/auriel.stormmodbase.stormdata/LibHAUR.galaxy:1139

        UnitBehaviorAdd(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], 1);
        UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime));
        ActorSend(libNtve_gf_MainActorofUnit(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer]), libNtve_gf_ModelSwap(libCore_gf_GetModelLinkForUnitType(UnitGetType(lv_deadHero)), 0));
        if ((UnitIsAlive(libGame_gv_heroDeathMurkyRespawnEggs[lv_deadPlayer]) == true)) {
            TriggerEnable(libHAUR_gt_HeroAurielResurrectMurkyEggDeathSpiritReveal, true);