| 02-21-2008, 05:56 PM | #2 |
First, use trigger tags next time and it will be easier to read ^^. Next, there's a much better way to do this, but here's how to fix your current problem: You need to also allow for "smart" orders on enemies (right clicking) in the first trigger. It's probably not firing, so not setting the Dmg_physical variable, so the other trigger doesn't work properly. The next time, if you use right-click again, it still won't work right, but it will at least display something reasonable because you set the Dmg_physical variable at the end of the 2nd trigger. Now...unfortunately "a unit is attacked" will fire before the unit actually takes damage. You instead need to use the Specific Unit Event "Unit Takes Damage". You'll need to create a trigger with your actions but no events, and then add a "Unit Takes Damage" event to it for each hero on the map at startup, and also for each hero that enters the map (with another trigger). You'll also then be able to use the real Damage Taken so you won't have to do any messing around. |
| 02-21-2008, 06:49 PM | #3 |
TaintedReality is correct, you have two problems: - The first trigger won't fire when the hero is order by right-clicking (as opposed to specifically using attack) or when the hero acquires a new target by itself. - The second trigger will fire as a unit is hit, but before the damage is deducted from its life. You will want to look for damage detection systems, which will give you easy access to the kind of information you want. Most of them are written in JASS, but don't let that scare you off, since using them is usually not very hard and can be done mostly in GUI. (and yes, I know it's ridiculous blizzard didn't allow "unit takes damage" as an every-unit type event, but you have to work with what you get) |
| 02-22-2008, 10:12 PM | #4 |
thnx both of you guys you helped me a lot still haven't fixed it totaly but i'm working on it with a diferent base now and having more progress which is much more inspiring than the situation before. :D As for the damage taken real var (which allready exist by blizzard) the problem is that i don't know from the begining of the game which are going to be the 8 heros players will be controling they buy them from some taverns and i have a trigger that actually sets in a var the units that are sold form these taverns but still it doesn't accept a unit variable in a specific unit event :(... But anyway i got help from some other friends and from you and i have some progress THNX A LOT!!!!!! |
