| 04-27-2006, 04:59 PM | #1 |
JASS:local unit t = GetTriggerUnit() local real d = GetEventDamage() ... call BJDebugMsg("HV TARGET DAMAGED") if d >= GetUnitState(t, UNIT_STATE_LIFE) then call BJDebugMsg("HV LETHAL DAMAGE") ... I remember reading someplace that units don't die when their hp goes below 0, but below 1, if it's true, then this is most likely the cause of my bug. Unrelated to this, here's another wierd trigger: Trigger: Speaking of Robo Goblin, I seem to remember (not sure about it, though) that there were problems with modifying it when it first came out, since you couldn't change the armour and hp bonus, well now it seems like you can. |
| 04-27-2006, 05:06 PM | #2 |
For the first one, a unit dies when its hp gets to 0.405 or lower. That is probably the problem. For the second, pause the unit, issue the stop order, then unpause it again. |
| 04-27-2006, 05:52 PM | #3 |
0.405? Odd number. Well, if I add it to the unit's life in that real comparison, the problem should be fixed, then. Right, I completely forgot I was planning to test the pausing/unpausing anyway. Thanks for reminding me. |
| 04-28-2006, 09:48 AM | #4 |
Pausing/unpausing the unit didn't do the trick. Oh, and about the robo goblin, it was the other way around, the unit didn't morph, but the spell changed it's icon. |
| 04-28-2006, 11:24 AM | #5 |
When a unit is damaged, if you add a condition that checks its life, it will always return that its alive, because when its damaged, it checks on the actual damage, and not after it. if you want to check you have to add a .01 timer that THEN checks its life. |
| 04-28-2006, 11:32 AM | #6 |
I didn't know that, buf it it is true, then you do not need a timer, you can just use GetWidgetLife(unit)-GetEventDamage(). |
| 04-28-2006, 11:34 AM | #7 | |
Quote:
He is checking if the damage is greater than its life remaining, which will accurately find if the unit is killed or not (once the 0.405 thing is taken into account). |
| 04-28-2006, 12:16 PM | #8 |
That's weird, .405.. you tested that? |
| 04-28-2006, 02:39 PM | #9 |
Vex did originally (discover it). I tested it myself, and it is indeed correct. |
| 04-28-2006, 09:39 PM | #10 |
Thanks for your help. The first problem should now be solved, but the second one remains a mystery. |
| 04-28-2006, 09:47 PM | #11 |
For the second one, it appears you are trying to stop spells. There are no non-spell abilities with no target (that I can think of). You could try "A unit starts casting an ability" and do the pause/issue stop/unpause then. |
