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

How to make a circle w/ triggers

Status
Not open for further replies.
Level 26
Joined
Dec 3, 2018
Messages
873
How Do I chance the coordonates in the image in order to create a circle around the unit?
 

Attachments

  • Region Circle.png
    Region Circle.png
    44.9 KB · Views: 18
Level 39
Joined
Feb 27, 2007
Messages
5,023
Do you want to find units in a circle? Affect some objects inside the circle? Just create a circle out of special effects? Static position or should it move with a target/unit? Generally you start with a for loop and "point with polar offset":
  • Set Center = (Position of (Triggering Unit))
  • Set R = 200.00
  • Set N = 15
  • Set Ang = (360.00/N)
  • Set Start = (Facing angle of (Triggering Unit))
  • For each (Integer A) from 1 to N do Actions
    • Loop - Actions
      • Set P = (Center offset by R towards Start degrees)
      • Set Start = (Start + Ang)
      • Special Effect - Create an effect at P using ...
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_P)
  • Custom script: call RemoveLocation(udg_Center)
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
There is the "units in range" function whose output you can assign to a unit group variable. This takes a point, radius, and conditional unit filter (to only get non-structure units, for example) and then gives you the group full of the units inside. Then you use the "unit group - pick" action and do things to all the units.

It doesn't fully take collision into account and only gets units whose center coordinates are within the circle (so a big unit just outside whose model overlaps the circle wouldn't be counterd). If you want to be 'better' but not 'accurate' you can add 'whatever approximately half of the average collision size of all units on your map is' to the search radius. Or use +32 as a best guess instead.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Rects can only be square in Warcraft III. Regions can only consist of cells.

What you probably want to do is enumerate units around the immolation caster and then filter if they are in area of effect range. This is done by enumerating the units in the area of effect range plus the maximum collision radius and then using the is unit in range function to filter if they are in the area of effect range. Enumerating units in range of a point only factors in origin position and not collision radius, as such is unit in range is required to accurately emulate area of effect damage. Other filters are required as well, such as to filter out the caster so they do not damage themself.
 
Status
Not open for further replies.
Top