| 02-20-2005, 02:54 PM | #1 |
Is it possible to store into a variable, a given unit's current Target? I know about the Specific Unit event - a unit aquires a target, which could be used to do this, but I don't want to use the Specific unit event because it doesn't allow variables to be used. Note: i'm referring to an "attack" target, not spell or anything of that sort. |
| 02-20-2005, 03:24 PM | #2 |
use the event "Unit is attacked" and then just use "Attacking unit" to refer to it |
| 02-20-2005, 04:05 PM | #3 |
Guest | I think he means targeted, not attacked. I don't know the answer to this (I'd use attack & is attacked too) so if anyone knows the answer it may interest me too. |
| 02-20-2005, 04:12 PM | #4 |
The unit wont nessisarily be attacking anything. Basically i am trying to query if a unit has a target or not. |
| 02-20-2005, 04:12 PM | #5 |
Melee Initialization Events Map initialization Unit - A unit owned by Player 1 (Red) Is issued an order targeting an object Conditions (Issued order) Equal to (Order(attack)) Actions Set unit = (Target unit of issued order) maby something like this will do the job |
| 02-20-2005, 04:31 PM | #6 |
Kamux: nope, didn't work. Thanks though. E: A unit owned by player 12 is issued an order targeting an object C: issued order = attack A: display "Attacking" to all players nothing happens, so i'm going to assume that issued orders only trigger when a player does them or they are done via a trigger. |
| 02-20-2005, 04:38 PM | #7 |
use "smart" instead of "attack" and make sure that the target of issued order is an enemy of owner of ordered unit else it will also execute when you order it to follow |
| 02-20-2005, 04:50 PM | #8 |
That didn't work either. I used Issued order = Order("smart") and no go. Really I think the issued order condition will only work on player or trigger ordered conditions. |
| 02-20-2005, 06:50 PM | #9 |
I hope this map is what you'r looking for...i've found a way to detect the targets via the specific unit event. |
| 02-20-2005, 09:19 PM | #10 |
Very clever, I didn't think about adding events to an existing trigger. I'll use this since I can add the events anytime i want. Thanks! |
| 02-21-2005, 06:13 PM | #11 |
np...and thanks for the rep ![]() |
