# Catalog Field Value Modify (Based On Default Value)

Grammar — Modify value of catalog entry fieldPath for player player using operation and value, based on its default value
FlagsAction

Modifies the value of a field for an entry based on the default value instead of the current value. To find the name of a field path, open the data editor and turn on View Raw Data. For example, if you wanted to set the unit for the first index of a train ability, your field path string would be “InfoArray[0].Unit”.

# Arguments

  • int [ preset::CatalogType ] — Catalog
  • string [ catalogentry ] — Entry
  • string [ catalogfieldpath ] — Field Path
  • int — Player
  • fixed — Value
  • int [ preset::UpgradeOperation ] — Operation

Returns — bool

bool libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(
	int lp_catalog,
	string lp_entry,
	string lp_fieldPath,
	int lp_player,
	fixed lp_value,
	int lp_operation,
);

Category: Catalog / Support

# Examples

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L4527
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogEffect, "DehakaConsumeEffectPsionicSearch", "AreaArray[" + IntToString(0) + "].Radius", lp_dehakaPlayer, UnitGetPropertyFixed(lp_dehakaUnit, c_unitPropRadius, c_unitPropCurrent), c_upgradeOperationAdd)
// L5072
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "HHWidowMineBurrowedAttack", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply)
// L5073
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogBehavior, "HHWidowMineAnimationController", "Duration", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply)
// L6057
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(0) + "]", lp_p, RoundI((lp_multiplyMinerals * libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(0) + "]", c_playerAny) * lv_costfactor)), c_upgradeOperationSet)
// L6058
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(1) + "]", lp_p, RoundI((lp_multiplyMinerals * libNtve_gf_CatalogFieldValueGetAsReal(c_gameCatalogUnit, lv_uT, "CostResource[" + IntToString(1) + "]", c_playerAny) * lv_costfactor)), c_upgradeOperationSet)
// L19356
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "ChargedBuster", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply)
// L19357
libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "FenixDragoonAirBomb", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply)