# User Data (Sound)

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::Sound>

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

Category: User Data / Get Value

# Examples

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNovC.galaxy:1928

    }

    return UserDataGetSound("CampaignPerk", lp_campaignPerk, "UISound", 1);
}

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

        lv_herorevivesoundinstance = UserDataInstance(auto5BDC1380_userType, auto5BDC1380_i);
        if ((UserDataGetUnit("HeroReviveSounds", lv_herorevivesoundinstance, "HeroUnit", 1) == UnitGetType(lv_herounit)) && ((UserDataGetUpgrade("HeroReviveSounds", lv_herorevivesoundinstance, "RequiredUpgrade", 1) == null) || (TechTreeUpgradeCount(lv_owner, UserDataGetUpgrade("HeroReviveSounds", lv_herorevivesoundinstance, "RequiredUpgrade", 1), c_techCountCompleteOnly) > 0))) {
            libCOMI_gf_CM_HeroReviveQueue_PlaySound(SoundLink(UserDataGetSound("HeroReviveSounds", lv_herorevivesoundinstance, "HeroSound", 1), c_soundIndexAny), UserDataGetFixed("HeroReviveSounds", lv_herorevivesoundinstance, "HeroSoundDelay", 1), libCOOC_gf_CommanderPlayers());
            break;
        }

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


    // Implementation
    lv_vOSound = UserDataGetSound("PlayerCommanders", lp_commander, "StandardVO", (lp_line));
    if ((lv_vOSound == null)) {
        return null;

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

    lv_enableDisable = true;
    lv_singlePlayerGroup = PlayerGroupSingle(EventPlayer());
    lv_readySound = SoundLink(UserDataGetSound("PlayableLegends", libWCdr_gv_legends.lv_player[EventPlayer()].lv_selectedLegend, "ReadySound", 1), c_soundIndexAny);

    // Conditions

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

        DialogControlSetAnimationState(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[EventPlayer()].lv_readyPanel, PlayerGroupAll(), libWCdr_gv_animationStates.lv_readyState, libWCdr_gv_animationStates.lv_readyState_Ready);
        if ((lv_readySound != null)) {
            SoundPlayForPlayer(SoundLink(UserDataGetSound("PlayableLegends", libWCdr_gv_legends.lv_player[EventPlayer()].lv_selectedLegend, "ReadySound", 1), c_soundIndexAny), c_maxPlayers, PlayerGroupAll(), 100.0, 0.0);
        }