| 05-17-2008, 04:18 PM | #1 |
I know i can do the "unit-is attacked" thing but that triggers right as the unit is about to attack. I want it to trigger the moment the unit's weapon hits it's target. (example: archer shoots and arrow, trigger when arrow reaches target) Is there any way i can detect this or am i just going to have to deal? |
| 05-17-2008, 04:50 PM | #2 |
You could setup your own attack detect engine or just use one from the resources section. I suggest you to look at emjlr3's onAttack Template as it does exactly what you want. |
| 05-17-2008, 05:49 PM | #3 |
Event: Unit - Takes Damage Notice that it must be a specific unit who takes damage. Player owner or generic won't work. In order to check this for every unit, you usually start like this: Trigger: You will also want to register units who enter the playable map area. |
| 05-17-2008, 05:57 PM | #4 |
i already have it working just fine as detecting generic units but as i have said it triggers before the hit is done. The thing is your system wouldn't work with what i am doing b/c my trigger is the thing causing the damage the unit itself doesn't cause any damage ( attack type is set to a type that is prevented 100% to all). also all units will be added into the unit group and may cause leaks during large battles (that will happen in my game). so i thank you for the idea but it doesn't work for what i am doing |
| 05-17-2008, 06:26 PM | #5 | |
Quote:
|
| 05-17-2008, 07:15 PM | #6 |
Well, unless you want to script/trigger a missile engine for ranged attacks, there is no other way than to use Unit Takes Damage. Unit Takes Damage responds exactly when the unit is hit (which is what you wanted). I think you are using Unit Is Attacked. That is not the same thing. Takes Damage will trigger even if you have selected 100% resistance in gameplay constants. Check my trigger above for how to use it in the generic case, if you don't know. |
| 05-17-2008, 08:50 PM | #7 | |
Quote:
Addition: I have tweaked your method a little more and it works perfectly for what i was doing, thank you very ,uch. i didn't think it was going to work at first but it work :D +rep |
| 05-18-2008, 12:12 AM | #8 |
Yeah, the trigger wasn't a complete one, I just wanted to show you the idea of it. I'm delighted to see that you were able to figure out how to solve the damage recursion problems by yourself (since I obviously should have mentioned it). Don't forget the trigger which looks like this: Trigger: Well... glad I could help. ![]() |
| 05-18-2008, 01:35 AM | #9 |
Hey sorry about not being able to help lol, and nice job Themerion! |
| 05-18-2008, 10:42 AM | #10 |
first of all, the Takes Damage would work because even if you set damage to 0% in the editor it will still deal 1 damage. also if you want the trigger to deal additional damage, how would you do it? you perhaps would need a dummy unit that deals the damage, otherwise if you use Unit - Damage Target it will get picked up by the takes damage event again and so on and so on. So create a dummy unit and add a condition like Unit Type of (Damage Source) is not equal to Dummy Unit. |
| 05-19-2008, 06:18 PM | #11 | ||||
Quote:
Quote:
Quote:
2) the trigger is not ever dealing additional damage, the trigger has a set of calculations that calculates damage of attacks similar to the normal calculation done by blizzard but i wanted more then what blizzard offered. 3) the whole point of this thread was to get around the "Unit - Damage Target" event, you would know this if you read the beginning of the thread 4) also there is no use of a dummy unit to cause any damage... if you read.. Quote:
|
