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 10-21-2009, 02:54 PM   #1
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 DamageEvent & DamageModifiers

This is a compilation of libraries intended to replace the damage detection and prevention engine ADamage. Originally, this was intended to be merely the next version of ADamage, but some conceptual changes such as moving from damage prevention to more general damage modification made it difficult to maintain backwards compatibility, so I decided to make it a new resource instead which could provide a more general, robust and modular damage detection and modification framework than ADamage. Also, I know some people will like that fact that I gave it a new name.

The resource is split into two libraries:
  • DamageEvent, a damage detection engine.

    If you are already using another damage detection system in your map, DamageEvent will interface with it instead of creating its own damage detection triggers to avoid wasting performance. Currently supported damage detection systems are IDDS and LLDD.
    Expand DamageEvent:

  • DamageModifiers, an optional addon that allows you to modify damage.

    Two versions of DamageModifiers are provided, one that uses Table and one that uses AutoIndex.
    DamageModifiers can use either xepreload or AbilityPreload to preload the ability it uses.
    Expand DamageModifiers (Table version):
    Expand DamageModifiers (AutoIndex version):
__________________

Last edited by Anitarf : 05-21-2011 at 01:45 PM.
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-21-2009, 03:05 PM   #2
Tot
6
 
Tot's Avatar
 
Join Date: Oct 2008
Posts: 841

Tot will become famous soon enough (53)Tot will become famous soon enough (53)

Default

This is a really cool system, but a bit complecated!!

can you please include a demo-map?

would be nice
__________________
Current Projects:
  • Masters Of WarCraft: Some mixture of AoS and RPG
    Terrain: 100%, Coding: 75%, Heroes: 0%, Items: 0%, Creeps: 0%, Upgrades: 0%
  • hunting emos
____________________________________
scheiss kack dreck sausacksau bundeswehr
Tot is offline   Reply With Quote
Old 10-21-2009, 04:04 PM   #3
nichts
User
 
Join Date: Nov 2006
Posts: 40

nichts has little to show at this moment (4)

Default

now that there are static ifs and optional library requirements:
why don't you merge the Table and the AutoIndex version into one library - that would make later switching much easier (and they don't seem to be that different from each other anyway)
nichts is offline   Reply With Quote
Old 10-21-2009, 05:01 PM   #4
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

Well, optional requirements are just that, optional. In this case, however, the requirement isn't optional: either Table or AutoIndex, one of those requirements must be there. Furthermore, I need to declare globals depending on which library is used and I'm not sure I can do that in static ifs.

I suppose I could use static ifs for alternate versions of DamageEvent, though.
__________________
Anitarf is offline   Reply With Quote
Old 10-22-2009, 07:42 AM   #5
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Collapse JASS:
//*  Damage modifiers are implemented as structs that extend the
//*  system's DamageModifier struct. A damage modifier is created
//*  for a specific unit and can modify both the damage that the
//*  unit deals and receives (using the damage and damaged methods
//*  respectively, see the interface defined at the end of the
//*  calibration section).
Shouldn't it be UNIT_TYPE specific?

Further on, there is no example code.
No matter how good your documentation is, an example code is always on top when it comes to user friendly.

Some good stuff you did:
- Automatic Trigger Refresh
- Versions for Table, AutoIndex
- Versions for IDDS, LLDD

Edit:
Collapse JASS:
// In wc3, damage events sometimes occur when no real damage is dealt,
        // for example when some spells are cast that don't really deal damage,
        // also some systems use very small damages to test for valid targets,
        // so this system will only consider damage events where damage is
        // higher than this threashold value.
        private constant real DAMAGE_THRESHOLD = 0.05
Damage event bigger then DAMAGE_THRESHOLD AND smaller then 0 should be considered.

Edit2:
Collapse JASS:
public struct shield extends shield_template
        private ShieldRelay relay
        
        static method create takes unit u, integer priority returns shield
Is there any reason why you wrote that public to the struct, but not the public to the static?


Edit3:
Collapse JASS:
        method damaged takes unit damageSource, real damage returns real //returned real says how much damage to prevent

What do you mean with prevent? Elaborate please.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 10-22-2009 at 07:50 AM.
Anachron is offline   Reply With Quote
Old 10-22-2009, 10:01 AM   #6
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 Anachron
Shouldn't it be UNIT_TYPE specific?
No.

Quote:
Further on, there is no example code.
No matter how good your documentation is, an example code is always on top when it comes to user friendly.
There is an example in the DamageModifiers documentation.

Quote:
Damage event bigger then DAMAGE_THRESHOLD AND smaller then 0 should be considered.
Why?

Quote:
Is there any reason why you wrote that public to the struct, but not the public to the static?
Methods without a prefix are already considered public.

Quote:
What do you mean with prevent? Elaborate please.
No. Read the documentation.
__________________
Anitarf is offline   Reply With Quote
Old 10-22-2009, 04:35 PM   #7
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
No.
Why not? I would rather set the data for a unittype instead for every single unit.

Quote:
There is an example in the DamageModifiers documentation.
Ehrm,... You can't call that example.

Quote:
Why?
Because else it doesn't register negative damage events?

Quote:
Methods without a prefix are already considered public.
Sure, but structs without a prefix are already considered as public too.

Quote:
No. Read the documentation.
I did but still its unclear for me.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-22-2009, 05:30 PM   #8
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,727

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Anachron
Why not? I would rather set the data for a unittype instead for every single unit.
I would rather, as a user, have control at the unit level than at the unittype level.
Quote:
Originally Posted by Anachron
Because else it doesn't register negative damage events?
No DDS supports negative damage, nor should they. If you want to heal a unit, negative damage is not the way to do it.
__________________
Rising_Dusk is offline   Reply With Quote
Old 10-22-2009, 05:30 PM   #9
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 Anachron
Why not? I would rather set the data for a unittype instead for every single unit.
I wouldn't. How am I supposed to make a buff that modifies incoming damage if I can't apply it to a specific unit?

Quote:
Ehrm,... You can't call that example.
I just did.

Quote:
Because else it doesn't register negative damage events?
Okay, I'll fix it when you manage to produce a negative damage event.

Quote:
Sure, but structs without a prefix are already considered as public too.
There is a difference between a struct with a public prefix and a struct without one. There is no such diference when it comes to struct methods.

Quote:
I did but still its unclear for me.
My point was that I don't care, the documentation clearly states that I do not intend to provide any further support for that library, this includes answering your vague questions about it.
__________________
Anitarf is offline   Reply With Quote
Old 10-23-2009, 07:45 AM   #10
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

To Dusk:


Quote:
I would rather, as a user, have control at the unit level than at the unittype level.
You got me wrong. You should be able to handle it on unit level too, but maybe the user doesn't want to just set all the data for every single unit, so you can add a small (optional) addon (module) to store stuff in tables and just set the unit data on entering the playable map area to the data you saved to be basic for any unit of that type?

Quote:
No DDS supports negative damage, nor should they. If you want to heal a unit, negative damage is not the way to do it.
Is there any other way as doing an triggered heal that has a damagetype/weapontype? I for example use it (native UnitDamageTarget) to heal units too. That allows me to even block heals from units.




to Anitarf:


Quote:
I wouldn't. How am I supposed to make a buff that modifies incoming damage if I can't apply it to a specific unit?
Please read the first answer to Rising_Dusk.

Quote:
I just did.
Its not looking as helping anyone who got questions, really.

Quote:
Okay, I'll fix it when you manage to produce a negative damage event.
Collapse JASS:
native UnitDamageTarget             takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean

Quote:
There is a difference between a struct with a public prefix and a struct without one. There is no such diference when it comes to struct methods.
Which different? I didn't heard of any. (Wanna learn! :))

Quote:
My point was that I don't care, the documentation clearly states that I do not intend to provide any further support for that library, this includes answering your vague questions about it.
If you don't care about users to get to know to your system who need help in your stuff, how can you submit it then? Its a insolence to provide such advanced stuff without further help.

__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-23-2009, 08:31 AM   #11
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Anachron
Which different? I didn't heard of any. (Wanna learn! :))
Quote:
Originally Posted by Anitarf
Read the documentation.

Though he was referring to his system's documentation, I am using that quote to refer to vJass' documentation.

If you want to learn, start with English.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury is offline   Reply With Quote
Old 10-23-2009, 08:43 AM   #12
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Though he was referring to his system's documentation, I am using that quote to refer to vJass' documentation.
I am quite sure you learned vJass by getting help from other people, not from reading the documentation.

Quote:
If you want to learn, start with English.
Its not my fault that in school English isn't teached well, I already in a good english course but still my english isn't that good as yours.

So what about it?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-23-2009, 08:47 AM   #13
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:
Its not looking as helping anyone who got questions, really.
If you have specific questions, then ask away.

Quote:
Collapse JASS:
native UnitDamageTarget             takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
Have you tested that? When I tried that with a negative value, I got a damage event with a total of 0 damage. Unless you can actually produce a negative damage event in a test map, shut up.

Quote:
If you don't care about users to get to know to your system who need help in your stuff, how can you submit it then? Its a insolence to provide such advanced stuff without further help.
Again, read the documentation. It clearly states that that is a compatibility library. I don't need to provide support for that, because noone is supposed to keep using it, it is just meant to provide backwards compatibility to old resources. If you really care so much about it, go read the ADamage documentation.
__________________
Anitarf is offline   Reply With Quote
Old 10-23-2009, 08:52 AM   #14
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Have you tested that? When I tried that with a negative value, I got a damage event with a total of 0 damage. Unless you can actually produce a negative damage event in a test map, shut up.
You could also use any negative attack (UnitDamage - 1000), I am quite sure it will heal in every testmap.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-23-2009, 08:55 AM   #15
Earth-Fury
Two Blue
 
Earth-Fury's Avatar
 
Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)Earth-Fury is just really nice (343)

Send a message via MSN to Earth-Fury
Default

Quote:
Originally Posted by Anachron
You could also use any negative attack (UnitDamage - 1000), I am quite sure it will heal in every testmap.
Quote:
Originally Posted by Anitarf
Unless you can actually produce a negative damage event in a test map, shut up.
__________________
Useful Links:
My Resources:
Good Resources:
Search
Tutorials
Ability Guide

UnitMaxState
BonusMod

AutoIndex
ARGB
TimerUtils

Earth-Fury 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 01:32 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