array of timers in event

blastintime

Member
Reaction score
10
I have another question,

I have an array of timers from 1-999, and I want to make a trigger with an event that checks if any of the timers in the array have expired

How to do that ? :confused:

I also want it to remember which place the timer had in the array so that I can use that number later.
 

X-maul

AKA: Demtrod
Reaction score
201
hmmm - well I dont know how to do this, but why do you need a timer with an array of 999?
There might be another method :)
 

Phubar

Ultra Cool Member
Reaction score
30
Try to explain what you have to do in your map, maybe there is another solution.
 

blastintime

Member
Reaction score
10
Alright I try explain
I have timers for certain units on the map, and when one of the timers run out, I want stuff to happen to that unit. An example is that there is a location, and when units pass thru it, they get a timer on them, and when the timer expires they die. (sometimes lots of units get affected, thats why I have the big array)
 

X-maul

AKA: Demtrod
Reaction score
201
Instead of doing it with timers you can have a trigger which uses a local unit variable that will store the unit entering the region within it. Having the varible being local means that it wont be accesable outside the current trigger, and it can be run several times at once. Knowing this, you can setup a trigger like this:
Code:
YourTrigger
    Events
        Unit - Any Unit Enters (Entire map)
    Local Variables
        UnitVariable = No Unit <Unit>
    Conditions
        (Owner of (Triggering unit)) == 1
    Actions
        Variable - Set UnitVariable = (Triggering unit)
        General - Wait 10.0 Game Time seconds
        Unit - Kill UnitVariable
(Ofcourse you should add the Conditions so it suits your needs, but using this method you should be able to solve your problem without using a timer varible with 999 arrays ;))
 

Dave312

Censored for your safe viewing
Reaction score
269
X-Maul's solution will work, but I would look at using behaviours. You can have a trigger that gives the unit a Timed Life behaviour when they enter the region.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top