wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-28-2011, 07:48 PM   #1
Equal
User
 
Join Date: Sep 2011
Posts: 4

Equal has little to show at this moment (0)

Default Need a bit assist on IDDS

Hi,

I played around with the IDDS from rising dust, but i somhow cant figure out how to get it to work properly.

Collapse 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
Equal is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-29-2011, 04:13 AM   #2
Av3n
Roar!
 
Av3n's Avatar


Project Leader: TBR
Project Member: PoC
 
Join Date: May 2006
Posts: 1,854

Submissions (7)

Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)Av3n is a jewel in the rough (240)

Hero #4 extra-official winner2008 Spell olympics - Fire - BronzeHero Contest #3 - 3rd Place

Default

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
__________________

Thanks to FatherTime for the sig
.:
Current ProjectsSubmissions
Power of CorruptionMy Terrain
The Black RoadMy Resources
Strikeforce
Twitter
Av3n is offline   Reply With Quote
Old 09-29-2011, 05:26 AM   #3
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

Quote:
Originally Posted by Equal
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 -.-
As Av3n said, those functions are just cosmetic, they don't effect the actual damage delt. Dusk's prevent damage library is actually pretty decent, I use it.

Quote:
Originally Posted by Equal
And Btw, setting ArmorReduction to 0.00 from 0.06 is not the way to go to get 0 reduction.
There are 2 things that reduce the amount of damage a unit takes: armor (only reduces attack damage or damage from UnitDamageTargetEx if it is set to ConsiderArmor) and armor type. If you want 0 damage reduction you'll need to change "Armor Damage Reduction Multiplier" to 0 and all Damage Bonus Tables to have 1.0 for every value.

Last edited by Fledermaus : 09-29-2011 at 05:27 AM.
Fledermaus is offline   Reply With Quote
Old 09-29-2011, 10:02 AM   #4
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

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.
__________________
Anitarf is offline   Reply With Quote
Old 09-29-2011, 01:19 PM   #5
Equal
User
 
Join Date: Sep 2011
Posts: 4

Equal has little to show at this moment (0)

Default

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!

Collapse 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

Last edited by Equal : 09-29-2011 at 04:29 PM.
Equal is offline   Reply With Quote
Old 09-29-2011, 06:35 PM   #6
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

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.
__________________
Anitarf is offline   Reply With Quote
Old 09-29-2011, 07:01 PM   #7
Equal
User
 
Join Date: Sep 2011
Posts: 4

Equal has little to show at this moment (0)

Default

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:
  • Damage 1-1 looks ugly
  • Any manipulation will have to be coded
  • Must use Items to show any info about damage

But on the bright Side i dont have to use DamagePreventing :)
and have full on the fly controll.

Thx for help again!
Equal is offline   Reply With Quote
Old 09-30-2011, 03:40 AM   #8
Fledermaus
default string
 
Fledermaus's Avatar
 
Join Date: May 2006
Posts: 705

Submissions (1)

Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)Fledermaus is a jewel in the rough (194)

Send a message via MSN to Fledermaus
Default

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 ^^)
Fledermaus is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:15 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services