Catalog Set Value seems a good way to modify combat mechanics like damage, critical strike chances, armor reduction based on hero attributes.
The way I modify the hero's melee weapon damage based on the Strength attribute is like this:
Create a MeleeDamage damage effect
Use this effect on all melee weapons the hero can equip
Create a trigger that updates the MeleeDamage effect amount and random values whenever the hero attributes change. With this trigger you can set the damage based on whatever formula you wish to use, pretty useful. To modify the MeleeDamage effect Catalog Set Value can be used as follows:
Catalog - Set value of Effects "MeleeDamage" "Amount" for player player to (String(minDmg) with Any Precision decimal places)
Catalog - Set value of Effects "MeleeDamage" "Random" for player player to (String((maxDmg - minDmg)) with Any Precision decimal places)
To obtain weapons with different damage ranges you can create another 2 attributes (MinMeleeDamage, MaxMeleeDamage) and have the item equipping the weapon buff this 2 attributes
Works like a charm so far although I haven't tested it yet in multiplayer but since each player has a different catalog I suppose it should work.
Now we can extend this method to model the critical strike mechanic based on stats (e.g.: 1 point in Agility modifies the critical strike chance by 0.1%)
Basically all weapons and abilities will use a SetEffect as their damage effect containing an ApplyBehavior effect and the actual Damage effect.
The ApplyBehavior effect will apply a Buff effect on the target named CriticalStrikeDebuff.
The CriticalStrikeDebuff's DamageResponse is set up like this:
Has only 1 charge (this way will be consumed by the following damage effect in this case the damage effect from your set)
Has a chance to occur
Has the ModifyFraction field set to 2.0
Basically you can use the same CriticalStrikeDebuff on all abilities and weapons inflicting damage (or you can create separate ones for Melee damage and Spell damage or some abilities having a higher critical chance)
So far it works however Set Catalog Value doesn't work for CriticalStrikeDebuff:
Catalog - Set value of Behaviors "CriticalStrikeDebuff " "DamageResponse.Chance" for player player to (String(critChance) with Any Precision decimal places)
This action issues a ErrorCatalogFieldNotWritten.
Note that Catalog - Get value works using the same parameters.
I can only think about 2 possible answers:
1. Some catalog entries are read-only, that is we cannot modify them.
2. Catalog Set Value is bugged or I don't know how to properly use it. Maybe Catalog Set Value uses a different way to index subfields I don't know about (hopefully)
Does anyone know which is which or a way to use Catalog Set Value that works?
Most of the catalog fields indeed seem to be read-only, raising the ominous ErrorCatalogFieldNotWritten message when trying to set them. It's really annoying.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Catalog Set Value seems a good way to modify combat mechanics like damage, critical strike chances, armor reduction based on hero attributes. The way I modify the hero's melee weapon damage based on the Strength attribute is like this:
Works like a charm so far although I haven't tested it yet in multiplayer but since each player has a different catalog I suppose it should work.
Now we can extend this method to model the critical strike mechanic based on stats (e.g.: 1 point in Agility modifies the critical strike chance by 0.1%)
Basically all weapons and abilities will use a SetEffect as their damage effect containing an ApplyBehavior effect and the actual Damage effect. The ApplyBehavior effect will apply a Buff effect on the target named CriticalStrikeDebuff. The CriticalStrikeDebuff's DamageResponse is set up like this:
Basically you can use the same CriticalStrikeDebuff on all abilities and weapons inflicting damage (or you can create separate ones for Melee damage and Spell damage or some abilities having a higher critical chance)
So far it works however Set Catalog Value doesn't work for CriticalStrikeDebuff:
I can only think about 2 possible answers: 1. Some catalog entries are read-only, that is we cannot modify them. 2. Catalog Set Value is bugged or I don't know how to properly use it. Maybe Catalog Set Value uses a different way to index subfields I don't know about (hopefully)
Does anyone know which is which or a way to use Catalog Set Value that works?
Thank you
Most of the catalog fields indeed seem to be read-only, raising the ominous ErrorCatalogFieldNotWritten message when trying to set them. It's really annoying.