HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

attacking unit

01-25-2005, 06:31 PM#1
Tabris
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
oNdizZ
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
Tabris
Quote:
Originally Posted by oNdizZ
well, if you are going to use that in a trigger, use Attacked Unit?
and the Attacking Unit for the.... attacking unit.. =)

^_^ There is a variable called attacking unit?
01-25-2005, 06:41 PM#4
oNdizZ
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
Tabris
Quote:
Originally Posted by oNdizZ
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.

^_^ i dont care about the attcked but about the attacking
01-25-2005, 07:09 PM#6
Captain Griffen
Event response - Attacking Unit
Event response - Attacked Unit

Did you even LOOK?
01-25-2005, 07:34 PM#7
Tabris
Quote:
Originally Posted by Captain Griffen
Event response - Attacking Unit
Event response - Attacked Unit

Did you even LOOK?

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
oNdizZ
Just to quote myself...

Quote:
Originally Posted by oNdizZ
well, if you are going to use that in a trigger, use Attacked Unit?
and the Attacking Unit for the.... attacking unit.. =)


did you even read that?


Quote:
Originally Posted by Tabris
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 ???

a trigger fires every the event occures, in this case, every 0.1 seconds.
01-25-2005, 08:09 PM#10
Tabris
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
Sven8136
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
Tabris
Quote:
Originally Posted by Sven8136
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

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
Tabris
hum....
no response ^^
does someone know how to declare a local variable instead of global?
01-28-2005, 12:33 PM#14
D0nk1ckh0t
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
oNdizZ
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...