# User Data (Model)

Grammar — User Data (userType, instance, field, index)
FlagsNative | Function

Returns a value from user data for the given type, instance, and field. User data is defined in the Data module.

# Arguments

  • string<gamelink::User> — User Type
  • string<userinstance> — Instance
  • string<userfield> — Field
  • int — Index

Returns — string<gamelink::Model>

native string UserDataGetModel(
	string inType,
	string inInstance,
	string inField,
	int inIndex,
);

Category: User Data / Get Value

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:1520

    // Automatic Variable Declarations
    // Implementation
    return UserDataGetModel("PlayerCommanders", lp_commander, "PortraitModel", 1);
}

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

    }

    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());

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:1288


    // Implementation
    libNtve_gf_SetDialogItemModel(libWCdr_gv_gameUI.lv_hero_Portrait, UserDataGetModel("PlayableLegends", libWCdr_gv_legends.lv_player[lp_player].lv_selectedLegend, "HeroPortraitModel", 1), lv_playergroup);
}