# Index Of User Data Instance

FlagsFunction

Returns the number of instances defined within the given user type. User types are defined within the Data module.

# Arguments

  • string<gamelink::User> — User Type
  • string<userinstance> — Instance

Returns — int

int libNtve_gf_UserDataInstanceGetIndex(
	string lp_userType,
	string lp_instance,
);

Category: User Data / Basic

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:12393

                lv_difficultyinstance = UserDataInstance(auto9578433B_userType, auto9578433B_i);
                if (((lv_brutalPlusPoints >= UserDataGetInt("MutationDifficultyLevels", lv_difficultyinstance, "PointsMin", 1)) && (lv_brutalPlusPoints <= UserDataGetInt("MutationDifficultyLevels", lv_difficultyinstance, "PointsMax", 1)))) {
                    TextExpressionSetToken("Param/Expression/lib_COMI_6F012790", "A", IntToText(libNtve_gf_UserDataInstanceGetIndex("MutationDifficultyLevels", lv_difficultyinstance)));
                    TriggerDebugOutput(1, TextExpressionAssemble("Param/Expression/lib_COMI_6F012790"), false);
                    libCOMU_gf_CT_SetMutationDifficultyLevel(lv_difficultyinstance);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:12530


        if ((lv_itPresetTeam != "No Preset Team")) {
            PlayerGroupAdd(libCOMI_gv_coopPresetTeams[libNtve_gf_UserDataInstanceGetIndex("PresetCoopPlayerTeams", lv_itPresetTeam)], lv_itPlayerId);
        }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:5131

        for ( ; autoC845F325_i <= UserDataInstanceCount(autoC845F325_userType) ; autoC845F325_i += 1 ) {
            lv_countweightinstance = UserDataInstance(autoC845F325_userType, autoC845F325_i);
            if ((UserDataGetInt("MutationDifficultyCountTargets", lv_countweightinstance, "MutatorCount", 1) == lv_countiter) && (libNtve_gf_UserDataInstanceGetIndex("MutationDifficultyLevels", UserDataGetUserInstance("MutationDifficultyCountTargets", lv_countweightinstance, "MinDifficulty", 1)) > lv_bestdifficultymatch)) {
                lv_bestdifficultymatch = libNtve_gf_UserDataInstanceGetIndex("MutationDifficultyLevels", UserDataGetUserInstance("MutationDifficultyCountTargets", lv_countweightinstance, "MinDifficulty", 1));
                lv_bestdifficultymatchtargetweight = UserDataGetFixed("MutationDifficultyCountTargets", lv_countweightinstance, "TargetWeight", 1);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:5132

            lv_countweightinstance = UserDataInstance(autoC845F325_userType, autoC845F325_i);
            if ((UserDataGetInt("MutationDifficultyCountTargets", lv_countweightinstance, "MutatorCount", 1) == lv_countiter) && (libNtve_gf_UserDataInstanceGetIndex("MutationDifficultyLevels", UserDataGetUserInstance("MutationDifficultyCountTargets", lv_countweightinstance, "MinDifficulty", 1)) > lv_bestdifficultymatch)) {
                lv_bestdifficultymatch = libNtve_gf_UserDataInstanceGetIndex("MutationDifficultyLevels", UserDataGetUserInstance("MutationDifficultyCountTargets", lv_countweightinstance, "MinDifficulty", 1));
                lv_bestdifficultymatchtargetweight = UserDataGetFixed("MutationDifficultyCountTargets", lv_countweightinstance, "TargetWeight", 1);
                if ((lv_countiter == lp_count)) {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMU.galaxy:5280

    // Implementation
    if ((lp_mutatorIndex <= libCOMU_gv_cT_MAbomination_MutatorsCount) && (libCOMU_gv_cT_MAbomination_Mutators[lp_mutatorIndex] != null)) {
        libCOOC_gf_CC_ScoreValueSet(lp_player, lp_mutatorScoreValue, libNtve_gf_UserDataInstanceGetIndex("Mutators", libCOMU_gv_cT_MAbomination_Mutators[lp_mutatorIndex]));
    }
    else {