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

aoe "circle" effect spell

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2007
Messages
45
May anyone teach me how to do a spell where 1 object circles around a certain area (example: such as fire circling around the aoe) and the object can fire projectiles at enemies, but the caster cannot move/attack while casting this spell, so basically its like a channeling spell, and all units in the circle aoe can get out of it

Thank you
 
Level 3
Joined
Oct 23, 2007
Messages
36
First, make your dummy spell based off of channel, and make sure to set "disables other abilities" equal to true, and set "follow-through time" equal to the duration of the spell, and set the type of spell to "point target".

This will make the caster not able to move once the spell is cast.

For the actual "AoE" effect, I believe it would be easiest to summon a ward there, then use the "move unit instantly to point" to move the unit in a circle.

For circle movement, this requires a bit of math. If you are using GUI, I suggest you use polar coordinates to move the unit however many degrees per second you want. Since "Wait Game-time" is not accurate for time increments needed to make a smooth motion, you will need another trigger to make the unit move in a circular path.

At the end of your trigger that summons the ward, store the location of the circle center and the ward itself as a unit to global variables. Create another trigger that will be disabled at map initialization, that will use the event "periodic timer: 0.1 seconds". This periodic event will be turned on by the same trigger that summons the ward. The periodic event will use global variables to move the ward in a circular path. At the end of the spell, the periodic event trigger will have a condition causing it to disable itself.

If any of that doesn't make sense, or you need some code, please let me know.
 
Level 11
Joined
Feb 22, 2006
Messages
752
Timer of 0.1 seconds looks horrible. Try it and you'll see. Use 0.035 seconds for the best compromise between visuals and lag. If you're worried about causing lag, increase the expire time, but don't go much over 0.05 seconds or it'll start looking choppy. Expiration times below 0.02 are useless since I'm pretty sure they will be faster than wc3's frame rate.
 
Level 3
Joined
Oct 23, 2007
Messages
36
Sorry for getting back late, finals are a bitch.

Here the trigger on spell cast
  • Moving Ward Begin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • Set Center = (Target point of ability being cast)
      • Set Angle = 0.00
      • Unit - Create 1 Serpent Ward (Level 1) for (Owner of (Triggering unit)) at (Center offset by 256.00 towards 0.00 degrees) facing Default building facing (270.0) degrees
      • Set MovingWard = (Last created unit)
      • Trigger - Turn on Moving Ward Periodic <gen>
Here's the one that is disabled at start

  • Moving Ward Periodic
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • -------- Altering the amount Angle changes will change the angular speed of the ward --------
      • Set Angle = (Angle + 1.00)
      • Set TempPoint = (Center offset by 256.00 towards Angle degrees)
      • Unit - Move MovingWard instantly to TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set TempCount = (TempCount + 1)
      • -------- The condition for TempCount will tell you how long you want the effect to last --------
      • -------- in this case, stopping after a tempcount of 250 has a duration of 5 seconds --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempCount Equal to 250
        • Then - Actions
          • Unit - Kill MovingWard
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Status
Not open for further replies.
Top