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 > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 11-03-2011, 05:37 PM   #76
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

I can't think of a case where I'd want to disable a response, so that feature seems useless to me. On the other hand, your implementation is missing the optional xedamage support of the original. I don't agree with these two changes.

As for other changes such as using AutoIndex, they don't change the functionality of the library so I don't mind. I don't see any advantage in implementing these changes in my version but I have nothing against them as an alternate flavour of the library.

By the way, you forgot the optional requirement(s) in the library declaration.
__________________
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 11-03-2011, 07:11 PM   #77
BBQ
User
 
Join Date: May 2011
Posts: 85

Submissions (2)

BBQ will become famous soon enough (30)BBQ will become famous soon enough (30)

Default

Well, I agree that what I did was rather useless (by the way, I forgot about xedamage, didn't leave it out on purpose). The whole thing about disabling a given response was to prevent an infinite loop -- but that can be taken care of by the user rather easily by using a single boolean.

By the way, I don't see a point in interfacing with other damage detection engines. I kind of dislike IDDS -- it somehow encourages dynamic triggers, and the UnitDamageTargetEx() function is rather limited, because different kinds of attack type / damage type combinations have their own merits, something which that function doesn't allow for (for example, I might want to use DAMAGE_TYPE_ENHANCED, which is the damage type used by the hardcoded Cleaving Attack ability, but I won't be able to). As for LLDD, sure, its working principle may be the base for DamageEvent, but I fail to see anything else about it.

I firmly think that using this along with xedamage is the way to go -- without the need of using (or interfacing with) other damage detection engines.

On the other hand, I'd like to see DamageEvent being changed to use a trigger condition instead of an action (even though the speed difference is negligible, it has been proven that destroying a trigger without actions on it is rather safe -- so you can get rid of the "delay" as well). And why not use .evaluate() instead of .execute()?

Last edited by BBQ : 11-03-2011 at 07:16 PM.
BBQ is offline   Reply With Quote
Old 11-04-2011, 12:06 AM   #78
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

Quote:
Originally Posted by BBQ
By the way, I don't see a point in interfacing with other damage detection engines.
There's not much point to it now. The point used to be to help this library gain acceptance back when those libraries were commonly used, I figured people wouldn't want to import DamageEvent if they were already using a different damage detection library.

Quote:
On the other hand, I'd like to see DamageEvent being changed to use a trigger condition instead of an action (even though the speed difference is negligible, it has been proven that destroying a trigger without actions on it is rather safe -- so you can get rid of the "delay" as well).
Well, I'm not so sure about trigger conditions being perfectly safe. I found an easy-to-reproduce example of handle stack corruption here and when I edited the code to use a trigger condition, the bug still occurred (since trigger conditions don't support waits, I had to move that part of the code to another function and run it with .execute).

Quote:
And why not use .evaluate() instead of .execute()?
I used .execute because I erroneously thought that .evaluate didn't protect the calling function from things like thread crashes in the called function. I guess I could change that to .evaluate now that I know better.
__________________
Anitarf is offline   Reply With Quote
Old 11-04-2011, 07:22 AM   #79
BBQ
User
 
Join Date: May 2011
Posts: 85

Submissions (2)

BBQ will become famous soon enough (30)BBQ will become famous soon enough (30)

Default

Quote:
Originally Posted by Anitarf
Well, I'm not so sure about trigger conditions being perfectly safe. I found an easy-to-reproduce example of handle stack corruption here and when I edited the code to use a trigger condition, the bug still occurred (since trigger conditions don't support waits, I had to move that part of the code to another function and run it with .execute).
That's the whole point. Every possible way of causing the bug involves TriggerSleepAction() in it -- something you can't use within a trigger condition. Using .execute() means that you're still using trigger actions. Furthermore, I don't think that people still use TriggerSleepAction(). But I guess it's all up to you.
BBQ is offline   Reply With Quote
Old 11-04-2011, 09:41 AM   #80
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

Quote:
Originally Posted by BBQ
That's the whole point. Every possible way of causing the bug involves TriggerSleepAction() in it -- something you can't use within a trigger condition. Using .execute() means that you're still using trigger actions. Furthermore, I don't think that people still use TriggerSleepAction(). But I guess it's all up to you.
Yes, but even if I switched to .evaluate users could still do an .execute in their own function and then use TriggerSleepAction. Of course, this is no argument against switching to trigger conditions, I could still do that since they're faster and all, but doing so won't prevent the possibility of handle stack corruption so I should keep the safety delay, even if it is unlikely that anyone who uses this will ever use TriggerSleepAction.
__________________
Anitarf is offline   Reply With Quote
Old 11-14-2011, 03:18 AM   #81
codart
User
 
Join Date: Jan 2011
Posts: 15

codart has little to show at this moment (0)

Default

Quote:
Originally Posted by Anitarf
I'm not sure what you mean. If you want to block damage with this system, you have to use a DamageModifier, it does not matter if you're doing it once or repeatedly. What exactly did you have in mind?
srr... my english isnt so good. another problem. let say i have 2 damagemodifier struct on a unit. the first multilpe the dam by 2 and the second try to block the damage. what is the code if i want the second alway block all the damage and ignore all other damage modifier instance?
codart is offline   Reply With Quote
Old 11-17-2011, 01:13 PM   #82
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

Quote:
Originally Posted by codart
srr... my english isnt so good. another problem. let say i have 2 damagemodifier struct on a unit. the first multilpe the dam by 2 and the second try to block the damage. what is the code if i want the second alway block all the damage and ignore all other damage modifier instance?
To block all the damage, simply do this:
Collapse JASS:
    struct foo extends DamageModifier
        method onDamageTaken takes unit damageSource, real damage returns real
            return -damage
        endmethod
    endstruct

There's no way to automatically ignore all other damage modifiers, they will still run, but you can code them in such a way that they do nothing if the damage was already prevented:
Collapse JASS:
    struct bar extends DamageModifier
        method onDamageTaken takes unit damageSource, real damage returns real
            if damage<=0.0 then // If the damage was prevented...
                return 0.0      // ...then do nothing.
            endif
            // Do your stuff here.
        endmethod
    endstruct

Edit: I moved some off-topic posts to a new thread.
__________________

Last edited by Anitarf : 11-17-2011 at 01:20 PM.
Anitarf is offline   Reply With Quote
Old 11-18-2011, 04:42 AM   #83
codart
User
 
Join Date: Jan 2011
Posts: 15

codart has little to show at this moment (0)

Default

damage modifier 1: piority 0;
damage modifier 2: piority 1;
Which one will be excute first?
codart is offline   Reply With Quote
Old 11-18-2011, 05:27 AM   #84
PurgeandFire111
User
 
PurgeandFire111's Avatar
 
Join Date: Dec 2006
Posts: 251

PurgeandFire111 will become famous soon enough (58)PurgeandFire111 will become famous soon enough (58)

Default

0 would execute first. It is ordered by priorities from least to greatest.

EDIT: @Anitarf: Whoops, sorry I think I misread. xD

Last edited by PurgeandFire111 : 11-19-2011 at 11:38 PM.
PurgeandFire111 is offline   Reply With Quote
Old 11-18-2011, 10:29 AM   #85
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

Quote:
Originally Posted by PurgeandFire111
0 would execute first. It is ordered by priorities from least to greatest.
Incorrect.
Quote:
Originally Posted by DamageModifier documentation
The system always evaluates the modifiers on the unit dealing the damage and on the unit taking the damage simultaneously, starting with the modifiers with the highest priority.
__________________
Anitarf is offline   Reply With Quote
Old 02-01-2012, 04:52 AM   #86
muzk
User
 
Join Date: Mar 2010
Posts: 5

muzk has little to show at this moment (0)

Default

Quote:
Originally Posted by Rising_Dusk
You really shouldn't do that.
Hey, what wrong with Negative Damage?
muzk is offline   Reply With Quote
Old 02-01-2012, 08:01 AM   #87
Anitarf
Procrastination Incarnate


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

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

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

Default

Quote:
Originally Posted by muzk
Hey, what wrong with Negative Damage?
It doesn't work?
__________________
Anitarf is offline   Reply With Quote
Old 02-01-2012, 08:42 AM   #88
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 230

Submissions (1)

Bribe will become famous soon enough (26)

Send a message via AIM to Bribe
Default

Yeah I tried healing with negative values with UnitDamageTarget before, it did 0 instead of healing.
Bribe is offline   Reply With Quote
Old 02-02-2012, 03:46 AM   #89
muzk
User
 
Join Date: Mar 2010
Posts: 5

muzk has little to show at this moment (0)

Default

I didn't know it x)
You can use AIrs to allow spells do negative damage.
muzk 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 02:18 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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