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

Circle line of damage

Status
Not open for further replies.
Level 10
Joined
Dec 15, 2012
Messages
650
  • Pick
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- MaxDistance = 600, MinDistance = 400 --------
      • Set tempPoint = (Target point of ability being cast)
      • Set Group[1] = (Units within MinDistance of tempPoint)
      • -------- This pick the units those in between MaxDistance and MinDistance range --------
      • Set Group[2] = (Units within MaxDistance of tempPoint matching (((Picked unit) is in Group[1]) Equal to False))
      • Unit Group - Pick every unit in Group[2] and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Universal
      • Custom script: call DestroyGroup(udg_Group[1])
      • Custom script: call DestroyGroup(udg_Group[2])
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Custom script: set udg_tempPoint = null
I'm not sure about your "circle line", maybe this is what you want :]

EDIT : fixed
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
I think that's what he wants. But you don't really need two unit groups for that :)
(what people say is that creating unit group is a heavy process, so the less usage of "pick every unit"/"set group = ..." in trigger, the better)
Code:
Set loc = *whatever is supposed to be center of the circle*
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in max range of loc where (matching unit) is bla bla
    Loop
        Set u = picked unit
        Set loc2 = position of u
        If
            Math - Distance between loc and loc2 greater than or equal to "your desired min range"
        Then
            Unit is around circle line
        Else
            Unit is somewhere else
        Custom script: call RemoveLocation(udg_loc2)
Custom script: call RemoveLocation(udg_loc)

You cannot have "circle line" damage completely, because unit may stand like 3 pixels away from line, which in game would seem as he stands directly on the line, while in calculations he would not.
Because of that you need to have "max range" and "min range"... "max range" is the circle line, while "min range" is the maximum possible offset off "max range".
 
Level 10
Joined
Dec 15, 2012
Messages
650
I think that's what he wants. But you don't really need two unit groups for that :)
(what people say is that creating unit group is a heavy process, so the less usage of "pick every unit"/"set group = ..." in trigger, the better)
Code:
Set loc = *whatever is supposed to be center of the circle*
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in max range of loc where (matching unit) is bla bla
    Loop
        Set u = picked unit
        Set loc2 = position of u
        If
            Math - Distance between loc and loc2 greater than or equal to "your desired min range"
        Then
            Unit is around circle line
        Else
            Unit is somewhere else
        Custom script: call RemoveLocation(udg_loc2)
Custom script: call RemoveLocation(udg_loc)

You cannot have "circle line" damage completely, because unit may stand like 3 pixels away from line, which in game would seem as he stands directly on the line, while in calculations he would not.
Because of that you need to have "max range" and "min range"... "max range" is the circle line, while "min range" is the maximum possible offset off "max range".
Smarterrrrrrrrrrrrrr !
 
Status
Not open for further replies.
Top