• 🏆 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!

increasing and then decreasing a unit's attack range

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a "sniper" hill in my new hero arena version of Battle for Tatooine. I want any ranged hero that goes up on the hero to increase their attack range by about 500, and then it should reduce when they leave.

I plan on putting an invisible unit there with an aura, and then detect the aura to turn the range increase on or off.

The problem: I only know of 1 way to increase the attack range, by using an upgrade. I can easily turn that on, but the triggers don't allow me to remove that upgrade once it is granted.

Questions:

1. Is there any way to remove an upgrade once I've given it via triggers?
2. Is there any way to increase a unit's attack range other than upgrades?

The only thing I could think of was using the "orb" ability to unlock the player's second attack, and making the second attack the same as the first but with more range. I kind of doubt that would work though.

Anyone have ideas?
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
1. Is there any way to remove an upgrade once I've given it via triggers?
Same as you did with triggers, if you set the current upgrade to 3 then use set current upgrade to 2 or 1 to reduce uogrades.
2. Is there any way to increase a unit's attack range other than upgrades?
Items, give your hero an item that increase his attack range based on an upgrade ability.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Same as you did with triggers, if you set the current upgrade to 3 then use set current upgrade to 2 or 1 to reduce uogrades.

Items, give your hero an item that increase his attack range based on an upgrade ability.

I don't think you can lower the upgrade level. It goes up and stays up.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Really? Oh... I thought that setting to a high level means you can reduce that level O-o!?
So... I have another idea, you can change the ownership of that unit to a player who has less upgrade.

Ya I guess it is a bug from Blizzard. Changing players would cause weird problems with control and who is allied to who.

A more simple way to make it work (though with some limitations) is to just increase sight range. If the unit's default sight range is lower than their attack range, extra vision will let them attack farther. You can change vision range with triggers or an ability.

The problem would be that other units giving vision would also increase attack range.
 
Level 12
Joined
May 22, 2015
Messages
1,051
You cant lower the upgrade level that's why you need to make two upgrades, one with increase and one with decrease range.

This means it will only work once. The only way to make it work again is to increase the upgrade level, but then you are capped at some point (I think - pretty sure there is a limit to upgrade levels but not something I have tested) and you would need many, many levels to make it keep working.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
You cant lower the upgrade level that's why you need to make two upgrades, one with increase and one with decrease range.

That might work! You can give an upgrade that increase range by adding it to a unit then remove it and add a second upgrade that has low range.
But still, changing the player ownership works too, if they have the same proprieties. Except one of them has low upgrade than the other But you'll need to create a new upgrade range.
 
Level 10
Joined
May 21, 2006
Messages
323
That might work! You can give an upgrade that increase range by adding it to a unit then remove it and add a second upgrade that has low range.
But still, changing the player ownership works too, if they have the same proprieties. Except one of them has low upgrade than the other But you'll need to create a new upgrade range.

I always just give my hero two upgrades. One is decreasing range the other one is increasing range and then evertime the range changes I simply set the level of the upgrade for play +1. The Level of the upgrade is like 1000 then, but I think one can also make it 9999 without increasing the loading time.
 
Level 14
Joined
Aug 30, 2004
Messages
909
The units would require attack move.

You guys came up with some really interesting ideas; but I'm working on a tight map file size budget, and the range changes might happen a few hundred times in the game. I think I'll keep the upgrade idea and perhaps implement it at the end if I have room. I don't know if the number of upgrades would increase file size...I suspect not.

Thanks everyone,

Darwin
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Not so much, it is all data, when you have visuals (images/models/etc) or audio (sounds/music) then you spam filesize.

My method would not take more than 5 kb to install in your map and would allow really cool things, but I would have to find a way to get attack move working.
 
Level 20
Joined
Aug 29, 2012
Messages
826
You can play around with attack range and acquisition range.

Say your unit has a base range of 5000 in the editor, but a 2000 acquisition range, it will be able to attack up to a 2000 range. But here's the thing: you can use the action "Unit - Set acquisition range" to modify it dynamically via triggers as much as you want!

Two caveats: you won't be able to modify it beyond the unit editor value (e.g. 5000 in my example), and in the ingame UI, the base attack range will be displayed regardless of acquisition range (e.g. 5000, even though the actual range is 2000).

Hope this helps!
 
Last edited:
Level 10
Joined
May 21, 2006
Messages
323
You can play around with attack range and acquisition range.

Say your unit has a base range of 5000 in the editor, but a 2000 acquisition range, it will be able to attack up to a 2000 range. But here's the thing: you can use the action "Unit - Set acquisition range" to modify it dynamically via triggers as much as you want!

Two caveats: you won't be able to modify it beyond the unit editor value (e.g. 5000 in my example), and in the ingame UI, the base attack range will be displayed regardless of acquisition range (e.g. 5000, even though the actual range is 2000(.

Hope this helps!

I already tried that. It never worked for me. The only reliable way I know for sure and use myself is with upgrades.
 
Status
Not open for further replies.
Top