• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] (Slowly) Expanding Circles

Status
Not open for further replies.
Level 5
Joined
Feb 8, 2015
Messages
93
I've made a trigger that, when a unit instant cast ability, will spawn wave after wave of outwards expanding circles from the point, much like rings formed after dropping something in water... Except with cool fiery explosions.

The trigger works without a fault, but to give it the slow, outwards ripple effect I use Waits in the looping. Now even if it's Wait Game-Time seconds, I've heard that the Wait action is best avoided altogether.

So my question is; is there a neat way to make this effect, but without waits?

  • DBHero APOCALYPSE
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dragonblood: APOCALYPSE! (RedDraconR - Channel)
    • Actions
      • Set Apoca_cast = (Triggering unit)
      • Set Apoca_centerLoc = (Position of Apoca_cast)
      • Set Apoca_dmg = ((25.00 + ((Real((Level of (Ability being cast) for Apoca_cast))) x 25.00)) + 0.00)
      • Set Apoca_ang = 0.00
      • Set Apoca_wavei = 8
      • Set Apoca_dist = (1000.00 / (Real(Apoca_wavei)))
      • -------- Wave Loop --------
      • For each (Integer A) from 1 to Apoca_wavei, do (Actions)
        • Loop - Actions
          • Wait 0.35 game-time seconds
          • Set Apoca_HitsPerWave = ((Integer A) x 5)
          • For each (Integer B) from 1 to Apoca_HitsPerWave, do (Actions)
            • Loop - Actions
              • Set Apoca_ang = (Apoca_ang + (360.00 / (Real(Apoca_HitsPerWave))))
              • Set Apoca_Tempp1 = (Apoca_centerLoc offset by (Apoca_dist x (Real((Integer A)))) towards Apoca_ang degrees)
              • Special Effect - Create a special effect at Apoca_Tempp1 using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set Apoca_Tempug = (Units within 150.00 of Apoca_Tempp1 matching ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) is An Ancient) Equal to False) and ((((Matching unit) is being transported) Equal to False
              • Unit Group - Pick every unit in Apoca_Tempug and do (Actions)
                • Loop - Actions
                  • Set Apoca_picked = (Picked unit)
                  • Unit - Cause Apoca_cast to damage Apoca_picked, dealing Apoca_dmg damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_Apoca_Tempug)
      • -------- Cleaning --------
      • Custom script: call RemoveLocation(udg_Apoca_Tempp1)
      • Custom script: call RemoveLocation(udg_Apoca_centerLoc)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
So my question is; is there a neat way to make this effect, but without waits?
MUI instance based system with a periodic timer trigger.

On cast create instance and turn periodic trigger on. Periodic trigger deal with creating the effect and destroying instance at end. If all instances are destroyed turn periodic trigger off.
 
Level 5
Joined
Feb 8, 2015
Messages
93
MUI instance based system with a periodic timer trigger.

On cast create instance and turn periodic trigger on. Periodic trigger deal with creating the effect and destroying instance at end. If all instances are destroyed turn periodic trigger off.

Right, good idea.

To be exact; what are the downsides of simply using "Wait".

(I know Wait Real-Time seconds is problematic, as it runs even when the game is paused, etc. I mean "Wait Game-Time Seconds")
 
Level 12
Joined
Jun 15, 2016
Messages
472
The waits themselves won't cause any problem, but if you want more then one unit to cast this ability at the same time this will not do. This tutorial about Visualize: Dynamic Indexing explains why it won't work and gives the solution.

P.S. You're leaking point Apoca_Tempp1 - setting a new point every time the seconds loop runs, but removing only the last point you save.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
To be exact; what are the downsides of simply using "Wait".

(I know Wait Real-Time seconds is problematic, as it runs even when the game is paused, etc. I mean "Wait Game-Time Seconds")
Wait Game-Time seconds leaks a handle index due to "local declared local handle variable reference counter leak on return bug". It also uses TriggerSleepAction internally which is the normal Wait.

Not only does the wait have a minimum accuracy of 0.1 real life seconds, but I believe it requires net synchronization so is slower in multiplayer.
 
Status
Not open for further replies.
Top