a time problem
Author | Topic: a time problem |
---|---|
Apprentice
Member # 4268
|
written Saturday, December 11 2004 23:06
Profile
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
|
written Sunday, December 12 2004 00:29
Profile
Homepage
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 |
...b10010b...
Member # 869
|
written Sunday, December 12 2004 02:17
Profile
Homepage
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 |