| 05-06-2009, 01:41 PM | #2 |
Use GUI tags. Change condition on damaged trigger to be life < damage taken + 1; should fix it. If a unit's health goes below 0.405, then it dies - it doesn't have to go to zero. |
| 05-06-2009, 01:46 PM | #3 |
Thx for the quick feedback, testing this solution rightaway. i will learn to use GUI tags, too. By the way could this system be responsible for a sudden increase in lag? (from one version of the map without it, to one with it?) EDIT: Actually, is this system efficient or could it be improved in any way (no talking about jassing it, there)? |
| 05-06-2009, 05:56 PM | #4 |
You will probably get more feedback after you convert it to GUI tags, I don't want to read it with those screenshots. |
| 05-06-2009, 09:03 PM | #5 |
Omg... i just tried using GUI tags, the only way i found is to manually right click every single line and "copy as text" then paste it here between both tags... This is such a Pain >.< it's gonna take me half an hour to paste the amount of lines i have in those triggers :/ i'm sure there must be another way, could you guys please teach me? |
| 05-06-2009, 09:16 PM | #6 |
Just right click on the trigger title and select copy as text. That will copy the whole trigger. |
| 05-06-2009, 09:18 PM | #7 | |
Quote:
|
| 05-06-2009, 09:35 PM | #8 |
Okay thanks for the GUI tags tuto guys, i have fixed the display now, and added the roles of each trigger. So, any idea? |
| 05-06-2009, 10:36 PM | #9 |
Well the only part of those triggers relevant to your question seems to be the part where you increase the unit's life if they would have died from the damage taken. These are two possible problems (other than the one you noticed about units dying in one hit): 1.) You should follow Griffen's advice and consider the fact that units die if their HP goes below 0.405, not below 0. So your condition needs to be "if unit life - 0.405 >= damage" (this is probably your main problem) 2.) If two units damage the same unit at exactly the same time (more common than you might think if you have lots of units on the map), and the sum of their damage is enough to kill the damaged unit in one hit, this method won't save it from dying Let me ask you this, are you completely allergic to using custom script calls or libraries? |
| 05-06-2009, 10:51 PM | #10 |
First of all: i've tried Griffen's system, and in the last test i ran, with thousands of instances of the antideath triggers firing, none of the heroes died to a non-hero unit!! I found some other bugs though, so ill fix them and retest to see if it's Really actually working. @grim: Actually I just don't have any clue about libraries, but I have nothing against custom scripts. I have made a couple jass spells/mechanisms in this map aswell btw. Why would i use a custom script in this trigger btw? could it improve anything? I don't think it leaks, i mean. EDIT: Also, any idea if there is a fix for this case: "the hero is dealt damage higher than his max hp." ? I thought about making him invulnerable and running a timer expiring in 0.00 or 0.01 seconds that removes the invul, any better idea? |
| 05-06-2009, 10:58 PM | #11 |
Add an ability giving it a load more HP, then have a 0. second timer and then remove it. |
| 05-06-2009, 11:18 PM | #12 |
If it were that simple, Griffen, DamageMod wouldn't need to exist. Dj0z, you're trying to do something that is actually quite complicated to pull off correctly. If you just add some max life to the unit it will probably work "most of the time," but you'll still get the random errors, especially if two units attack at the exact same time. Anyway there is no point in explaining to you how to reinvent the wheel, this is exactly what I created DamageMod for. I would suggest you use it. It will just take a very simple custom script call to modify the incoming damage by the correct amount to leave the damaged unit with 1 HP. |
| 05-06-2009, 11:23 PM | #13 | |
Quote:
There is no such thing possible as "attacking at the exact same time." Simply that cannot happen. All in-game events are processed sequentially. However, involvement of timer can cause an issue. In that particular case, insufficient logic may cause some trouble since execution order is not guaranteed. While attacks cannot be at the exact same time, but they can happen in a single frame. Added: As the event fires before actual damage is applied, I think there still is possibility of conflict. I think you can solve that by saving the amount of adjusted life to a unit, comparing it with unit's current life, and accumulate it if necessary. Whether there is possible conflict and needs to be solved can only be determined by further testing (means I'm not sure that may happen). |
| 05-06-2009, 11:24 PM | #14 | |
Quote:
You're wrong. There's a minimum granularity to the attack intervals in WC3. Test it yourself. |
| 05-07-2009, 02:36 AM | #15 |
Ye, grim is correct Is how "EvasionMod" works |
