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

[Trigger] Tower Range Ability

Status
Not open for further replies.
Level 4
Joined
Jun 11, 2009
Messages
23
Im making a tower defense map.. But i need an ability, so when you click the tower, there will be a round circle that represent the range of the selected tower.

Anyone, help?
- Or any Jass ? Just need some help :)
- A Visual Range, if you can say that..
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
You need to create a dummy unit that will represent the "Range Effect".
Give that unit the locust ability, make it invulnerable and make it unable to attack.
Another important thing is to remove the shadow, which some people forget.

Create an ability based off Wind Walk, or any other instant spell, make sure it doesn't have any effects anymore (and no sounds), give it the name/description you want.
That's obviously the range-check-ability.

Now you have a few options, since I've never seen a "range" integer in the trigger editor:
- You can set the point value of the units to their range
- You can set the custom value of the units to their range
- You can do something like HP = Range*1000 (since it becomes black after about 10k anyway).

When the ability is activated, do something like this:
  • Actions
    • Set Loc[1] = (Position of (Triggering unit))
    • For each (Integer B) from 1 to 20, do (Actions)
      • Loop - Actions
        • Set Loc[2] = (Loc[1] offset by (Real((Point-value of (Triggering unit)))) towards ((Real((Integer B))) x 18.00) degrees)
        • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Loc[2] facing Default building facing (270.0) degrees
        • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(udg_Loc[1])
    • Custom script: call RemoveLocation(udg_Loc[2])
In this example I have used the Point value, which is the easiest, but it could be possible that you've already assigned it (I have assigned it for the sell-value in my TD).

If you have no other option whatsoever, you can create an if/then/else-function for each tower... but I wouldn't recommend that, as it takes a lot of work.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Lol...

just use a special effect .... create like 36 to create a nice circle..

You can see that in "EotA". (check map section)

I don't like it with special effects, since it's harder to set the time the special effects will last.
And by the way: my way looks exactly the same as with special effects, the advantages are that you do not use any waits (so it is fully MUI) and that you can change the time the special effects last with exact precision.
 
Status
Not open for further replies.
Top