a time problem

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: a time problem
Member # 4268
Profile #0
I was just wondering if there is a call for a time limit
eg. Say, in the scenerio, some dude told you that you had to be back by a certain time. I was hoping there was a call to get the ticks from when you leave the place till you get back.

He strikes silently with large claws..........and webbed feet!
Posts: 24 | Registered: Thursday, April 15 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
In short, yes. The call tick_difference does this. There are some issues, however. For instance, when a saved game is reloaded in the outdoors, the variables get reset, so any normal practice of setting a variable to get_current_tick and testing tick_difference doesn't work. You could get around this using SDFs. The dehydration script I wrote (here) demonstrates how to use SDFs to keep track of time.

Basically, the idea is to use two SDFs as two digits in base-256. That is, the first one is set to 0 for all number 0-255. Then, for 256-511, the first one is 1, and the second one ranges over the same numbers. If you must, you can even use a third SDF if you expect the tick number to be obscenely high.

Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Member # 869
Profile Homepage #2
For an idea of what's meant by "obscenely high", using two SDFs allows 65536 ticks, which is just over 13 days. Using a third SDF would allow you over 3000 days, which is hopefully more than you'll ever need.

The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00