• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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?
 
Level 11
Joined
Aug 15, 2004
Messages
710
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.
 
Level 10
Joined
Aug 25, 2004
Messages
473
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:
Level 11
Joined
Aug 15, 2004
Messages
710
  • 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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
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.
Top