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

[Spell] Need help with constant double circular region checking

Status
Not open for further replies.
Level 8
Joined
Apr 8, 2009
Messages
499
Hey there hive,

I'm working on a spell for my map over here---
But i've been out of the Wc3 scene for like forever and i'm having trouble figuring out how to get it to do what I want.
I only use GUI.


The idea of the spell is to create 2 AoE circles/regions, A bigger one and a smaller one centered on the bigger one. These circles last for 5 seconds.

Any enemy unit inside of the bigger one (and thus smaller one) is silenced.
Any enemy unit inside of the smaller one takes damage over time (partially based on casters mana/INT).

If a unit walks out of the region they're instantly un-silenced, and if they walk in it's the other way around.


What would be the best GUI (and MUI) way to check on the regions and detect a unit leaving/entering?


Any help or link to a relevant thread with information would be greatly appreciated! :wink:
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Periodically enumerate all units in the big circle (from point and radius) and silence them. Any that are within X radius (small circle) of the centre you deal damage. Check the group from the previous results, if any are in there that are not in the new group then unsilence those units.

So basically 2 unit group loops. First for the fresh group to silence them and damage the small circle. Second loop is for the previous big circle to unsilenced the units that left the big circle.
 
Level 8
Joined
Apr 8, 2009
Messages
499
Periodically enumerate all units in the big circle (from point and radius) and silence them. Any that are within X radius (small circle) of the centre you deal damage. Check the group from the previous results, if any are in there that are not in the new group then unsilence those units.

So basically 2 unit group loops. First for the fresh group to silence them and damage the small circle. Second loop is for the previous big circle to unsilenced the units that left the big circle.


Hey Dr Super Good, thanks for the help! I think I managed to work the unit groups propperly thanks to your help. I have one last issue--- the part where I silence them....

I create a dummy for every unit in the circle group that does not already have the silenced buff.
The ability the dummy casts is based on drunken haze and prevents spell casts... But for some reason, the dummy never manages to cast it?


  • Mana Weaver Mana Chain Circle detection
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (UnitGroup_ManaChainDummies is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in UnitGroup_ManaChainDummies and do (Actions)
        • Loop - Actions
          • Set UnitGroup_ManaChain_InCircle[(Custom value of (Picked unit))] = (Units within 300.00 of (Position of (Picked unit)))
          • Set Integer_Temp = (Custom value of (Picked unit))
          • Unit Group - Pick every unit in UnitGroup_ManaChain_OutCircle[Integer_Temp] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in UnitGroup_ManaChain_InCircle[Integer_Temp]) Equal to False
                • Then - Actions
                  • Unit - Remove Mana Chain - Silence buff from (Picked unit)
                  • -------- Remove debuff --------
                  • Game - Display to (All players) the text: remove debuff
                • Else - Actions
          • Set UnitGroup_ManaChain_OutCircle[(Custom value of (Picked unit))] = UnitGroup_ManaChain_InCircle[(Custom value of (Picked unit))]
          • Unit Group - Pick every unit in UnitGroup_ManaChain_InCircle[Integer_Temp] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Mana Chain - Silence ) Equal to False
                  • (Unit-type of (Picked unit)) Not equal to Dummy [General all purpose dummy]
                  • (Unit-type of (Picked unit)) Not equal to Dummy_ManaChain [Mana Weaver]
                • Then - Actions
                  • Set Point_Temp = (Position of (Picked unit))
                  • Unit - Create 1 Dummy [General all purpose dummy] for (Owner of (Picked unit)) at Point_Temp facing Default building facing degrees
                  • Unit - Add Mana Chain - Silence to (Last created unit)
                  • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • -------- Add debuffs --------
                  • Game - Display to (All players) the text: add debuff
                • Else - Actions
 
Level 8
Joined
Apr 8, 2009
Messages
499
Probably object editor related. Make sure the dummy is an immobile ward with 0 cast backswing. Make sure the drunk haze has enough range, 0 cooldown and 0 mana cost.
Checked everything you mentioned, edited around a bit in the object editor--- but not untill I changed the expiration timer from 1s to 5s did it suddenly work... Weird though :p!
Anyhoo, I made it leakless and all, thanks a lot for your help Dr Super Good!
 
Status
Not open for further replies.
Top