Timer question
#1

Hi so I'm just a little confused about timers, I've seen a ton of topics suggesting certain methods and a lot of methods being called unnecessary or inefficient.

I'm currently using SetTimerEx in a tutorial system. There are four different stages to the tutorial and I want each stage to last a different amount of time. Once SetTimerEx finishes it calls the next stage and a different timer starts, and so on.

Is this a decent way to do this or is it considered outdated and inefficient or something? I'm not sure.

Also, in the future when I'm scripting constant background timers such as hourly paychecks or just keeping the world time/weather system in sync what is best to use then?
Reply
#2

I'd recommend using y_timers if you're worried. And having 4 seperate timers is really not nessacary you can just call the timer again with a second parameter indicating which stage of the tutorial to move onto.
Reply
#3

Timers can be avoided in certain cases; mainly the "can use feature x again after 30 seconds" kinds of things. In these cases the event is always triggered by the player by means of a command, keypress, checkpoint or whatever. So you can compare the current time with the time the feature was last executed and act accordingly.

In your particular case, however, the server decides when to advance, so you don't really have choice but to use timers.
Reply
#4

Alright thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)