Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
How do i highlight an area?, like for example:
A player selects a unit then a circular area(of the unit's attack range) would be highlighted with a blue color or some other color. How do i do that? Thx in advance.
When selected the unit, you must know what is the unit range since you must deal with trigger. Below is an example trigger:
Example
Events
Player - Player 1 (Red) Selects a unit
Conditions
Actions
Set Loc1 = (Position of (Triggering unit))
Set Unit_Range = the unit range
-------- Determine the maximum loop amount --------
Set Loop_MaxInteger = 8
-------- Angle / Loop_MaxInteger must be equal to 360 (Complete circle) --------
Set Temp_Int = (360 / Loop_MaxInteger)
For each (Integer Loop_Integer) from 1 to Loop_Integer, do (Actions)
Loop - Actions
Set Angle = ((Real(Loop_Integer)) x Real(Temp_Int))
Set Loc2 = (Loc1 offset by Unit_Range towards Angle degrees)
-------- Special effect for displaying the maximum range of the unit. --------
-------- You may probably want the special effect get destroyed after deseleting the unit, --------
-------- so you may go self figure out how to do it. --------
Special Effect - Create a special effect at Loc2 using ANY MODEL YOU WANT
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Loc2)
Custom script: call RemoveLocation(udg_Loc1)
Basically this trigger just giving you a basic concept for how to displaying a unit's attack range. So if you got multiple units that want to display their attack range, you would need to change the trigger.
Since highlighting the whole area probably would be quite messy, so display the maximum range of the unit should be better/enough.
When selected the unit, you must know what is the unit range since you must deal with trigger. Below is an example trigger:
Example
Events
Player - Player 1 (Red) Selects a unit
Conditions
Actions
Set Loc1 = (Position of (Triggering unit))
Set Unit_Range = the unit range
-------- Determine the maximum loop amount --------
Set Loop_MaxInteger = 8
-------- Angle / Loop_MaxInteger must be equal to 360 (Complete circle) --------
Set Temp_Int = (360 / Loop_MaxInteger)
For each (Integer Loop_Integer) from 1 to Loop_Integer, do (Actions)
Loop - Actions
Set Angle = ((Real(Loop_Integer)) x Real(Temp_Int))
Set Loc2 = (Loc1 offset by Unit_Range towards Angle degrees)
-------- Special effect for displaying the maximum range of the unit. --------
-------- You may probably want the special effect get destroyed after deseleting the unit, --------
-------- so you may go self figure out how to do it. --------
Special Effect - Create a special effect at Loc2 using ANY MODEL YOU WANT
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_Loc2)
Custom script: call RemoveLocation(udg_Loc1)
Basically this trigger just giving you a basic concept for how to displaying a unit's attack range. So if you got multiple units that want to display their attack range, you would need to change the trigger.
Since highlighting the whole area probably would be quite messy, so display the maximum range of the unit should be better/enough.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.