# 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
Flags —Action
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 ] — Catalogstring
[ catalogentry ] — Entrystring
[ catalogfieldpath ] — Field Pathint
— Playerfixed
— Valueint
[ 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,
);
# Related
Category: Catalog / Support
- [P] — Upgrade Operation
- [P] — No Game Link
- [P] — No Alert
- [P] — Cost Type
- [P] — Catalog Type
- [P] — Any Game Link
- [P] — Field Type Category
- [F] —
bool
— Catalog Field Value Set — ( CatalogFieldValueSet ) - [F] —
bool
— Catalog Field Value Set As Real — ( libNtve_gf_CatalogFieldValueSetAsReal ) - [F] —
bool
— Catalog Field Value Modify — ( CatalogFieldValueModify ) - [F] —
bool
— Catalog Field Value Modify (Based On Default Value) — ( libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue ) - [F] —
bool
— Catalog Reference Set — ( CatalogReferenceSet ) - [F] —
bool
— Catalog Reference Set As Real — ( libNtve_gf_CatalogReferenceSetAsReal ) - [F] —
bool
— Catalog Reference Modify — ( CatalogReferenceModify ) - [F] —
bool
— Catalog Reference Modify (Based On Default Value) — ( libNtve_gf_CatalogReferenceModifyBasedOnDefaultValue ) - [F] —
void
— Catalog Link Replace — ( CatalogLinkReplace ) - [F] —
string
— Catalog Link Replacement — ( CatalogLinkReplacement )
# Examples
# mods/starcoop/starcoop.sc2mod
// 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)