I am trying to create a exponentially regressive damage reduction that would give a damage reduction % shown by the formula 1-(.988^x) where X is a unit's armor value. (1.2% damage reduction per point of armor)
This is similar to the damage reduction from the toughness/resistance stats in Custom hero defense (search it) however i know that the creator of that map has said the stats are only a display value for what is actually going on with triggers. Doing this with armor damage reduction formulas in the data editor isn't an option because of a certain way i am setting up this damage reduction.
i do believe i have to set up a variable (a real) that will increase whenever the player's armor increases which i have already accomplished. from here i am not sure how to complete the setup for working damage reduction.
I have what you are looking for. Let me boot up the ol'e editor... I gotta ask what your project is; while this loads...
Catalog - Set value of Behaviors DamageReduction DamageResponse.ModifyFraction for player Trig Player to (String(((Real((Value of Behaviors DamageReduction DamageResponse.ModifyFraction for player Trig Player))) - ((Real((Value of Behaviors DamageReduction DamageResponse.ModifyFraction for player Trig Player))) * .012))) with Any Precision decimal places)
I have a behavior on all of my heroes called "Damage Reduction" which is a damage response buff; which reduces oncoming damage. When a stat point is invested into armor, I run this action. In simple terms, "Set reduction=reduction - (reduction*.012)" Every point will give you 1.2% more effective HP; and you can never break 100% damage reduction.
Another way to do it (I dont like stacking un-needed buffs) is to have a buff like above; set the damage modifier to .988 and add X number of that buff to the unit. It will work the same way; except that stacking 1000 damage response buffs will create unkind lag for slow computers.
With my method it is important that if you are adding multiple stat points at once (say you have a way to buy 5 points of armor with 1 click) you must run the action through a loop; do not multiply that 1.2% by 5 (getting 6%) and then subtract it; you will end up with an impure number.
i have everything set up but the damage fraction value isn't being updated when the trigger should be running, could you post a sample map with the working trigger so i can see how that catalog is setup for the string part?
My project is Hero Income Defense, you can find it in the arcade but its really more of a beta/work in progress at the moment.
It is working in this attached map. to text it out; type -armor 1 for 1 armor added to the zergling, -armor 10 for 10 armor, and -armor 50 for 50 armor.
I tested it, adding 300 armor at 2% reduction per point, and was still dealing .2% damage; which seems about right. ...As opposed to dealing -500% damage...
Okay. so i found how you did the string part, i didnt know what functions you used to order it up you only wrote out what it looked like. Thank you very much for your help.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am trying to create a exponentially regressive damage reduction that would give a damage reduction % shown by the formula 1-(.988^x) where X is a unit's armor value. (1.2% damage reduction per point of armor) This is similar to the damage reduction from the toughness/resistance stats in Custom hero defense (search it) however i know that the creator of that map has said the stats are only a display value for what is actually going on with triggers. Doing this with armor damage reduction formulas in the data editor isn't an option because of a certain way i am setting up this damage reduction.
i do believe i have to set up a variable (a real) that will increase whenever the player's armor increases which i have already accomplished. from here i am not sure how to complete the setup for working damage reduction.
I have what you are looking for. Let me boot up the ol'e editor... I gotta ask what your project is; while this loads...
Catalog - Set value of Behaviors DamageReduction DamageResponse.ModifyFraction for player Trig Player to (String(((Real((Value of Behaviors DamageReduction DamageResponse.ModifyFraction for player Trig Player))) - ((Real((Value of Behaviors DamageReduction DamageResponse.ModifyFraction for player Trig Player))) * .012))) with Any Precision decimal places)
I have a behavior on all of my heroes called "Damage Reduction" which is a damage response buff; which reduces oncoming damage. When a stat point is invested into armor, I run this action. In simple terms, "Set reduction=reduction - (reduction*.012)" Every point will give you 1.2% more effective HP; and you can never break 100% damage reduction.
Another way to do it (I dont like stacking un-needed buffs) is to have a buff like above; set the damage modifier to .988 and add X number of that buff to the unit. It will work the same way; except that stacking 1000 damage response buffs will create unkind lag for slow computers.
With my method it is important that if you are adding multiple stat points at once (say you have a way to buy 5 points of armor with 1 click) you must run the action through a loop; do not multiply that 1.2% by 5 (getting 6%) and then subtract it; you will end up with an impure number.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
@GlornII: Go
i have everything set up but the damage fraction value isn't being updated when the trigger should be running, could you post a sample map with the working trigger so i can see how that catalog is setup for the string part?
My project is Hero Income Defense, you can find it in the arcade but its really more of a beta/work in progress at the moment.
It is working in this attached map. to text it out; type -armor 1 for 1 armor added to the zergling, -armor 10 for 10 armor, and -armor 50 for 50 armor.
I tested it, adding 300 armor at 2% reduction per point, and was still dealing .2% damage; which seems about right. ...As opposed to dealing -500% damage...
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
@GlornII: Go
Okay. so i found how you did the string part, i didnt know what functions you used to order it up you only wrote out what it looked like. Thank you very much for your help.