# 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.sc2modbase.sc2data/LibCOMI.galaxy:4530

    // Implementation
    CatalogFieldValueSet(c_gameCatalogEffect, libCOMI_gv_c_DehakaConsumeEffectPsiExplodeWeaponDmgLink, "Amount", lp_dehakaPlayer, (FixedToString(lv_totalDmg, c_fixedPrecisionAny)));
    libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogEffect, "DehakaConsumeEffectPsionicSearch", "AreaArray[" + IntToString(0) + "].Radius", lp_dehakaPlayer, UnitGetPropertyFixed(lp_dehakaUnit, c_unitPropRadius, c_unitPropCurrent), c_upgradeOperationAdd);
}

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

                        }
                        else {
                            libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "HHWidowMineBurrowedAttack", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
                            libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogBehavior, "HHWidowMineAnimationController", "Duration", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
                        }

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

                        else {
                            libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "HHWidowMineBurrowedAttack", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
                            libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogBehavior, "HHWidowMineAnimationController", "Duration", lp_player, (1.0 - (0.01 * lv_factionBonusAtkSpeedMulti)), c_upgradeOperationMultiply);
                        }
                    }

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

        lv_instance = UserDataInstance(auto9ADCDADB_userType, auto9ADCDADB_i);
        lv_uT = UserDataGetUnit(libCOMI_gv_cM_Tychus_UserTypeHeroList, lv_instance, "Unit Type", 1);
        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);
        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);
    }

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

        lv_uT = UserDataGetUnit(libCOMI_gv_cM_Tychus_UserTypeHeroList, lv_instance, "Unit Type", 1);
        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);
        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);
    }
}

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

    }

    libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "ChargedBuster", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
    libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "FenixDragoonAirBomb", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
    return true;

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


    libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "ChargedBuster", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
    libNtve_gf_CatalogFieldValueModifyBasedOnDefaultValue(c_gameCatalogAbil, "FenixDragoonAirBomb", "Cost[" + IntToString(0) + "].Cooldown.TimeUse", EventPlayer(), 1.0, c_upgradeOperationMultiply);
    return true;
}