ID:174906
Jul 8 2003, 7:58 am
|
|
how complicated would it be to make a clock in the stat panel that tells how long they have been in the game? can anyone enlighten me on how to do this?
|
In response to Super16
|
|
If you changed the ++s to --s could this work as a countdown?
Airjoe |
In response to Airjoe
|
|
probably but it would reset.
|
In response to Siefer
|
|
Reset? I just need a count-down timer, and I was about to post when I saw Super16's post.
|
In response to Airjoe
|
|
ok the clock code works right and everything but when i log back in with my character the clock is stopped.
|
In response to Siefer
|
|
i fixed it nm
|
In response to Super16
|
|
Super16 wrote:
mob/proc/Begin() There are a lot of problems with this approach, the first being that you've paid no attention to formatting. The output could look like 1:2:3:4, which isn't very clock-like. Also, it's better to simply use world.time and an offset instead of spawning a proc constantly; you'll just end up wasting a lot of time. (Plus there's a spawn() bug in BYOND that will screw up the timing of the clock anyway.) In Stat(), what you'd want to do is this: mob Lummox JR |
src.seconds = 0
src.Start()
mob/proc/Start()
src.seconds ++
src.Check()
mob/Stat()
statpanel("In Game time")
stat("[src.day]:[src.hour]:[src.minutes]:[src.seconds]")
mob/var{hour=1;minutes;=0;seconds=0;day=0}
mob/proc/Check()
if(src.seconds == 60)
src.minutes ++
src.seconds = 0
if(src.minutes == 60)
src.hour ++
src.minutes = 0
if(src.hour == 24)
src.day ++
src.hour = 1
spawn(10) Start()
mob/Login
Start()
..()