| 05-23-2004, 12:13 AM | #1 |
I need help with this trigger. I am trying to make a trigger so that when the player presses the down arrow, the unit they control attacks wahtever is in front of it. But I only want him to attack when they press the down arrow, not automatically. HELP! I have got the down arrow and animation working, but I need a trigger that sees if there is a unit in front of my unit. How do I do this? |
| 05-23-2004, 01:07 PM | #2 |
Thats interesting, I answered the same type of question to linkmaster yesterday (and i STILL cant find my wc3 cd...). Anyway, what you want to do is make a rect centered on the unit. Then make it offset from the unit by the degrees the unit is facing (thats a real). Then when they press the down button, tell it to attack one of those units. I cant be more specific cause as i mentioned I lost my wc3 cd. |
| 05-23-2004, 01:54 PM | #3 |
Check to see if there are any units in point (X,Y) which is a point in front of the unit. |
| 05-24-2004, 03:06 PM | #4 |
I think this can be done by giving the unit a second attack that does nothing and create a custom ability based of an orb. Set the enabled attack index to 2. Then create a trigger that detects if the down key is pressed and then give it the orb ability and order it to attack a unit in front of him. This can be done by adding all units with a certain angle with the unit and within attack range of the unit to a group and then order the unit to attack a random unit from the group. Then you need another trigger that removes the orb ability after the unit attacked. |
