Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 11th Mar 2005 02:21
okay when u type in in db err somthin like
time=time-1
and time=100 u know it goes down quite quick and i was wondering how much time would u need to put down to make an accurate minute say time=1000 or somthing does anyone know

current projects = codename : tasgarad
despite what it sais to the left joined 5 december 03
GotStatic Studios
21
Years of Service
User Offline
Joined: 22nd May 2004
Location: UK-Cornwall
Posted: 11th Mar 2005 02:29
the onley accurate mesures of time in DBC to my knolege ale 'wait 1000' and sleep '1000' (the 1000 refering to millisecons, i'm presuming your trying to time without stoping the program, you could try running your times on the computor clock, may be around it. i thinks thats what your getting at, if not is you explained more i will be glad to help.
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 11th Mar 2005 02:36
yer i am trying to do time without stopping the game i would do it by the computer clock but i want the minutes to go quicker than real life and i dont know how lol but yea thats what i want to do

current projects = codename : tasgarad
despite what it sais to the left joined 5 december 03
GotStatic Studios
21
Years of Service
User Offline
Joined: 22nd May 2004
Location: UK-Cornwall
Posted: 11th Mar 2005 02:58
umm hard... the thing is the programs main loop dose not run at a fixed rate, it will run as fast as it can (unless you play with the sync rates or somthing) i think the onley you can do it is by using the computor clock as a base and then modifing it somehow but i cant help after that. mmm...
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 11th Mar 2005 03:30
yea but i have been thinkin i could just make the minutes go as fast as i want (as long as there not too fast) i dont want them to be exactly right so i think i will just put time as 100 or somthing thanks anyway

current projects = codename : tasgarad
despite what it sais to the left joined 5 december 03
GotStatic Studios
21
Years of Service
User Offline
Joined: 22nd May 2004
Location: UK-Cornwall
Posted: 11th Mar 2005 04:59
lol thats ok, n e time
dj chainz
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 11th Mar 2005 06:17
use the timer() function (with a bit of your own logic) YOU COMPLETE N00BS!!!!

try reading the manual/ help files b4 posting on forumz!

I am the lead programmer at red spark studios
http://www.brazilianhotties.tk
GotStatic Studios
21
Years of Service
User Offline
Joined: 22nd May 2004
Location: UK-Cornwall
Posted: 11th Mar 2005 06:52
yeah nice dude, real nice ....glad that were all showing support for noobs like us
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 11th Mar 2005 08:39 Edited at: 11th Mar 2005 08:42
dj chainz, you could have just said, "look into the timer() function" without the unnecessary comments. I often find there are very simple functions like that that I've overlooked even after programming for 13 years.

Anyway, what you want, SteveC is to use the timer() function. It returns the current system time in milliseconds. So you can set a variable to the current time, and then each loop check to see if the current system time minus the old time has gone above however long you want your timer to be. For 5 seconds, it would be 5000 milliseconds. Example:



NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Mar 2005 18:38
To all,

If you are using the SYNC and SYNC RATE commands, you can have complete control over the accuracy of counting up seconds. First, SYNC is what will refresh the screen, whensoever it is placed in your code. Second, SYNC RATE is the amount of times the screen will be refreshed per second.

So, using this information, you should now see a way to accurately count seconds. Try this
. When a SYNC RATE is set, your computer, to it's fullest ability, will refresh the screen that amount of times per second. For example, if SYNC RATE is set to 40, your computer will pass through your code 40 times a second. As in the code snippet above, I have created a variable(count), which is incremented by 1 each loop. Once it reaches 40, it increments the variable(seconds) by 1. If you run this code above, you will see that it will accurately print a countup of seconds onto the screen.

+NanoBrain+
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Mar 2005 20:13
Unfortunatly its not accurate because the frame rate can fluctuate, therefore speeding up/slowing down the counter.


"Lets migrate like bricks" - Me
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 12th Mar 2005 00:44 Edited at: 12th Mar 2005 00:48
Benjamin,

This is very true. Thank you for your input. I would then go with the method of using TIMER(), and then manipulating the return value.

+NanoBrain+
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 12th Mar 2005 05:43
okay thank u everyone exept the gay boy who calls himself dj chains i think callin himself that makes him think hes cool, but anyway i have took the liberty of copy pasting all this help into notepad so i can look over at it when not on the net thanks guys for all ur help

current projects = codename : tasgarad
despite what it sais to the left joined 5 december 03

Login to post a reply

Server time is: 2025-05-23 19:31:03
Your offset time is: 2025-05-23 19:31:03