HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Changing a hero's range using items, or enabling / disabling attack one and two

08-23-2004, 04:50 PM#1
Morre
Sorry if this is the wrong forum; I really don't need what technology would be easiest to use to achieve what I'm trying to do. I'm also sorry if this can be found anywhere else; I haven't found it, though.

Alright, this is what I want to do:
When a player either uses an item or a press key, the hero becomes ranged. When he presses that key again, he becomes a melee unit again. As a ranged unit, his damage would be lower, and his max/min dmg would probably be almost the same, while as a melee fighter, he could inflict varying amounts of damage.
For example, his damage as ranged unit could be 20, and 10-40 as a melee unit. My question is, how do I do this? I've tried to do it with triggers, items, abilities and so on. Haven't tried using JASS though; I really don't know how to write JASS scripts.

The obvious way would be to use orbs; the problem is, the orbs only enables an attack, it doesn't provide range. Now that would be fine if only it didn't activate attack 2 no matter which attack you activate, meaning the hero becomes ranged forever, even if you change item to another orb with "activated attack index: 1". Any ideas would be welcome; either a way to change range and preferrably also attack type, or a way to enable / disable attack one / two. It really doesn't matter if the solution is complex, but I think there's an easy way I have foreseen. Thanks in advance,

//Morre

EDIT: This can be done using upgrades that just change the range, if he has "missile" as his weapon type. I still want him to change weapon types as well, or otherwise it will look ugly and it will take time for him to hit his target, as opposed to when using "Normal" or "Instant".

EDIT 2: Can't un-upgrade. The approach I took in the last edit is not a good one.
08-24-2004, 07:56 PM#2
Morre
Alright, I've tried 254 different ways of doing this. None seems to fit.
If anyone would be so kind to move this to the JASS forum, I'd appreciate it, because I suspect JASS offers a good way to do this although I do not know the language. Any help would be greatly appreciated.
08-24-2004, 08:49 PM#3
exalted-one
Use units with the Locust ability, no collision, 100% transparency (Animation - Change Unit Vertex Coloring) with the desired ranged damage that follows the guy. Make the default guy the melee one (I'm assuming when he switches to ranged mode, you attach a bow model to his hand). When the unit is ordered to attack something, use triggers to order him to stop, face the target of the order, and play his attack animation (a melee guy doing a ranged attack would be a little odd, unless you're using throwing weapons, so maybe you would want to try something else). Order the invisible ranged unit to attack the target.

Hope that helps.
08-24-2004, 09:42 PM#4
-Ragnarok-
Quote:
Originally Posted by nathanmx
If I'm understanding you correctly, then this problem is a piece of cake. You can make a spell or item, and use Metamorphosis as the base. Set the unit before and after to have the same exact model (remember to remove the no longer needed "Required Animation Names" too). Then have the first unit have a melee attack and the second unit have a ranged attack, much like illidans metamorphosis ultimate.

-nathanmx


That may work... But why not just make a seperate Hero unit, and set it so if the unit uses an item it replaces the hero with the seperate hero that you made with the bow...
08-25-2004, 12:30 AM#5
th15
Alternatively, you can set up both attack 1 and attack 2 for the hero. Set his default enabled attack index to NONE.

Give him a orb ability that enables Attack 1. When you press the button to switch, remove that orb ability and give him another that enables attack 2.
08-25-2004, 09:02 AM#6
Morre
Quote:
Originally Posted by th15
Alternatively, you can set up both attack 1 and attack 2 for the hero. Set his default enabled attack index to NONE.

Give him a orb ability that enables Attack 1. When you press the button to switch, remove that orb ability and give him another that enables attack 2.

Tried that before I posted anything on the forums... gives him constant range, very weird. Seems do be a bug somewhere. I appreciate the help anyway.

EDIT: Oh, wait, I tried giving him orbs and letting them have the abilities, perhaps your idea works better. I'll try it, though disabling both attacks makes the player unable to see his damage and attack type :/


Quote:
Originally Posted by nathanmx
If I'm understanding you correctly, then this problem is a piece of cake. You can make a spell or item, and use Metamorphosis as the base. Set the unit before and after to have the same exact model (remember to remove the no longer needed "Required Animation Names" too). Then have the first unit have a melee attack and the second unit have a ranged attack, much like illidans metamorphosis ultimate.

-nathanmx

Well, I've tried that as well. The problem is that he has to be able to switch back, and metamorphosis is time-based with no order string to deactivate it. Thanks though.

Quote:
Originally Posted by exalted-one
Use units with the Locust ability, no collision, 100% transparency (Animation - Change Unit Vertex Coloring) with the desired ranged damage that follows the guy. Make the default guy the melee one (I'm assuming when he switches to ranged mode, you attach a bow model to his hand). When the unit is ordered to attack something, use triggers to order him to stop, face the target of the order, and play his attack animation (a melee guy doing a ranged attack would be a little odd, unless you're using throwing weapons, so maybe you would want to try something else). Order the invisible ranged unit to attack the target.

That's possible, but not the best solution since I use one hero for each player up to a maximum of ten. There was one last way that seems to work, but my friend who tried it tells me (although I find it hard to believe) that the unit has to drop the item (bow) in order to lose his ranged attack. I do think I have an idea, that can be done using a mixture of the ideas above... not sure though. I'll have to try that out after school or something.

Thanks everyone, further ideas appreciated.

EDIT: If anyone could help me find a way to disable one attack (and only the one specified), that'd be great. Guess you have to use JASS to do this, if it's possible at all.
08-25-2004, 09:13 AM#7
Pyrus
An alternative to metamorphus would be the Goblin Tinker's Robo Goblin ability. It has the turn-off feature.
08-25-2004, 09:17 AM#8
Morre
Quote:
Originally Posted by Pyrus
An alternative to metamorphus would be the Goblin Tinker's Robo Goblin ability. It has the turn-off feature.

Thanks, I'll try that too. My friend did some tests with the bear ability as well, not sure if that's a great idea.