| 08-26-2007, 08:37 AM | #1 |
Hey, in my map there is 1 hero for which I need to differentiate between attacks and dmg from other sources. Naturaly, I downloaded the attack detect system =) I looked at it and saw it uses a frost orb ability to add a buff to the attacked unit when when it takes damage from an attack. Okay, that sounds easy. But if detecting an attack is as simple as detecting and then removing a dummy buff, what is the system for then? Also the system says it has some problems: "You can't use orb or arrow abilities in your map" Why not exactly? I have no experience using orbs. Can't you give a unit 2 orb abilities? It also says "you can't damage a unit the instant it is damaged" why not? |
| 08-26-2007, 08:38 AM | #2 |
Well, to describe the orbs: Orbs almost NEVER stack. It would, therefore, mess up either the system or your orbs. |
| 08-26-2007, 09:05 AM | #3 | |
The system recycles triggers so that you don't leak events like you would using emjlr3's AttackDetect sample. Quote:
|
| 08-26-2007, 05:34 PM | #4 |
leak events? did not know they leaked |
| 08-26-2007, 05:36 PM | #5 | |
Quote:
|
| 08-26-2007, 06:18 PM | #6 |
you can't recycle triggers... |
| 08-26-2007, 09:58 PM | #7 |
I didn't mean "recycle" literally. I mean that it uses 1 trigger for each unit and simply destroys that trigger when the unit no longer exists (dies). And yes, emjlr3, by continually adding events to a trigger that register when a specific unit takes damage you're leaking them when those units no longer exist. You could eventually end up with a trigger that had 1,000 events, but only 25 of them will ever fire because the units don't exist anymore. |
| 08-26-2007, 11:25 PM | #8 |
how does that pertain the alternate A.D.S. I made? |
| 08-27-2007, 12:04 AM | #9 | |
Quote:
Maybe that was Shadow1500's sample of showing damage as floating text. |
| 08-27-2007, 12:39 AM | #10 | |
Quote:
|
| 08-27-2007, 01:42 AM | #11 | |
Quote:
|
| 08-27-2007, 01:37 PM | #12 | |
Quote:
Too bad we don't have TriggerRemoveEvent... But who knows maybe unit events are recycled when unit is removed? Did anyone try to test this? So let me get a couple of things strait here. In order to do on attack detection I have to register EVENT_UNIT_DAMAGED to every unit on the map, and then have an orb effect on every hero (with low duration I guess) to actually see if unit is damaged with an attack? Is that all? Is there any way to avoid that event "leak" thing? Is there any limit to how low that orb effect duration can be? |
| 08-27-2007, 01:50 PM | #13 | |
Quote:
JASS:native ResetTrigger takes trigger whichTrigger returns nothing It's an interesting function and I've put it to the test a lot in finding ways to have to create fewer triggers. I've managed to find that it can cause handle indexing failures, which screws cache users, but can still make it useful for other array/struct/etc. driven maps. |
| 08-27-2007, 04:40 PM | #14 |
u only need .01 of an orb effect to register it, which is the lowest you can make it as far as these trigger events stacking up....a dynamic trigger for each unit works, just remove it when the unit is done, or just add units to one trigger, and every x seconds create a a new trigger, grab all units, register new ones, etc., if you are really that worried and want to use 1 trigger in anycase, 1 trigger/unit is far from bad, and it is in use on a td map I am working on ATM, which will have a good bit more units at a time then most any other map there is, other then like LOTR or something, with no slowdown/bad stuff/etc. btw this is the first time I have heard of an "event leak", and it being a big deal |
| 08-27-2007, 04:59 PM | #15 |
Can I by any chance get that trigger of yours? I looked at that demo map but it uses too many support libraries that I don't use and it would be silly to include them just so I could use on_attack. I could write it myself ofc, but if you already have a good solution I would like to use it. I am worried about that event stuff because I have a survival map, and around 50,000 units passes through it in a game...... |
