Curious Artila Drakon Master Posted December 12, 2004 Share Posted December 12, 2004 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. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 12, 2004 Share Posted December 12, 2004 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. Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted December 12, 2004 Share Posted December 12, 2004 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. Link to comment Share on other sites More sharing options...
Recommended Posts