# Save User Data Instance

Grammar — Save user data for userType: instance to bank bank within the section section
FlagsNative | Action

Saves all modified values within the given instance.

# Arguments

  • string<gamelink::User> — User Type
  • string<userinstance> — Instance
  • bank — Bank
  • string — Section

Returns — void

native void UserDataSaveInstance(
	string inType,
	string inInstance,
	bank inBank,
	string inSection,
);

Category: User Data / Save/Load

# Examples

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

                lv_progressThisMission = libSwaC_gf_MissionObjectiveProgress(lv_indexObjective);
                UserDataSetInt("MissionObjective", libSwaC_gf_ZS_ObjectiveUserDataInstance(lv_indexObjective), "Progress", 1, libSwaC_gf_ZS_MissionObjectiveBestProgress(lv_indexObjective));
                UserDataSaveInstance("MissionObjective", libSwaC_gf_ZS_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
                UserDataSetInt("MissionObjective", libSwaC_gf_ZS_ObjectiveUserDataInstance(lv_indexObjective), "Progress", 1, lv_progressThisMission);
            }

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

            lv_indexObjective = CatalogEntryGet(c_gameCatalogObjective, auto2B4910CB_ai);
            if ((libSwaC_gf_MissionObjectiveIsPrimary(lv_indexObjective) == false)) {
                UserDataSaveInstance("MissionObjective", libSwaC_gf_ZS_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
            }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:3446

                lv_progressThisMission = libVoiC_gf_MissionObjectiveProgress(lv_indexObjective);
                UserDataSetInt("MissionObjective", libVoiC_gf_PS_ObjectiveUserDataInstance(lv_indexObjective), "Progress", 1, libVoiC_gf_PS_MissionObjectivePreviousProgress(lv_indexObjective));
                UserDataSaveInstance("MissionObjective", libVoiC_gf_PS_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
                UserDataSetInt("MissionObjective", libVoiC_gf_PS_ObjectiveUserDataInstance(lv_indexObjective), "Progress", 1, lv_progressThisMission);
            }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignLib.galaxy:3459

            auto3A779D38_ai = auto3A779D38_ai + 1;
            if ((libVoiC_gf_MissionObjectiveIsPrimary(lv_indexObjective) == false)) {
                UserDataSaveInstance("MissionObjective", libVoiC_gf_PS_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
            }

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

        lv_indexState = UserDataInstance("StoryStates", lv_stateIndex);
        if ((UserDataGetInt("StoryStates", lv_indexState, "Snapshot", 1) == 1)) {
            UserDataSaveInstance("StoryStates", lv_indexState, libVCST_gf_PS_TempConversationBank(), ("WriterStates"));
        }

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

        lv_indexState = UserDataInstance("StoryStates", lv_stateIndex);
        if ((UserDataGetInt("StoryStates", lv_indexState, "Snapshot", 1) == 1)) {
            UserDataSaveInstance("StoryStates", lv_indexState, libVoiC_gf_StoryBank(), ("WriterStateSnapshot"));
        }

mods/missionpacks/campaigncommon.sc2modbase.sc2data/LibComC.galaxy:1183

                lv_progressThisMission = libComC_gf_MissionObjectiveProgress(lv_indexObjective);
                UserDataSetInt("MissionObjective", libComC_gf_CC_ObjectiveUserDataInstance(lv_indexObjective), "Progress", 1, libComC_gf_CC_ObjectiveBestProgress(lv_indexObjective));
                UserDataSaveInstance("MissionObjective", libComC_gf_CC_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
                UserDataSetInt("MissionObjective", libComC_gf_CC_ObjectiveUserDataInstance(lv_indexObjective), "Progress", 1, lv_progressThisMission);
            }

mods/missionpacks/campaigncommon.sc2modbase.sc2data/LibComC.galaxy:1196

            autoCF0737AE_ai = autoCF0737AE_ai + 1;
            if ((libComC_gf_MissionObjectiveIsPrimary(lv_indexObjective) == false)) {
                UserDataSaveInstance("MissionObjective", libComC_gf_CC_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
            }

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

        lv_indexState = UserDataInstance("StoryStates", lv_stateIndex);
        if ((UserDataGetInt("StoryStates", lv_indexState, "Snapshot", 1) == 1)) {
            UserDataSaveInstance("StoryStates", lv_indexState, libNCST_gf_NS_TempConversationBank(), ("WriterStates"));
        }

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

        lv_indexState = UserDataInstance("StoryStates", lv_stateIndex);
        if ((UserDataGetInt("StoryStates", lv_indexState, "Snapshot", 1) == 1)) {
            UserDataSaveInstance("StoryStates", lv_indexState, libComC_gf_CC_StoryBank(), ("WriterStateSnapshot"));
        }

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

            lv_indexObjective = CatalogFieldValueGet(c_gameCatalogMap, libA3DDD02B_gf_CurrentMap(), "ObjectiveArray["+IntToString(auto62C536D3_ai-1)+"]", 1);
            if ((libA3DDD02B_gf_MissionObjectiveIsPrimary(lv_indexObjective) == false)) {
                UserDataSaveInstance("MissionObjective", libA3DDD02B_gf_PP_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
            }

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

            lv_indexObjective = CatalogEntryGet(c_gameCatalogObjective, auto2B4910CB_ai);
            if ((libA3DDD02B_gf_MissionObjectiveIsPrimary(lv_indexObjective) == false)) {
                UserDataSaveInstance("MissionObjective", libA3DDD02B_gf_PP_ObjectiveUserDataInstance(lv_indexObjective), lp_targetBank, lv__SectionName);
            }