HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit base for Crossbow Warrior model

03-21-2010, 08:29 PM#1
cohadar
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.
Attached Files
File type: w3xCrossbow Warrior.w3x (65.9 KB)
03-21-2010, 08:41 PM#2
Michael Peppers
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
cohadar
Quote:
Originally Posted by Michael Peppers
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.

I am not looking for a trigger solution.
Any other ideas?
03-21-2010, 11:19 PM#4
Michael Peppers
Quote:
Originally Posted by cohadar
I am not looking for a trigger solution.
Any other ideas?
The only way without triggers is setting the attacks in order that the unit will attack different targets with those. For example, the first one can target only land units and the second one only air units.

That's the only thing you can do without triggers.
03-22-2010, 12:19 AM#5
Ammorth
Quote:
Originally Posted by Michael Peppers
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.

If this is true, make the first attack melee and the second, ranged.
03-22-2010, 12:26 AM#6
Veev
"...even if the second one is ranged..."
03-22-2010, 04:15 AM#7
DioD
you cant, first attack only will be used if targets are same.
03-22-2010, 07:34 AM#8
cohadar
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
Gorman
Holy shit Cohadar, that works?

Genius.

Last time I did this was with overly complex unit swapping.
03-22-2010, 02:00 PM#10
DioD
proof plz, this shoud not work, cause attack range shared over all attacks.
03-22-2010, 02:37 PM#11
Panto
Quote:
Originally Posted by cohadar
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)
What autocast spell will you use?
03-22-2010, 03:21 PM#12
cohadar
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
Gorman
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
cohadar
Quote:
Originally Posted by Gorman
You just need to fix the AI so that it only casts when the unit is within 100 range!

And how do you do that?
03-25-2010, 01:56 PM#15
Kueken
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.