• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Return timer array value

Status
Not open for further replies.
Level 10
Joined
Aug 25, 2004
Messages
473
Is it possible, somehow, to get the array value of the expired timer.
More detail:

--------------------------------------------------

there is 1 timer with 2 arrays:
Timer[1]
Timer[2]

Event

Timer[1] expires
Timer[2] expires

action

set TempInteger to The array value of the expired timer

-----------------------------------------------------

Is it possible?
 
This should work

(do a loop 1 to 2, for this example I'll say that the loop var is called 'i')
if (GetExpiredTimer() == Timer) then
<====>
endif

Just because there is no GUI timer comparison doesnt mean that you cant use it in a JASS if statement.
 
Taur, can i plz have more detail. I am not that good with jass, could you plz write everything. From "function XXX takes" ... to custom code in gui.

------------------
edited 20 min later
------------------

Ok, ive found my own, newbie solution, not proud of it, i dont like to work this way, but here it is

  • release
    • Events
      • Time - TimerPlayerJail[1] expires
      • Time - TimerPlayerJail[2] expires
      • Time - TimerPlayerJail[3] expires
      • Time - TimerPlayerJail[5] expires
      • Time - TimerPlayerJail[6] expires
      • Time - TimerPlayerJail[7] expires
      • Time - TimerPlayerJail[8] expires
      • Time - TimerPlayerJail[9] expires
      • Time - TimerPlayerJail[10] expires
    • Conditions
    • Actions
      • Countdown Timer - Start (Expiring timer) as a One-shot timer that will expire in 999.00 seconds
      • Countdown Timer - Pause (Last started timer)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for TimerPlayerJail[(Integer A)]) Equal to 999.00
            • Then - Actions
              • Set TempInteger = (Integer A)
            • Else - Actions
      • Countdown Timer - Destroy TWindowJail[TempInteger]
I still prefer to create a proper solution with jass, something like tauri said, but have no idear how
 
Last edited:
  • release
    • Events
      • Time - TimerPlayerJail[1] expires
      • Time - TimerPlayerJail[2] expires
      • Time - TimerPlayerJail[3] expires
      • Time - TimerPlayerJail[5] expires
      • Time - TimerPlayerJail[6] expires
      • Time - TimerPlayerJail[7] expires
      • Time - TimerPlayerJail[8] expires
      • Time - TimerPlayerJail[9] expires
      • Time - TimerPlayerJail[10] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetExpiredTimer() == TimerPlayerJail[GetForLoopIndexA()]) ) then
          • Set TempInteger = (Integer A)
          • Custom script: endif
That should do it.
 
Taur, learn jass properly before using it to help people. . .

  • release
    • Events
      • Time - TimerPlayerJail[1] expires
      • Time - TimerPlayerJail[2] expires
      • Time - TimerPlayerJail[3] expires
      • Time - TimerPlayerJail[5] expires
      • Time - TimerPlayerJail[6] expires
      • Time - TimerPlayerJail[7] expires
      • Time - TimerPlayerJail[8] expires
      • Time - TimerPlayerJail[9] expires
      • Time - TimerPlayerJail[10] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: if GetExpiredTimer() == udg_TimerPlayerJail[bj_forLoopAIndex]) then
          • Set TempInteger = (Integer A)
          • Custom script: endif
 
Status
Not open for further replies.
Back
Top