# Set Dialog Item Unit Link

Grammar — Set dialogItem Unit Link to unitLink for players
FlagsAction

Sets a Dialog Item’s Unit Link. Currently supported for type Unit Model

# Arguments

  • int<control> — Dialog Item
  • string<gamelink::Unit> — Unit Link
  • playergroup — Players

Returns — void

void libNtve_gf_SetDialogItemUnitLink(
	int lp_dialogItem,
	string lp_unitLink,
	playergroup lp_players,
);

Category: Dialog / Dialog Item Tools

# Examples

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

        lv_indexArmyUnit = CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gv_zS_ArmyCustomMissionCurrentCategory, "ArmyUnitArray["+IntToString(autoC0F182A6_ai-1)+"]", 1);
        if ((lv_indexArmyUnit == "HydraliskImpaler")) {
            libNtve_gf_SetDialogItemUnitLink(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], "Impaler", PlayerGroupAll());
        }
        else if ((lv_indexArmyUnit == "HydraliskLurker")) {

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

        }
        else if ((lv_indexArmyUnit == "HydraliskLurker")) {
            libNtve_gf_SetDialogItemUnitLink(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], "Lurker", PlayerGroupAll());
        }
        else if ((lv_indexArmyUnit == "MutaliskBroodlord")) {

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

        }
        else if ((lv_indexArmyUnit == "MutaliskBroodlord")) {
            libNtve_gf_SetDialogItemUnitLink(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], "BroodLord", PlayerGroupAll());
        }
        else if ((lv_indexArmyUnit == "MutaliskViper")) {

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

        }
        else if ((lv_indexArmyUnit == "MutaliskViper")) {
            libNtve_gf_SetDialogItemUnitLink(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], "Viper", PlayerGroupAll());
        }
        else if (true) {

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

        }
        else if (true) {
            libNtve_gf_SetDialogItemUnitLink(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], libSwaC_gf_ZS_StoryArmyUnitUnitType(lv_indexArmyUnit), PlayerGroupAll());
        }
        libNtve_gf_SetDialogItemCamera(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], libSwaC_gf_ZS_ArmyUnitBonusMissionCamera(lv_indexArmyUnit), PlayerGroupAll());

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

            if ((libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap) != null)) {
                lv_unitFrameIndex += 1;
                libNtve_gf_SetDialogItemUnitLink(lib281DEC45_gv_zSS_UITravelRewardUnit[lv_unitFrameIndex], (CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap), "Unit", c_playerAny)), PlayerGroupAll());
                libNtve_gf_SetDialogItemCamera(lib281DEC45_gv_zSS_UITravelRewardUnit[lv_unitFrameIndex], libSwaC_gf_StoryArmyCategoryPlanetCamera(libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap)), PlayerGroupAll());
                libNtve_gf_SetDialogItemTeamColor(lib281DEC45_gv_zSS_UITravelRewardUnit[lv_unitFrameIndex], libNtve_gf_ConvertPlayerColorToColor(libSwaC_gf_CampaignKerriganZergPlayerColor()), PlayerGroupAll());

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

        DialogControlSetVisible(lib281DEC45_gv_zSS_MissionTechnologyText, PlayerGroupAll(), true);
        DialogControlSetVisible(lib281DEC45_gv_zSS_MissionTechnologyTitle, PlayerGroupAll(), true);
        libNtve_gf_SetDialogItemUnitLink(lib281DEC45_gv_zSS_MissionUnit, (CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission), "Unit", c_playerAny)), PlayerGroupAll());
        libNtve_gf_SetDialogItemCamera(lib281DEC45_gv_zSS_MissionUnit, libSwaC_gf_StoryArmyCategoryPlanetCamera(libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission)), PlayerGroupAll());
        libNtve_gf_SetDialogItemTeamColor(lib281DEC45_gv_zSS_MissionUnit, libNtve_gf_ConvertPlayerColorToColor(libSwaC_gf_CampaignKerriganZergPlayerColor()), PlayerGroupAll());

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1987

        DialogControlSetVisible(libVCUI_gv_pU_MissionRewardUnitModel, PlayerGroupAll(), true);
        DialogControlSetVisible(libVCUI_gv_pU_MissionRewardUnitName, PlayerGroupAll(), true);
        libNtve_gf_SetDialogItemUnitLink(libVCUI_gv_pU_MissionRewardUnitModel, libVoiC_gf_PC_ArmyCategoryUnitType(lv_rewardCategory), PlayerGroupAll());
        libNtve_gf_SetDialogItemCamera(libVCUI_gv_pU_MissionRewardUnitModel, libVoiC_gf_PC_ArmyCategoryPlanetCamera(lv_rewardCategory), PlayerGroupAll());
        libNtve_gf_SetDialogItemTeamColor(libVCUI_gv_pU_MissionRewardUnitModel, libNtve_gf_ConvertPlayerColorToColor(libVCMI_gf_CampaignPlayerColor()), PlayerGroupAll());

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1998

            DialogControlSetVisible(libVCUI_gv_pU_MissionRewardUnitModel2, PlayerGroupAll(), true);
            DialogControlSetVisible(libVCUI_gv_pU_MissionRewardUnitName2, PlayerGroupAll(), true);
            libNtve_gf_SetDialogItemUnitLink(libVCUI_gv_pU_MissionRewardUnitModel2, "ShieldBattery", PlayerGroupAll());
            libNtve_gf_SetDialogItemCamera(libVCUI_gv_pU_MissionRewardUnitModel2, libVoiC_gf_PC_ArmyCategoryPlanetCamera("ShieldBattery"), PlayerGroupAll());
            libNtve_gf_SetDialogItemTeamColor(libVCUI_gv_pU_MissionRewardUnitModel2, libNtve_gf_ConvertPlayerColorToColor(libVCMI_gf_CampaignPlayerColor()), PlayerGroupAll());

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:3079

        if (CatalogFieldValueGet(c_gameCatalogMap, lv_indexMission, "Kind", 1) == "Mission" && libVoiC_gf_StoryMapPlanet(lv_indexMission) == libVCUI_gv_pU_StarmapLocations[libVCUI_gv_pU_StarmapSelection]) {
            if ((libVoiC_gf_MissionArmyCategoryUnlocked(lv_indexMission) != null)) {
                libNtve_gf_SetDialogItemUnitLink(libVCUI_gv_pU_StarmapUnitModels[lv_index], libVoiC_gf_PC_ArmyCategoryUnitType(libVoiC_gf_MissionArmyCategoryUnlocked(lv_indexMission)), PlayerGroupAll());
                libNtve_gf_SetDialogItemCamera(libVCUI_gv_pU_StarmapUnitModels[lv_index], libVoiC_gf_PC_ArmyCategoryPlanetCamera(libVoiC_gf_MissionArmyCategoryUnlocked(lv_indexMission)), PlayerGroupAll());
                TextExpressionSetToken("Param/Expression/lib_VCUI_560481B1", "Name", UnitTypeGetName(libVoiC_gf_PC_ArmyCategoryUnitType(libVoiC_gf_MissionArmyCategoryUnlocked(lv_indexMission))));