When Timer Expires

YoyoZ

New Member
Reaction score
3
Using the event, when timer expires with arrayz, therefore needing to use the condition, for timer [IntA] with time remaining = 0.00, if i had two timers running at the same speed caused me quite a bit of trouble. Everything happened twice.

Is there a way around this?

E.g.

Code:
User2 Sending
    Events
        Time - User2_Timers[1] expires
        Time - User2_Timers[2] expires
        Time - User2_Timers[3] expires
        Time - User2_Timers[4] expires
        Time - User2_Timers[5] expires
        Time - User2_Timers[6] expires
    Conditions
    Actions
        For each (Integer B) from 1 to 16, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Remaining time for User2_Timers[(Integer B)]) Equal to 0.00
                    Then - Actions
                        Unit - Create 1 UnitType[(Integer A)] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
                    Else - Actions
                        Do nothing
 

DrEvil

FCRI Associate!
Reaction score
111
Trigger:
  • User2 Sending
    • Events
      • Time - User2_Timers[1] expires
      • Time - User2_Timers[2] expires
      • Time - User2_Timers[3] expires
      • Time - User2_Timers[4] expires
      • Time - User2_Timers[5] expires
      • Time - User2_Timers[6] expires
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 16, do (Actions)
        • Loop - Actions
          • Custom Script : if udg_User2_Timers[bj_forLoopBIndex] == GetExpiredTimer() then
          • ---- This acts like that big if / then / else block ----
          • ---- Put your timer actions here ----
          • Custom Script : endif
          • ---- you won't see this in GUI ( what you use )


Thats all u can do I'm afraid :)
 

YoyoZ

New Member
Reaction score
3
Thx for the quick reply, i'll try it 2mrw. so when i do this, it will not do things twice?
 

DrEvil

FCRI Associate!
Reaction score
111
no , the Custom Script checks what timer expired ( which is not possible in GUI )
all you do is remove your if block ,
put in 2 custom scripts , put the scripts in them ,
and between them is what happens when its found the right timer

btw - why do you loop from 1 to 16 ? you only registered 1 - 6 ( typo ? ^_^ )
 

YoyoZ

New Member
Reaction score
3
1 problem, i'm actually using a 2-D array and therefore the timers actually = IntA*32+IntB, the first exmaple i gave you was just to make things more simple and as i don't know anything about JASS, what do i need to put instead of ForloopB?
 

DrEvil

FCRI Associate!
Reaction score
111
if udg_User2_Timers[(bj_forLoopAIndex*32)+bj_forLoopBIndex] == GetExpiredTimer() then

( LoopA * 32 ) + LoopB
What you wanted ?
 
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