# Set Portrait Actor

Grammar — Set Portrait Actor to actor
FlagsNative | Action

Set the actor of the specified portrait.

# Arguments

  • int<portrait> — Portrait
  • string<gamelink::Actor> — Actor

Returns — void

native void PortraitSetActor(int p, string actorLink);

Category: Portrait / Advanced

# Examples

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

            libSwaC_gv_zS_ArmyCustomUpgradeButtons2[lv_index] = DialogControlLastCreated();
            libNtve_gf_SetDialogItemModel(DialogControlLastCreated(), "SMX1_ArmyMutationConfirmationButtonEffect", PlayerGroupAll());
            PortraitSetActor(PortraitGetTriggerControl(DialogControlLastCreated()), "PortraitActorWithDeath");
            ActorSend(ActorFromPortrait(PortraitGetTriggerControl(DialogControlLastCreated())), "SetVisibility");
        }

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

    }
    PortraitSetModel(PortraitGetTriggerControl(libSwaC_gv_zS_ArmyCustomMissionContactPortrait), "EvolutionMasterPortrait3D", true);
    PortraitSetActor(PortraitGetTriggerControl(libSwaC_gv_zS_ArmyCustomMissionContactPortrait), "EvolutionMasterPortrait3D");
    DialogControlSetVisible(libSwaC_gv_zS_ArmyCustomMissionContactPortrait, PlayerGroupAll(), true);
    libNtve_gf_SetDialogItemText(libSwaC_gv_zS_ArmyCustomMissionTitleLabel, StringExternal(CatalogFieldValueGet(c_gameCatalogMap, (libSwaC_gv_zS_ArmyCustomMissionMap), "MissionText", c_playerAny)), PlayerGroupAll());

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

    DialogControlHookup(lp_parentControl, c_triggerControlTypePortrait, lp_frame);
    libNtve_gf_SetDialogItemModel(DialogControlLastCreated(), "SMX1_KerriganAbilityConfirmationButtonEffect", PlayerGroupAll());
    PortraitSetActor(PortraitGetTriggerControl(DialogControlLastCreated()), "PortraitActorWithDeath");
    ActorSend(ActorFromPortrait(PortraitGetTriggerControl(DialogControlLastCreated())), "SetVisibility");
}

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1443

        PortraitSetModel(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelContactPortrait), (lib281DEC45_gf_ZSS_UITravelLocationProperty(lp_planetIndex, "ContactModel")), false);
        if ((lib281DEC45_gf_ZSS_UITravelLocationProperty(lp_planetIndex, "ContactActor") == "")) {
            PortraitSetActor(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelContactPortrait), "PortraitActor");
        }
        else {

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1446

        }
        else {
            PortraitSetActor(PortraitGetTriggerControl(lib281DEC45_gv_zSS_UITravelContactPortrait), (lib281DEC45_gf_ZSS_UITravelLocationProperty(lp_planetIndex, "ContactActor")));
        }
    }

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1560

    lib281DEC45_gf_ZSS_UIMissionUpdate();
    if ((lib281DEC45_gf_ZSS_UIMissionProperty("ContactActor") == "")) {
        PortraitSetActor(PortraitGetTriggerControl(lib281DEC45_gv_zSS_MissionContactPortrait), "PortraitActor");
    }
    else {

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:1563

    }
    else {
        PortraitSetActor(PortraitGetTriggerControl(lib281DEC45_gv_zSS_MissionContactPortrait), (lib281DEC45_gf_ZSS_UIMissionProperty("ContactActor")));
    }
    if ((libSwaC_gf_StoryInSimulation() == false) && (lib281DEC45_gv_zSS_MissionPitchPlayed == false) && (lib281DEC45_gv_zSS_Preloading == false)) {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:876

            PortraitSetModel(PortraitGetTriggerControl(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex]), libCOOC_gf_CC_CommanderPortraitModel(libCOUI_gv_cU_CommanderList[lv_commIndex]), false);
            if ((libCOOC_gf_CC_CommanderPortraitActor(libCOUI_gv_cU_CommanderList[lv_commIndex]) != null)) {
                PortraitSetActor(PortraitGetTriggerControl(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex]), libCOOC_gf_CC_CommanderPortraitActor(libCOUI_gv_cU_CommanderList[lv_commIndex]));
            }
            else {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:879

            }
            else {
                PortraitSetActor(PortraitGetTriggerControl(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex]), "PortraitActor");
            }
        }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOUI.galaxy:5409


    PortraitSetModel(PortraitGetTriggerControl(libCOUI_gv_cU_TychusSquadPortraits[lp_squadIndex]), UserDataGetModel("CoopTechTychusSquad", lp_squadInstance, "Portrait Model", 1), false);
    PortraitSetActor(PortraitGetTriggerControl(libCOUI_gv_cU_TychusSquadPortraits[lp_squadIndex]), "PortraitActor");
    libNtve_gf_SetDialogItemImage(libCOUI_gv_cU_TychusSquadPortraitsStatic[lp_squadIndex], UserDataGetImagePath("CoopTechTychusSquad", lp_squadInstance, "2D Portrait", 1), PlayerGroupAll());
    DialogControlSetAnimationState(libCOUI_gv_cU_TychusSquadUnitFrames[lp_squadIndex], PlayerGroupAll(), "UnitState", (lp_squadInstance));