• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Is there a way?

Status
Not open for further replies.
Level 11
Joined
Jan 23, 2015
Messages
788
Is there a way to detect the index from an event like the following example:
  • Events
    • Time - CooldownTimer[1] expires
    • Time - CooldownTimer[2] expires
    • Time - CooldownTimer[3] expires
    • Time - CooldownTimer[4] expires
How can I know which of the timers above expired? Do I have to use a different trigger for each timer?
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
That way seems a bit long, here is a shortcut if a few custom script lines won't be a problem.


  • Events
    • Time - CooldownTimer[1] expires
    • Time - CooldownTimer[2] expires
    • Time - CooldownTimer[3] expires
    • Time - CooldownTimer[4] expires
  • Actions
    • Custom script: if GetExpiredTimer() == udg_CooldownTimer[1] then
      • ------your actions here------
    • Custom script: elseif GetExpiredTimer() == udg_CooldownTimer[2] then
      • ------acts------
    • Custom script: elseif GetExpiredTimer() == udg_CooldownTimer[3] then
      • ------acts------
    • Custom script: elseif GetExpiredTimer() == udg_CooldownTimer[4] then
      • ------acts------
    • Custom script: endif
 
Level 11
Joined
Jan 23, 2015
Messages
788
That way seems a bit long, here is a shortcut if a few custom script lines won't be a problem.


  • Events
    • Time - CooldownTimer[1] expires
    • Time - CooldownTimer[2] expires
    • Time - CooldownTimer[3] expires
    • Time - CooldownTimer[4] expires
  • Actions
    • Custom script: if GetExpiredTimer() == udg_CooldownTimer[1] then
      • ------your actions here------
    • Custom script: elseif GetExpiredTimer() == udg_CooldownTimer[2] then
      • ------acts------
    • Custom script: elseif GetExpiredTimer() == udg_CooldownTimer[3] then
      • ------acts------
    • Custom script: elseif GetExpiredTimer() == udg_CooldownTimer[4] then
      • ------acts------
    • Custom script: endif

But that will result in repeating the same actions every time, and I have a lot of actions..
Nichulus' solution seems great..

Thank you both!
 
Status
Not open for further replies.
Top