# Modify User Data (Game Link)

Grammar — Set user data (userType, instance, field, index) to value
FlagsNative | Action

Modifies user data for the given type, instance, and field. User data is defined in the Data module. Only works for fields marked as modifiable.

# Arguments

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

Returns — void

native void UserDataSetGameLink(
	string inType,
	string inInstance,
	string inField,
	int inIndex,
	string inValue,
);

Category: User Data / Set Value

# Examples

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

void libNovC_gf_NC_ArmyTechItemAssignedUnitSet (string lp_techItem, string lp_assignedUnit) {
    // Implementation
    UserDataSetGameLink("CampaignTechItem", lp_techItem, "AssignedUnit", 1, lp_assignedUnit);
}

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

    }
    if ((lp_primary == true)) {
        UserDataSetGameLink("PlayerCommanders", "TerranTychus", "ScoreStatisticCoop", 1, lv_scoregamelink);
    }
    else {

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

    }
    else {
        UserDataSetGameLink("PlayerCommanders", "TerranTychus", "ScoreStatisticSelf", 1, lv_scoregamelink);
    }
    auto21B3BDD7_val = lp_tychusPlayer;