| 01-25-2005, 06:31 PM | #1 |
Well there is a event (unit is attacked) but there is a way to figure (or a variable) which unit is attacked? Thanks |
| 01-25-2005, 06:36 PM | #2 |
well, if you are going to use that in a trigger, use Attacked Unit? and the Attacking Unit for the.... attacking unit.. =) |
| 01-25-2005, 06:38 PM | #3 | |
Quote:
^_^ There is a variable called attacking unit? |
| 01-25-2005, 06:41 PM | #4 |
no but you can set a variable (if you really need one) to the Attacked unit. Set TempUnit = (Attacked unit) please tell me/us some more about what you want it for, and i/we could help you out much better. |
| 01-25-2005, 06:48 PM | #5 | |
Quote:
^_^ i dont care about the attcked but about the attacking |
| 01-25-2005, 07:09 PM | #6 |
Event response - Attacking Unit Event response - Attacked Unit Did you even LOOK? |
| 01-25-2005, 07:34 PM | #7 | |
Quote:
Thanks Yeah i look but i didnt see :\ :\ But my editor is half english and half french it is kinda confusing.... By the way I have an other question but not exactly the same : ^_^ I make this trigger Event Unit is attaked Condition ..... Action a lot (ie take time) If the actions take 0.3 secondes And if a unit attak each 0.1 secondes, when does this trigger activate? each 0.3 or each 0.1 ??? |
| 01-25-2005, 07:42 PM | #8 |
Guest | I don't know what you mean do you mean for example if the (well i will use a knight) knight attacks (let's say a peon) a peon. so do you mean the defending unit (in my case a peon (the attacker)) or do you mean the attacking unit (the knight) because there is a way to select the knight just make a custom knight sepreate from the rest of the knights (if you use any) and then do a trigger (i am not sure the exact triggers because i do not have world edit infront of me at this point in time) the trigger should look like this Event- attacking unit = (custom knight) Condition- the defending unit = ([whatever unit you would want to attack]) Action- (what ever you want to have happen) |
| 01-25-2005, 07:53 PM | #9 | ||
Just to quote myself... Quote:
did you even read that? Quote:
a trigger fires every the event occures, in this case, every 0.1 seconds. |
| 01-25-2005, 08:09 PM | #10 |
Yeah i have read it but i wasn't sure it exists such a variable ^_^ (i didn't find it). So I asked if Attacking unit was a variable of the Editor. I first thought u want me to create a variable ... ( I would have noticed if this exists.... But in fact no... ) Yeah Yeah ok I'm o_O ![]() thanks for the answers |
| 01-25-2005, 09:17 PM | #11 |
Wait, I thought the Event - Unit is Attacked trigger fires only when the player clicks to attack the unit, not every time the attacking animation is played for the attacking unit and the attacked unit takes damage.. Edit: I was wrong, that is another event |
| 01-26-2005, 11:48 AM | #12 | |
Quote:
uh? well i dont understand.... Now my trigger works because it is fast but if there is lag or high speed units..... 3th question !!! with the trigger Event unit attacked Condition doesn't matter Action Set Variable=Event response_Attacking unit + a lot of actions (ie long ^^) THe trigger is fires everytimes a unit attack but what about my variable? My variable is changed each time??? Well my question is more exactly : Is my variable local or global? And How to fix that if it's global? |
| 01-28-2005, 08:45 AM | #13 |
hum.... no response ^^ does someone know how to declare a local variable instead of global? |
| 01-28-2005, 12:33 PM | #14 |
Your variable will be set to another one if the trigger fires again while the old instance of the trigger is still being processed. That will happen if you include a 'wait' action. Containing no 'wait' actions the trigger is supposed to end before a next one is processed. |
| 01-28-2005, 09:33 PM | #15 |
but, if you just use your actions and put the (Attacked Unit) or (Attacking Unit) instead of the var, it won't change. Unless you uses Casting Unit with and ability event. For example: Event - A Unit is Being Attacked conds: none Actions: -wait 2.00 seconds -kill (Attacked unit) this will work for all units but the one under isn't: Event - A unit begins casting an ability conds: none Actions: -wait 2.00 seconds -kill (Casting Unit) if another unit begins casting right after the first one, the second one will die instead of the first one... |
