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

Creating Range Indicator

Status
Not open for further replies.
Level 5
Joined
Oct 12, 2004
Messages
109
Idk if anyone has played GEM TD but every tower that had an aura had a range indicator you could click and it would create a circle around that tower showing the aura range. Any1 have any ideas how to make this ability?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
I know a way to do it completely without model imports or dummy units.

Just give Bloodlust in a disabled spellbook to the specific unit. With the 'Scaling Factor' value of Bloodlust you can change the size of the selection circle.

downsides:
-for bigger sizes its a bit pixeled
-when the circle reaches over cliff edges it doesnt look too good.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Just HAVING the ability increases the selection circle. So putting it in a disabled spellbook is sufficient, as I said in first post..
 
Level 5
Joined
Oct 12, 2004
Messages
109
I did search and still cannot find anything about it.

Anyways I decided to do it using a simple trigger that creates a circle of indicators around the unit. If anyone is interested here it is:

  • Range Indicator
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Range Indicator
    • Actions
      • Set tmp_unit = (Casting unit)
      • Set tmp_real = (Current acquisition range of tmp_unit)
      • For each (Integer A) from 0 to 15, do (Actions)
        • Loop - Actions
          • Set tmp_point = ((Position of tmp_unit) offset by tmp_real towards ((Real((Integer A))) x 24.00) degrees)
          • Unit - Create 1 Range Indicator for (Owner of tmp_unit) at tmp_point facing (Position of tmp_unit)
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_tmp_point)
 
you might want to use Starts the effect of an ability... its better... position of tmp_unit leaks you know... and if its just a circle, why not just use a value there like 0.0... I mean at this line: Unit - Create 1 Range Indicator for (Owner of tmp_unit) at tmp_point facing (Position of tmp_unit)

actually, I think you mistyped? Coz facing takes real argument, not position...
 
Level 5
Joined
Oct 12, 2004
Messages
109
could I ask why starts the effect of an ability is better? Also yes I didn't see that leak thanks. Also, graphically it looks better if the indicators are facing the center unit. Just my opinion on the model I used and such.

Fixed:
  • Range Indicator
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Range Indicator
    • Actions
      • Set tmp_unit = (Casting unit)
      • Set tmp_real = (Current acquisition range of tmp_unit)
      • Set tmp_point2 = (Position of tmp_unit)
      • For each (Integer A) from 0 to 15, do (Actions)
        • Loop - Actions
          • Set tmp_point = (tmp_point2 offset by tmp_real towards ((Real((Integer A))) x 24.00) degrees)
          • Unit - Create 1 Range Indicator for (Owner of tmp_unit) at tmp_point facing tmp_point2
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_tmp_point)
      • Custom script: call RemoveLocation(udg_tmp_point2)
 
Because finishes activates only when the spell finished casting (depends on the unit's cast backswing and cast point I think), in which case if the unit is issued another order like stop or attack or whatever while it is still casting (even if the effect already took place), then spell won't be finished casting so the trigger won't fire... If you want to know how long a spell is cast, make your unit cast it and don't issue another order, take a look at the icon and you can know that its is finished when the greenish border around the icon is removed...

I just thought that it was a circle model... ^_^
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
If you do 15 x 24 you reach 360, which means you will create the first and the last indicator on the same spot. Do the loop untill 14 :).
 
Status
Not open for further replies.
Top