• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Attack Range Issue

Status
Not open for further replies.
Level 7
Joined
Sep 8, 2011
Messages
211
I've got a small issue. I know you can change the range of a units attack via the upgrade long rifles. But when I set the level of it via a trigger I noticed the trigger text said tech cannot be unlearned. I assume that means you cannot level it back down again.

This is an issues because I have 3 types of guns in my map and I want them to all have different ranges. I've tried setting the level of the long rifle upgrade when they switch weapons but it doesn't work, it just keeps the attack range at maximum.

I am curious to see if there is an answer to this or if I just have to go without it. Thanks for the help.
 
Level 9
Joined
Apr 23, 2011
Messages
527
if that ability is added to a unit, its unit type specified in the ability will change.
i.e

i add a chaos ability with the unit type footman to a rifleman. the rifleman will become a footman.

if you're adding it to a hero, then its stats will bug.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Create an ability based of Channel.
Make it have 300 levels.
Start level 1 with 100 range and each level increases it by 5.
Make cooldown 0.
Make it invisible. (Not visible in options.)

Make a trigger, when a unit is attacked, order the attacking unit to cast that ability.
Now you have an ability instead of a basic attack...
This means that you have to create the missiles yourself but for melee units this is all you have to do.
(Damage must be self calculated.)
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
Create an ability based of Channel.
Make it have 300 levels.
Start level 1 with 100 range and each level increases it by 5.
Make cooldown 0.
Make it invisible. (Not visible in options.)

Make a trigger, when a unit is attacked, order the attacking unit to cast that ability.
Now you have an ability instead of a basic attack...
This means that you have to create the missiles yourself but for melee units this is all you have to do.
(Damage must be self calculated.)

Be warned, however, that an ability with 300 levels will GREATLY increase loading time for your map
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
not necessarily
pink fields are

Now that you do not have to change the name of the spell, tooltip, options, etc, etc, etc, you will have very few pink fields
and I thought that with some tool, you could even do it better but that could just be a rumor...
And next to that.. who cares about loading time if you have configurable attack range between 100 and 1600?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Create an ability based of Channel.
Make it have 300 levels.
Start level 1 with 100 range and each level increases it by 5.
Make cooldown 0.
Make it invisible. (Not visible in options.)

Make a trigger, when a unit is attacked, order the attacking unit to cast that ability.
Now you have an ability instead of a basic attack...
This means that you have to create the missiles yourself but for melee units this is all you have to do.
(Damage must be self calculated.)

I wouldnt use that.

If your unit gets attacked by 2 units at the same time, he will keep swapping targets(imagine player tagging you with his units for instance)
 
Level 7
Joined
Sep 8, 2011
Messages
211
Wouldn't using barrage make the hero hit multiple targets though?

Edit: Apparently people are just changing that acquisition range on the unit and that effects the units attack range? I thought it would only effect the range at which it would find a target.
 
Level 12
Joined
Nov 3, 2013
Messages
989
besides for the attack range upgrade, units can't have higher attack range than their acquisition range. if that's what you mean
 
Level 12
Joined
Nov 3, 2013
Messages
989
Well I tested changing their acquisition range via triggers depending on the gun they are holding. It does nothing.

Although I've never used it before, or if it even works through triggers at all, I'm assuming you'd put the max range and then lower the acquisition range through triggers to lower the attack range. If it doesn't work then I've got no idea.

There's the option to have two attack range upgrades, one with a positive value and the other with a negative. But since you'd need a level for each change it's probably not that great of an idea...
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
You need different unit types for each gun. You need to use a morph ability to change between them. WC3 just does not support dynamic range modification sadly. This was fixed in SC2 with both upgrade removal support and range buff support.

Do not use Chaos to morph the unit type. It has a tendency to re-apply all attribute modifications done to the unit each time, even those from tomes and hero stats. This will just cause more problems than it solves and is not worth it.

Use some kind of other permanent morph. For example try crow form, bear form etc. You can temporarily give it to the unit via triggers and force it to morph. To hide the icon from the command card you can place it inside a disabled spell book. These morph abilities also change unit type and do not suffer from the problems Chaos does.

Do be aware that changing a hero into a non-hero or visa versa will usually result in a fatal error sooner or later. Also changing via a morph will remove all trigger added abilities not marked as "permanent" by the appropriate action/native.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Use some kind of other permanent morph. For example try crow form, bear form etc. You can temporarily give it to the unit via triggers and force it to morph. To hide the icon from the command card you can place it inside a disabled spell book. These morph abilities also change unit type and do not suffer from the problems Chaos does.

Use reversed morphing.

Create an ability based of Bear Form.
Place a dummy unit in Alternate Form.
Place a unit with a gun in Normal Form.
Create another ability and switch the units.
(Dummy is in Normal Form and unit with gun is in Alternate Form.)

When you want to transform a dummy to a unit with gun, you give him the ability where the Normal Form is the unit with the gun and remove that ability immediately.

When you want to transform from a unit with a gun to a unit with another gun, you have to transform to the dummy and then to the new unit.
Otherwise you would require millions of abilities.
 
Level 11
Joined
Jan 23, 2015
Messages
788
We need IceFrog for this :D
There's a few units in DotA that increase their range and even bouncing attack (do they trigger it with DDS?), maybe the best way to do this is to store all data for the hero in variables then replace it with the same unit but with increased range, after that you give it the same abilities, levels etc. But, I'm not sure for the ability cooldowns and experience.. :/
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
In an AoS map, you can easily replace all missiles with a missile system so you can actually triggre all effects. (bounces, piercing bolts, first enemy hit, etc.)
However... I am not quite sure what that has to do with the fact that you need something to increase/decrease attack range.

If you have one unit that needs a few different values, you could simply create different versions of them.
If you have lots of units that need a lot of different values, you should consider the ability solution that I showed. It does require much triggering and good data structure but it has quite some good possibilities.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Yea if the ability works like an upgrade it is fine to use upgrades themselves.

For example, Tristana from League of Legends increases attack range by level.
For her it is fine to use upgrades.

However, Kayle (who is melee by default) has an ability that will make her be ranged for 10 seconds.
In this case, upgrades are knows as the maximum number of times that you can use that ability.
And I am sure that you will not create 2 upgrades with both a million levels.
So for her, you could simply have an alternative form.

But if you have an ability that increases attack range by 5 for each 1% of missing health..... I dont even want to explain.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
But if you have an ability that increases attack range by 5 for each 1% of missing health..... I dont even want to explain.
You use SC2 where you can simply add a stacking buff behaviour.

WC3 range is not very dynamic, you should design around that rather than bashing your head against a cliff by making "increases attack range by 5 for each 1% of missing health". No one will notice the game mechanic restrictions if you design for what WC3 does best as opposed to what it cannot do (well at least).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You use SC2 where you can simply add a stacking buff behaviour.

But we arent discussing about SC2 are we?
I can point out a few other games which have this great potential... but we arent talking about those.

However... with the concept that I shared a while ago, it is practically possible to do it.
However, you are bound to custom attacks and people without much good coding experience will most probably fail using it.
You first have to create the visual effect that comes with normal attacks, then you have to create a sound, then you have to create the damage, you have to increase and decrease animation speed properly, you have to design the data structure of the attacks and most of all you have to put the ability on a dynamic cooldown based on Attack Speed.

But as you might realize, this breaks all possible limits...
Im sure that someone has a map where it is used... if not, then I am the first one.
 
Status
Not open for further replies.
Top