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

[General] How to attach a timer to a unit

Status
Not open for further replies.
Level 4
Joined
Jan 5, 2014
Messages
79
Hello,

I would like you to give me an example of a way how to attack a timer to a unit. But it should be MUI and more timers should be able to exist at once.

BTW: Is there any way how to promote my map? I mean, my map was moved to The Lab subforum, where there are from 3 to 20 viewers, which is low compared to the number of viewers in this subforum or Map Development.
 
Level 4
Joined
Jan 5, 2014
Messages
79
Thank you for help, I haven't time to study the profile options yet =)
 
Level 4
Joined
Jan 5, 2014
Messages
79
Well, the problem is, that when there are for example two units, I would need two timers. If I have 10 units, I need 10 timers I cant make a new variable for each unit. I thought the solution could be a timer variable with array, but there is the problem with events as there is no way to find out, which of all the timers has just expired. The only way could be to make an event for every possible number in array, but wouldn't cuase it lag with large number of events?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I had similar issue, but there is actually a way to find out which timer fired the trigger. Look in this thread: http://www.hiveworkshop.com/forums/world-editor-help-zone-98/finding-out-timer-fired-trigger-246239/

Anyway the problem there is imo that you can add an event, but you cannot remove one. So you can add an event "Timer Expires", but since you cannot remove it, you'll have to make a system which uses all the timers and if there's a need for additional timers, you add them. The thing is that it may be inefficient if there's way too many timers (something like with Unit - Takes damage event that becomes problematic if there's way too many units with this event for one trigger) and the only way to "remove" them is imo destroying and recreating the trigger.
 
Status
Not open for further replies.
Top