Expiration Timer Manipulation

Not open for further replies.
Level 8
Jan 8, 2010
i don't think the unit's expiration timer (i'm referring to the blue-shaded area thing) can be changed after it has been set to the unit. i don't know if there's a JASS function to it, too, but anyway, you can use a timer (or an indexing system) to act like the unit's expiration timer. when it kills a unit add more time to the timer (or add more index value to the unit's index which decreases per second) :O


Code Reviewer
Level 26
Mar 19, 2008
You'll need Unit Indexer for that.

The idea is about setting real array variable to your desired 'expiration value' and use loop to make it act as real timer.
So lets say you have set real vairalbe Expiration[(Custom value of <unit>)] = 30.00. Additionaly, add those units to specific group, let's say: ExpirationGroup.

Now, to increase it:
  • init
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Expiration[(Custom value of (Killing unit))] = Expiration[(Custom value of (killing unit))] + 5.00
^My trigger increases the delay by 5.00 secons.

  • loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit group - Pick every unit in ExpirationGroup and do Actions
        • Loop - Actions
          • Set key = (Custom value of (Picked unit))
          • Set Expiration[key] = Expiration[key] - 0.03
          • If (All conditions are true) then do (Then - Actions) else do (Else - Actions)
            • If - Conidtions
              • Expiration[key] Less or equal to 0.00
            • Then - Actions
              • // whateveryou want
              • UnitGroup - Remove (Picked unit) from ExpirationGroup
            • Else - Actions
Why '(Custom value of <unit>)' everywhere? Because thats what UnitIndexer is here for ;)
Not open for further replies.