• 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] Periodic time

Status
Not open for further replies.
Level 16
Joined
Mar 26, 2004
Messages
569
Hi, i'm doing a trigger that turns on when a unit starts channeling an ability. It lasts for 7 seconds and under those seconds i want it to do 7 actions.

  • Spellcast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • Ability being cast = x ability
    • Actions
      • Trigger - Turn On Periodic
  • Periodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Do Actions
  • Stops Channeling
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • Ability being cast = x ability
    • Actions
      • Trigger - Turn Off Periodic
Sometimes it seems that the periodic event runs 8 times depending on timing along with the game time. Is it possible that it might be the case?

EDIT: I guess adding a integer condition could manage it, but my question remains.
 
Level 4
Joined
Sep 9, 2004
Messages
112
just add this to the first trigger IMO..
  • Wait 7.00 seconds
  • Trigger - Turn off (Periodic)
That will stop it after 7 seconds thus the normal ending of the spell.. I would keep ur other turn off as well though as it will stop the effect if the player moves the unit or cancels the channel spell.
 
Level 6
Joined
Nov 28, 2007
Messages
203
Sometimes it seems that the periodic event runs 8 times depending on timing along with the game time. Is it possible that it might be the case?
Sadly the 'Time - Every x.xx seconds of game time' event isn't always precise. Sometimes it does it around 0.01 more or less seconds.

So the event in your second trigger can sometimes become 'Time - Every 0.99 seconds of game time' which will result 8 runs :wink:

You can do it like this to make it work. And only use one trigger:
  • Spellcast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • Ability being cast = x ability
    • Actions
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • (Actions here)
          • Wait 1.00 seconds
 
Status
Not open for further replies.
Top