| 09-28-2011, 06:48 PM | #1 |
Hi, I played around with the IDDS from rising dust, but i somhow cant figure out how to get it to work properly. JASS:scope DamageSwapPassive initializer Init private function Conditions takes nothing returns boolean return GetTriggerDamageType() == DAMAGE_TYPE_ATTACK and GetRandomInt(1, 100) <= 50 endfunction private function Actions takes nothing returns nothing call BJDebugMsg("Damage type swapped to FLAME!") call SetDamageType(DAMAGE_TYPE_IGNORED) endfunction private function Init takes nothing returns nothing local trigger trg = CreateTrigger() call TriggerAddAction(trg, function Actions) call TriggerAddCondition(trg, Condition(function Conditions)) call TriggerRegisterDamageEvent(trg, 0) set trg = null endfunction endscope This is from the Demo map and i changed from flame to ignored, but there is still damage dealt oO.. I also tried to make SetDamage(0) but it strangly doesnt change anything -.- And Btw, setting ArmorReduction to 0.00 from 0.06 is not the way to go to get 0 reduction. Greets Equal |
| 09-29-2011, 03:13 AM | #2 |
For your first question... the SetDamage function changes the value of damage associated with the trigger, not the actual damage packet itself. I guess you wanted a damage prevention system... here's a _graveyarded_ addon by Rising_Dusk for preventing damage. Keep in mind it is outdated though. http://www.wc3c.net/showthread.php?t...=PreventDamage -Av3n |
| 09-29-2011, 04:26 AM | #3 | ||
Quote:
Quote:
|
| 09-29-2011, 09:02 AM | #4 |
If you need to modify the damage of attacks, I recommend DamageModifiers which is a very robust damage prevention engine. It doesn't cover the full functionality of IDDS, it lacks the support for tracking the damage type of a damage event, but there are other specialised libraries that can fill that gap, for example xedamage. |
| 09-29-2011, 12:19 PM | #5 |
Wow guys, Thx for the big and quick help, i rly apprishiate it. Edit: i got a problems still, I now use ArmorUtils to get the Armor, but lol... got a serious prob! My map uses 0 reduction, and so i changed the ARMOR_REDUCTION_MULTIPLIER to 0 but..... well i have no nullTalisman that allows dividing throu 0... help! JASS:if redc >= 1. then //Invulnerable return ARMOR_INVULNERABLE elseif redc < 0. then //Negative Armor return -Log(redc+1.)/NATLOG_094 else //Positive Armor return redc/(ARMOR_REDUCTION_MULTIPLIER*(1.-redc)) endif |
| 09-29-2011, 05:35 PM | #6 |
ArmorUtils gets a unit's armour based on how much damage dealt to that unit is reduced. If your armour doesn't cause any damage reduction, then ArmorUtils can not work. Either your armour has to reduce damage or you need to find an alternative way to obtain a unit's current armour, for example by manually inputting base armour values for all unit types and then implementing all your armour bonuses through BonusMod. |
| 09-29-2011, 06:01 PM | #7 |
That, good Sir, causes a fundamental change of plans. Looks like i have to do it then in a very ugly way. Gonna make all units do 1 damage and set GameConstant DMGreduction to 0.01, So i would be technicaly able to get the Armor. And then trigger everything throu IDDS. They only downsides i can think of are:
But on the bright Side i dont have to use DamagePreventing :) and have full on the fly controll. Thx for help again! |
| 09-30-2011, 02:40 AM | #8 |
The other option would be to have a 0.01 Armor Damage Reduction Multiplier and whenever attack damage is delt, deal an extra GetReducedDamage(GetTriggerDamage(), GetUnitArmor(GetTriggerDamageTarget()) damage. Unless I'm misunderstanding what you're trying to do. (Feel free to post what you're trying to do, we might be able to find a better way for you to do it ^^) |
