• 🏆 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!

About timer

Status
Not open for further replies.
Level 12
Joined
May 21, 2009
Messages
994
Hello, i just learned vjass and then i was wroting a library which contains a timer.. and it works like call customtimerstart() but how do i in the library make a function that detects when the customtimer is over?? any help would be very appreciated

I also get this error: i use a local real time which is set to the customtimer's time which it will expire in and i get this error: Identifier Redeclared : "time"
 
Level 7
Joined
Jun 16, 2008
Messages
327
Hey there, Catch_ya
Glad to see people taking an interest in vJass. But, anyways, to the answers of your problems.

1) Hmmm, after opening up both my NewGen editor and Jasscraft and looking for that specific function (customtimerstart), I could not find it. It is possible you have a naming error. You might be looking for TimeStart, which is a non-BJ function which I'm sure will serve the same purpose you intend.
But coming to the problem you're looking at, to make a function that responds to a timer when it is finished, go to the parameters in the brackets.

JASS:
call TimerStart(timer, timeout, periodic, handlerFunc)

The parameter at the end is the one you're looking for; Handlerfunc. Basically, it is the name of the function you wish to execute once the timer is done. So, simply, put in the name of the function you want to trigger when the timer is completed.

- - - -

2) I think it's because you're declaring your local variable more than once. Check over any other locals or globals and make sure they don't have the name "time".
 
Level 12
Joined
May 21, 2009
Messages
994
Thanks mate! the customtimerstart is a custom timer library i work on myself but this really helped me because b4 i didnt understand what the handlerFunc meant +rep

anyway will the function be displayed when the timer is stopped or when the timer starts ??
 
Last edited:
Level 12
Joined
May 21, 2009
Messages
994
thanks ! this really helped me the timer thing im working on is a thing i call precisewait.. So when you do this you call in your trigger: call PreciseWait(REAL) it wouldnt be MUI but it isnt wrong like if you set it to 0.01 it doesnt wait 0.26 like "wait" does
 
Status
Not open for further replies.
Top