# Actor From Scope

Grammarname actor from the scope actorScope
FlagsNative | Function

Returns an actor from the specified scope. The Name parameter can be either an actor ID or an actor reference.

# Arguments

  • actorscope — Actor Scope
  • string — Name

Returns — actor

native actor ActorFromScope(actorscope as, string name);

Category: Actor / Utility

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttutorial01.sc2map/MapScript.galaxy:4292

    UnitGroupLoopBegin(UnitGroup("Marine", gv_p02_SIMULATOR, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
    while (!UnitGroupLoopDone()) {
        libNtve_gf_KillModel(ActorFromScope(ActorScopeFromUnit(UnitGroupLoopCurrent()), "ModelHosted"));
        UnitGroupLoopStep();
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttutorial01.sc2map/MapScript.galaxy:6712

    UnitGroupLoopBegin(UnitGroup("MineralField", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
    while (!UnitGroupLoopDone()) {
        libNtve_gf_KillModel(ActorFromScope(ActorScopeFromUnit(UnitGroupLoopCurrent()), "ModelHosted"));
        UnitGroupLoopStep();
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/ttutorial01.sc2map/MapScript.galaxy:7117

    UnitGroupLoopBegin(UnitGroup("VespeneGeyser", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
    while (!UnitGroupLoopDone()) {
        libNtve_gf_KillModel(ActorFromScope(ActorScopeFromUnit(UnitGroupLoopCurrent()), "ModelHosted"));
        UnitGroupLoopStep();
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttutorial01.sc2mapMapScript.galaxy:4292

    UnitGroupLoopBegin(UnitGroup("Marine", gv_p02_SIMULATOR, RegionPlayableMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
    while (!UnitGroupLoopDone()) {
        libNtve_gf_KillModel(ActorFromScope(ActorScopeFromUnit(UnitGroupLoopCurrent()), "ModelHosted"));
        UnitGroupLoopStep();
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttutorial01.sc2mapMapScript.galaxy:6712

    UnitGroupLoopBegin(UnitGroup("MineralField", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
    while (!UnitGroupLoopDone()) {
        libNtve_gf_KillModel(ActorFromScope(ActorScopeFromUnit(UnitGroupLoopCurrent()), "ModelHosted"));
        UnitGroupLoopStep();
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/ttutorial01.sc2mapMapScript.galaxy:7117

    UnitGroupLoopBegin(UnitGroup("VespeneGeyser", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0));
    while (!UnitGroupLoopDone()) {
        libNtve_gf_KillModel(ActorFromScope(ActorScopeFromUnit(UnitGroupLoopCurrent()), "ModelHosted"));
        UnitGroupLoopStep();
    }

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:8939

        libNtve_gf_TurnAnimationPropertiesOn(libNtve_gf_MainActorofUnit(UnitLastCreated()), "Unpowered");
        libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "AnimBlendTimeApply");
        ActorSend(ActorFromScope(ActorScopeFromUnit(libSwaC_gv_zS_ArmyCustomEvolutionUnitA), "::Scene"), "SceneStrobeSetFalloff 2.000000");
    }
    else {

campaigns/swarmstory.sc2campaignbase.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:8964

        libNtve_gf_TurnAnimationPropertiesOn(libNtve_gf_MainActorofUnit(UnitLastCreated()), "Unpowered");
        libNtve_gf_SendActorMessageToUnit(UnitLastCreated(), "AnimBlendTimeApply");
        ActorSend(ActorFromScope(ActorScopeFromUnit(libSwaC_gv_zS_ArmyCustomEvolutionUnitB), "::Scene"), "SceneStrobeSetFalloff 2.000000");
    }
    else {

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

    // Automatic Variable Declarations
    // Implementation
    return ActorFromScope(ActorScopeFromUnit(lp_unit), "::Main");
}

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

    // Automatic Variable Declarations
    // Implementation
    return ActorFromScope(ActorScopeFromUnit(lp_unit), "::Main");
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:18241


    ActorScopeSend(lv_scope, "Signal LootSprayKill");
    ActorSend(ActorFromScope(lv_scope, "::Main"), libNtve_gf_Create(libCore_gv_mountModelActor3, (libGame_gv_players[lv_sprayingPlayer].lv_lootContent.lv_loot_Spray.lv_sprayModelID)));
    ActorSend(ActorFromScope(lv_scope, libCore_gv_mountModelActor3), libNtve_gf_SpraySet(lv_spray));
    if ((lv_mapID == "")) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:18242

    ActorScopeSend(lv_scope, "Signal LootSprayKill");
    ActorSend(ActorFromScope(lv_scope, "::Main"), libNtve_gf_Create(libCore_gv_mountModelActor3, (libGame_gv_players[lv_sprayingPlayer].lv_lootContent.lv_loot_Spray.lv_sprayModelID)));
    ActorSend(ActorFromScope(lv_scope, libCore_gv_mountModelActor3), libNtve_gf_SpraySet(lv_spray));
    if ((lv_mapID == "")) {
        lv_mapID = "None";

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:18728

        ActorSend(lv_heroActor, (("AnimGroupRemove " + lv_poseAnimGroup + " Instant")));
        ActorSend(lv_heroActor, (("AnimBlendTimeApply")));
        ActorSend(ActorFromScope(ActorScopeFromUnit(EventUnit()), lv_mountActorName), libNtve_gf_Destroy());
    }
    else {

mods/heromods/chromie.stormmodbase.stormdata/LibHCHR.galaxy:249

    }

    ActorSend(ActorFromScope(ActorScopeFromUnit(EventPlayerEffectUsedUnitLaunch()), "ChromieTemporalLoopTargetTrailFX"), "AnimGroupApply Teleport {} {} Instant");
    ActorCreate(ActorScopeFromUnit(EventPlayerEffectUsedUnitLaunch()), "ChromieTemporalLoopTargetTrailFX", null, null, null);
    ActorSend(libNtve_gf_ActorLastCreated(), "AnimBracketStart BSD {} Stand Death");

mods/heromods/hanzo.stormmodbase.stormdata/LibHHAN.galaxy:366

    lv_numberofGrowthLoops = ((lv_chargingBehaviorDuration / 0.0625) + 1.0);
    lv_offsetPerLoop = (lv_extraRange / lv_numberofGrowthLoops);
    lv_guide = ActorFromScope(ActorScopeFrom("::Cursor"), "HanzoStormBowGuide");

    // Actions