| 03-21-2010, 08:29 PM | #1 |
http://www.hiveworkshop.com/forums/m...Dlist%26r%3D20 So I downloaded this crossbow warrior from hive and decided to give it a try but ran into a little problem. The model has both melee attack (axe) and ranged attack (crossbow) animations But I don't seem able to make it work properly in game. The point is for unit to have 2 attack types, and when in melee to use axe, and when attacking from range to use crossbow. I tried setting this attack types manually but unit always uses only primary attack. (no I did not forget to enable both) Is there any specific unit I should use as a base for this crossbow warrior to make it work properly? ======================================= EDIT: I made a demo map with best solution so far, you are welcome to improve upon it. |
| 03-21-2010, 08:41 PM | #2 |
It's not a unit problem, it's Wc's way of handling attacks. If the target can be attacked by both attacks, the first one will always be used even if the second one is ranged and the target is far away. I suggest a range-check, then enabling the melee attack if the enemy is in melee range by using an orb ability or something similar. |
| 03-21-2010, 11:15 PM | #3 | |
Quote:
I am not looking for a trigger solution. Any other ideas? |
| 03-21-2010, 11:19 PM | #4 | |
Quote:
That's the only thing you can do without triggers. |
| 03-22-2010, 12:19 AM | #5 | |
Quote:
If this is true, make the first attack melee and the second, ranged. |
| 03-22-2010, 12:26 AM | #6 |
"...even if the second one is ranged..." |
| 03-22-2010, 04:15 AM | #7 |
you cant, first attack only will be used if targets are same. |
| 03-22-2010, 07:34 AM | #8 |
I just can't believe that in all wc3 years none tried to make something like this... There is one trigger happy solution: Set Minimum Attack Range of first attack to 100 Than add autocast dmg spell with range 100 (that uses melee attack animation) (make sure it is a Skill and not an Ability so it can't be silenced) I still don't believe wc3 does not have natural support for this stuff. |
| 03-22-2010, 01:34 PM | #9 |
Holy shit Cohadar, that works? Genius. Last time I did this was with overly complex unit swapping. |
| 03-22-2010, 02:00 PM | #10 |
proof plz, this shoud not work, cause attack range shared over all attacks. |
| 03-22-2010, 02:37 PM | #11 | |
Quote:
|
| 03-22-2010, 03:21 PM | #12 |
I attached the demo map to the first post. This solution is pretty good but has some drawbacks. 1. people tend to get a bit aggressive when you give them an axe 2. skill based attacks ignore evasion = you cannot avoid the axe ![]() |
| 03-23-2010, 11:27 AM | #13 |
You just need to fix the AI so that it only casts when the unit is within 100 range! Is Warclub the only ability that works properly for attack index enabling/disabling? (I could only get orb of lightning to activate 2, never 1 :3) |
| 03-25-2010, 11:58 AM | #14 | |
Quote:
And how do you do that? |
| 03-25-2010, 01:56 PM | #15 |
Actually there was a solution using the sapper/suicidal unit classification. Usually you do not need this classification ingame, but you can add/remove it dynamically and use it for targeting purposes, like first attack attacks sapper, 2nd attack doesn't (or vice-versa, one of these works). Then you need a range check for each attack and add sapper to the target depending on range. For the animation you can set the unit animation on attack to the desired one and eventually queue a stand animation; usually looks fine that way. Note that this was originally intended to change the attack type of a unit, not sure if it works with range differences. |
