# Set Data Conversation Unit

Grammar — Set conversation stateIndex|State to unit
FlagsNative | Action

Sets a conversation state to a unit.

# Arguments

  • string<convcharacter> — State Index
  • unit — Unit

Returns — void

native void ConversationDataRegisterUnit(
	string stateIndex,
	unit u,
);

Category: Conversation / Data Conversations

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10809

    }

    ConversationDataRegisterUnit(gf_ConvoCharacter(ge_ActorID_ActorRaynor), gf_ActorUnit(ge_ActorID_ActorRaynor));
    if ((lp_actor1 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor1), gf_ActorUnit(lp_actor1));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10811

    ConversationDataRegisterUnit(gf_ConvoCharacter(ge_ActorID_ActorRaynor), gf_ActorUnit(ge_ActorID_ActorRaynor));
    if ((lp_actor1 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor1), gf_ActorUnit(lp_actor1));
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10815


    if ((lp_actor2 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor2), gf_ActorUnit(lp_actor2));
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10820

    ConversationDataRun(lp_fidget, PlayerGroupAll(), c_conversationSkipSimple, true);
    if ((lp_actor1 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor1), gf_ActorUnit(lp_actor1));
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:10824


    if ((lp_actor2 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor2), gf_ActorUnit(lp_actor2));
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:11645

    gv_convoCameraObjectCurrent1 = lp_cameraObject1;
    gv_convoCameraObjectCurrent2 = lp_cameraObject2;
    ConversationDataRegisterUnit("Characters|CharRaynor", gf_ActorUnit(lp_raynor));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to1), gf_ActorUnit(lp_to1));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to2), gf_ActorUnit(lp_to2));

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:11646

    gv_convoCameraObjectCurrent2 = lp_cameraObject2;
    ConversationDataRegisterUnit("Characters|CharRaynor", gf_ActorUnit(lp_raynor));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to1), gf_ActorUnit(lp_to1));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to2), gf_ActorUnit(lp_to2));
    gv_convoCameraChangeCallback = lp_changeCameraCallback;

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:11647

    ConversationDataRegisterUnit("Characters|CharRaynor", gf_ActorUnit(lp_raynor));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to1), gf_ActorUnit(lp_to1));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to2), gf_ActorUnit(lp_to2));
    gv_convoCameraChangeCallback = lp_changeCameraCallback;
    ConversationDataRegisterCamera("Cameras|Master", null, null, gt_ConvoCameraTriggerMaster, true);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:11659

    gv_convoCameraCustomCallback = lp_customCameraCallback;
    lv_characterIndex1 = gf_ConvoCharacter(lp_to1);
    ConversationDataRegisterUnit(lv_characterIndex1, gf_ActorUnit(lp_to1));
    ConversationDataRegisterCamera("Cameras|CloseUp", lv_characterIndex1, null, gt_ConvoCameraTriggerCharacter1Closeup, true);
    ConversationDataRegisterCamera("Cameras|Medium", lv_characterIndex1, null, gt_ConvoCameraTriggerCharacter1Medium, true);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:11668

    if ((lp_to2 != ge_ActorID_ActorNone)) {
        lv_characterIndex2 = gf_ConvoCharacter(lp_to2);
        ConversationDataRegisterUnit(lv_characterIndex2, gf_ActorUnit(lp_to2));
        ConversationDataRegisterCamera("Cameras|CloseUp", lv_characterIndex2, null, gt_ConvoCameraTriggerCharacter2Closeup, true);
        ConversationDataRegisterCamera("Cameras|Medium", lv_characterIndex2, null, gt_ConvoCameraTriggerCharacter2Medium, true);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10809

    }

    ConversationDataRegisterUnit(gf_ConvoCharacter(ge_ActorID_ActorRaynor), gf_ActorUnit(ge_ActorID_ActorRaynor));
    if ((lp_actor1 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor1), gf_ActorUnit(lp_actor1));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10811

    ConversationDataRegisterUnit(gf_ConvoCharacter(ge_ActorID_ActorRaynor), gf_ActorUnit(ge_ActorID_ActorRaynor));
    if ((lp_actor1 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor1), gf_ActorUnit(lp_actor1));
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10815


    if ((lp_actor2 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor2), gf_ActorUnit(lp_actor2));
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10820

    ConversationDataRun(lp_fidget, PlayerGroupAll(), c_conversationSkipSimple, true);
    if ((lp_actor1 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor1), gf_ActorUnit(lp_actor1));
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:10824


    if ((lp_actor2 != ge_ActorID_ActorNone)) {
        ConversationDataRegisterUnit(gf_ConvoCharacter(lp_actor2), gf_ActorUnit(lp_actor2));
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:11645

    gv_convoCameraObjectCurrent1 = lp_cameraObject1;
    gv_convoCameraObjectCurrent2 = lp_cameraObject2;
    ConversationDataRegisterUnit("Characters|CharRaynor", gf_ActorUnit(lp_raynor));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to1), gf_ActorUnit(lp_to1));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to2), gf_ActorUnit(lp_to2));

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:11646

    gv_convoCameraObjectCurrent2 = lp_cameraObject2;
    ConversationDataRegisterUnit("Characters|CharRaynor", gf_ActorUnit(lp_raynor));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to1), gf_ActorUnit(lp_to1));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to2), gf_ActorUnit(lp_to2));
    gv_convoCameraChangeCallback = lp_changeCameraCallback;

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:11647

    ConversationDataRegisterUnit("Characters|CharRaynor", gf_ActorUnit(lp_raynor));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to1), gf_ActorUnit(lp_to1));
    ConversationDataRegisterUnit(gf_ConvoCharacter(lp_to2), gf_ActorUnit(lp_to2));
    gv_convoCameraChangeCallback = lp_changeCameraCallback;
    ConversationDataRegisterCamera("Cameras|Master", null, null, gt_ConvoCameraTriggerMaster, true);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:11659

    gv_convoCameraCustomCallback = lp_customCameraCallback;
    lv_characterIndex1 = gf_ConvoCharacter(lp_to1);
    ConversationDataRegisterUnit(lv_characterIndex1, gf_ActorUnit(lp_to1));
    ConversationDataRegisterCamera("Cameras|CloseUp", lv_characterIndex1, null, gt_ConvoCameraTriggerCharacter1Closeup, true);
    ConversationDataRegisterCamera("Cameras|Medium", lv_characterIndex1, null, gt_ConvoCameraTriggerCharacter1Medium, true);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:11668

    if ((lp_to2 != ge_ActorID_ActorNone)) {
        lv_characterIndex2 = gf_ConvoCharacter(lp_to2);
        ConversationDataRegisterUnit(lv_characterIndex2, gf_ActorUnit(lp_to2));
        ConversationDataRegisterCamera("Cameras|CloseUp", lv_characterIndex2, null, gt_ConvoCameraTriggerCharacter2Closeup, true);
        ConversationDataRegisterCamera("Cameras|Medium", lv_characterIndex2, null, gt_ConvoCameraTriggerCharacter2Medium, true);

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

    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypeMenuBar, false);
    libSwaC_gf_ZS_ArmyEggRoomTurnClickableOnOff(true);
    ConversationDataRegisterUnit("char_EvolutionMaster", libSwaC_gv_zS_ArmyCustomEggRoomEvolutionMaster);
    TriggerExecute(libSwaC_gt_ZS_PlayEggRoomIntroSequence, true, false);
    TriggerEnable(libSwaC_gt_ZS_ArmyCustomEggClicked, true);

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

    }
    else if (auto5E79F816_val == lib281DEC45_ge_Rooms_StoryRoomEggRoom) {
        ConversationDataRegisterUnit("char_EvolutionMaster", lib281DEC45_gf_CharacterUnit("Evolution Master"));
    }
    else {

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

    }
    lib281DEC45_gf_ZSS_CharacterDataUpdate();
    ConversationDataRegisterUnit(lib281DEC45_gv_zSS_Characters[lib281DEC45_gf_ZSS_CharacterIndex(lp_character)].lv_conversationLink, lp_charUnit);
    if ((lib281DEC45_gf_ZSS_CharacterActorAlias(lp_character) != null)) {
        lib281DEC45_gf_StoryAddAliasedUnit(lp_charUnit, lib281DEC45_gf_ZSS_CharacterActorAlias(lp_character));

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

        lv_indexCharacter = UserDataInstance("Character", auto37799D8C_ai);
        ConversationDataRegisterPortrait(lib281DEC45_gv_zSS_Characters[lib281DEC45_gf_ZSS_CharacterIndex(lv_indexCharacter)].lv_conversationLink, lp_portrait);
        ConversationDataRegisterUnit(lib281DEC45_gv_zSS_Characters[lib281DEC45_gf_ZSS_CharacterIndex(lv_indexCharacter)].lv_conversationLink, null);
        auto37799D8C_ai = auto37799D8C_ai+1;
    }

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

        lv_indexCharacter = UserDataInstance("Character", auto1018928D_ai);
        ConversationDataRegisterPortrait(lib281DEC45_gv_zSS_Characters[lib281DEC45_gf_ZSS_CharacterIndex(lv_indexCharacter)].lv_conversationLink, c_invalidPortraitId);
        ConversationDataRegisterUnit(lib281DEC45_gv_zSS_Characters[lib281DEC45_gf_ZSS_CharacterIndex(lv_indexCharacter)].lv_conversationLink, lib281DEC45_gf_CharacterUnit(lv_indexCharacter));
        auto1018928D_ai = auto1018928D_ai+1;
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:4072

    libVCST_gv_pS_Clickable[libVCST_gf_PS_ClickableIndex(lp_clickableInstance)].lv_unit = lp_unit;
    libVCST_gf_PS_ClickableDataUpdate();
    ConversationDataRegisterUnit(libVoiC_gf_PC_ClickableConversationLink(lp_clickableInstance), lp_unit);
    if ((libVCST_gf_PS_ClickableActorAlias(lp_clickableInstance) != null) && (lv_unitReplaced == false)) {
        libVCST_gf_StoryAddAliasedUnit(lp_unit, libVCST_gf_PS_ClickableActorAlias(lp_clickableInstance));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:5367

        lv_indexClickable = UserDataInstance("Clickable", auto404734DB_ai);
        ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), c_invalidPortraitId);
        ConversationDataRegisterUnit(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), libVCST_gf_ClickableUnit(lv_indexClickable));
        auto404734DB_ai = auto404734DB_ai+1;
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:6299

        lv_indexClickable = UserDataInstance("Clickable", auto4A9790C7_ai);
        ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), c_invalidPortraitId);
        ConversationDataRegisterUnit(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), libVCST_gf_ClickableUnit(lv_indexClickable));
        auto4A9790C7_ai = auto4A9790C7_ai+1;
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:6334

        lv_indexClickable = UserDataInstance("Clickable", auto3D22C8A3_ai);
        ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), c_invalidPortraitId);
        ConversationDataRegisterUnit(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), libVCST_gf_ClickableUnit(lv_indexClickable));
        auto3D22C8A3_ai = auto3D22C8A3_ai+1;
    }

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

            ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink(UserDataInstance("Clickable", lv_clickableIndex)), PortraitGetTriggerControl(libVCUI_gv_pU_MissionPortraitFrame));
        }
        ConversationDataRegisterUnit(libVoiC_gf_PC_ClickableConversationLink(UserDataInstance("Clickable", lv_clickableIndex)), null);
    }
    if ((libVCUI_gv_pU_Mission2DBackground != c_invalidDialogControlId)) {

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

        lv_indexClickable = UserDataInstance("Clickable", auto8B731360_ai);
        ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), lp_portrait);
        ConversationDataRegisterUnit(libVoiC_gf_PC_ClickableConversationLink(lv_indexClickable), null);
        auto8B731360_ai = auto8B731360_ai+1;
    }

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:3451

    libNCST_gv_nS_Clickable[libNCST_gf_NS_ClickableIndex(lp_clickableInstance)].lv_unit = lp_unit;
    libNCST_gf_NS_ClickableDataUpdate();
    ConversationDataRegisterUnit(libNovC_gf_NC_ClickableConversationLink(lp_clickableInstance), lp_unit);
    if ((libNCST_gf_NS_ClickableActorAlias(lp_clickableInstance) != null) && (lv_unitReplaced == false)) {
        libNCST_gf_StoryAddAliasedUnit(lp_unit, libNCST_gf_NS_ClickableActorAlias(lp_clickableInstance));

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:4610

        lv_indexClickable = UserDataInstance("Clickable", auto404734DB_ai);
        ConversationDataRegisterPortrait(libNovC_gf_NC_ClickableConversationLink(lv_indexClickable), c_invalidPortraitId);
        ConversationDataRegisterUnit(libNovC_gf_NC_ClickableConversationLink(lv_indexClickable), libNCST_gf_ClickableUnit(lv_indexClickable));
        auto404734DB_ai = auto404734DB_ai+1;
    }

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:5183

        lv_indexClickable = UserDataInstance("Clickable", auto3D22C8A3_ai);
        ConversationDataRegisterPortrait(libNovC_gf_NC_ClickableConversationLink(lv_indexClickable), c_invalidPortraitId);
        ConversationDataRegisterUnit(libNovC_gf_NC_ClickableConversationLink(lv_indexClickable), libNCST_gf_ClickableUnit(lv_indexClickable));
        auto3D22C8A3_ai = auto3D22C8A3_ai+1;
    }

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCUI.galaxy:1017

    }
    ConversationDataRegisterPortrait("char_Nova", PortraitGetTriggerControl(libNCUI_gv_nU_MissionPortrait));
    ConversationDataRegisterUnit("char_Nova", null);
    if ((lp_mission == "Nova01")) {
        DialogControlSetVisible(libNCUI_gv_nU_MissionManagementEquipmentButton, PlayerGroupAll(), false);

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCUI.galaxy:1543

        lv_indexClickable = UserDataInstance("Clickable", auto8B731360_ai);
        ConversationDataRegisterPortrait(libNovC_gf_NC_ClickableConversationLink(lv_indexClickable), lp_portrait);
        ConversationDataRegisterUnit(libNovC_gf_NC_ClickableConversationLink(lv_indexClickable), null);
        auto8B731360_ai = auto8B731360_ai+1;
    }

mods/voidprologue.sc2modbase.sc2data/LibA3DDD02B.galaxy:6847

    }
    ConversationDataRegisterPortrait("char_RescuedTemplar", PortraitGetTriggerControl(libA3DDD02B_gv_pP_MLContactPortrait));
    ConversationDataRegisterUnit("char_RescuedTemplar", null);
    DialogClearSubtitlePositionOverride();
    DialogSetSubtitlePositionOverrideControl(libA3DDD02B_gv_pP_MLSubtitleFrame);