# User Data (Model)
Grammar — User Data (userType, instance, field, index)
Flags —Native
|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 Typestring
<userinstance> — Instancestring
<userfield> — Fieldint
— Index
Returns — string
<gamelink::Model>
native string UserDataGetModel(
string inType,
string inInstance,
string inField,
int inIndex,
);
# Related
Category: User Data / Get Value
- Load User Data Value Into Variable
- User Data (Ability Command) —
abilcmd
— UserDataGetAbilCmd - User Data (Actor) —
string
<gamelink::Actor> — UserDataGetActor - User Data (Color) —
color
— UserDataGetColor - User Data (Compare) —
int
<preset::UserDataCompare> — UserDataGetCompare - User Data (Game Link) —
string
<gamelink> — UserDataGetGameLink - User Data (Image) —
string
<filepath> — UserDataGetImagePath - User Data (Image Edge) —
int
<preset::TextTagEdge> — UserDataGetImageEdge - User Data (Image Attach) —
string
<preset::AttachPoints> — UserDataGetImageAttachPoint - User Data (Integer) —
int
— UserDataGetInt - User Data (Model) —
string
<gamelink::Model> — UserDataGetModel - User Data (Movie) —
string
<filepath> — UserDataGetMovie - User Data (Real) —
fixed
— UserDataGetFixed - User Data (Sound) —
string
<gamelink::Sound> — UserDataGetSound - User Data (String) —
string
— UserDataGetString - User Data (Text) —
text
— UserDataGetText - User Data (Unit) —
string
<gamelink::Unit> — UserDataGetUnit - User Data (Upgrade) —
string
<gamelink::Upgrade> — UserDataGetUpgrade - User Data (User Type) —
string
<gamelink::User> — UserDataGetUserType - User Data (User Instance) —
string
<userinstance> — UserDataGetUserInstance
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:1520
// Automatic Variable Declarations
// Implementation
return UserDataGetModel("PlayerCommanders", lp_commander, "PortraitModel", 1);
}
mods/starcoop/starcoop.sc2mod — base.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.sc2mod — base.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);
}