• 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.

Anyway to tell between timers in same trigger?

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
like a trigger with these events
  • Events
    • Time - LastBuilding_Timer[1] expires
    • Time - LastBuilding_Timer[2] expires
    • Time - LastBuilding_Timer[3] expires
    • Time - LastBuilding_Timer[4] expires
    • Time - LastBuilding_Timer[5] expires
    • Time - LastBuilding_Timer[6] expires
is there a way to tell them apart and do a different action based on each timer or do i need to just put them in separate triggers..
 
There should be a function, (Last Expired Timer), or something similar (I assume). In JASS I know it is GetExpiredTimer().

You can just do an if/then/else and see if the LastBuilding_Timer[index] is Equal to the expired timer (do that for each index). You can also loop through them and get which index it is through this method, although that is only useful if you end up doing similar things and rely on the index for it.

What exactly do you plan on doing?
 
Level 13
Joined
Mar 24, 2010
Messages
950
well they all might be running at once at times so i cant use that or it will only get the last one that ran. I guess i could just put them all in different triggers, a bit more messy but no big deal.
 
well they all might be running at once at times so i cant use that or it will only get the last one that ran. I guess i could just put them all in different triggers, a bit more messy but no big deal.

If the contents of that trigger is instant, they should work fine even if all of those timers are running...

Last Expired Timer returns the last timer that expired (which in this case is the timer that triggered the event)
 
Status
Not open for further replies.
Top