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

[Spell] Increasing and decreasing target unit's attack range

Status
Not open for further replies.
Level 3
Joined
Feb 19, 2016
Messages
32
Hey, I'm making a skill that allows a sniper to take long range attack that deals more damage after spending some time out of combat. The main problem is, that I don't really know how to reduce attack range after taking the shoot. Any ideas?
 
Level 12
Joined
Jan 2, 2016
Messages
973
You could make the sniper's range upgradeable, by some upgrade, and make that upgrade DECREASE its range. Just set the upgrade's level to 1 when you want to reduce the range, and to 0 when you want to insrease it.
Or you could make the upgrade GIVE range instead, and keep its level high when you need more range, and reduce the lvl when you need lower range.

You could give more levels to the upgrade if you want the sniper's range to have more than 2 values.
 
Level 3
Joined
Feb 19, 2016
Messages
32
Okay, so this is what I've tried.
Upgrades: They somehow can't be lowered. Can't make increasing, or decreasing range upgrade and then un-research it. Setting upgrade to lower level with triggers did nothing.
Aquisition range: I've looked for the way before I posted this, but I coulnd't find it. There was one thread when it was posted that the range is min(aquisition range,attack range). But setting range to 1050 and changing aquisition range with triggers also did nothing.
 
You could make the sniper's range upgradeable, by some upgrade, and make that upgrade DECREASE its range. Just set the upgrade's level to 1 when you want to reduce the range, and to 0 when you want to insrease it.
Or you could make the upgrade GIVE range instead, and keep its level high when you need more range, and reduce the lvl when you need lower range.

The issue with upgrades is that they can't be unresearched, so you can change attack ranges a fixed number of times.

@Saito: iirc you can't increase range through triggers, but try setting the unit's default object editor to that super long sniper range, and then reduce his acquisition range after his first shot. When he leaves combat, you can set his acquisition range back to the sniper value.

Orbs are also a potential solution since they can enable the unit's attack 2.
 
Level 3
Joined
Feb 19, 2016
Messages
32
So his base range is 1050 for now. His base aqusition range is 1050 aswell. When the game starts(0.00 game time trigger) his aquisition range is set to 550 and the timer starts. At 5, 10 and 15 seconds of timer he gains another level of 100% critical strike ability and aqusition range is set to 600, 850, 1050. When he attacks his aquisition range is set to 550 and the critical strike is removed.

And now, he attacks automaticly from aquisition range, but when I order him to smart enemy, he still attacks from range of 1050.

Also, how to make this with orb effects if it's possible?
 
Last edited:
Level 3
Joined
Feb 19, 2016
Messages
32
I think I've found a way to do it with saving original way the spell works.
So it goes like this:
- A channel based active spell(Without "visible" option is possible) with needed range.
- A trigger making the spell work(The damage calculating, animation of projectile and dealing the damage)
- A trigger making the spell activate when unit is ordered to "smart" enemy unit in range greater than 550.
I'm gonna try doing the skill like this for now tho.
 
Level 10
Joined
May 21, 2006
Messages
323
(Read this to the end!) You can make two Upgrades one which increase Range and one which decreases Range for example one which give +1200 range and one which gives -1200 range, now you give them like 1000 Levels each and every time the range should be increased you set the upgrade level +1 and each time you want to decrease it you set the other upgrade level +1 :D

This definately works in my newest project http://www.hiveworkshop.com/forums/map-development-202/teop-cenarius-return-276321/ you can see it somewhere in the clip I've linked.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
There are 3 (almost) proper ways to do it.

1, infinite* upgrades.
Create 2 upgrades, one to increase range, one to lower range.
Then you can upgrade them lineary to increase and decrease at will... with the limit of their levels.
So if you give both upgrades 100 levels, your hero can use this spell 100 times.

2, shifting unit type.
With reversed bear form transformation, you can instantly transform a unit with the least issues.
You create two unit types (in your case 4) and then switch between them.
The thread that explains instant shifting is named Hero Passive Transformation... but it ofcourse also works as active and on non-heroes... dunno who made that name.

3, code basic attacks.
This is the way that will require some serious shit to get it right, but it is rewarding in the end... to possibilities almost noone can get in WC3 modding.
The basic thing is simple, you design your own way to simulate basic attacks.

I recommend the second method.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
1, infinite* upgrades.
Create 2 upgrades, one to increase range, one to lower range.
Then you can upgrade them lineary to increase and decrease at will... with the limit of their levels.
So if you give both upgrades 100 levels, your hero can use this spell 100 times.
Has a large impact on loading time so is not really practical.

I recommend the second method.
That is the closest one can get to changing attack range dynamically. I still would recommend considering another ability or mechanic for the unit which is better supported by the game.
 
Level 10
Joined
May 21, 2006
Messages
323
Has a large impact on loading time so is not really practical.


That is the closest one can get to changing attack range dynamically. I still would recommend considering another ability or mechanic for the unit which is better supported by the game.

The Loading Time is hardly affected by that according to my experience. I have 8 upgrades with 1000 levels. The only thing one should think about is that player properties need an eternity to load when opening it in the editor one should always mind that.
 
Status
Not open for further replies.
Top