forums

TNT Basic Forums > Programming Q&A
Request
< Last Thread     Next Thread >
Author
Thread        Post A Reply

10-27-2005 13:19

Posted by:
LeviJ123

Location:
Right here silly...

Find more posts by LeviJ123

I have a simple request for you guys.

Make a little program that messes with the internal computer clock and makes it go around 3 seconds every 0.5 second.

Can't be that hard, right?

(btw I don't think I have introduced myself, My name is Levi and I'm not really new, I've been around since version 1.0, I'm just new to the forums ;o) )

10-27-2005 22:50

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

even though some of us might be able to do it, i really don,t think this can be done in TNT... TNT is a game-making tool and does not play with the system so you're probably not in the right palce for this. anyway why do you want to mess with the system clock anyway?

10-27-2005 23:02

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Hi Levi

It depends on what you are trying to do. If you want to mess with the system clock on your Mac then I'm afraid you're out of luck... TNT wont do it! If, however, you simply want to play with the timing in a TNT game then you've come to the right place. The call you need is 'timer' and it counts the number of 'ticks' since the TNT app started up. Normally 1,000 ticks is one second, but this is just a value, if you wanted 333 ticks to be one second then go for it! You just speed the clock up by three (ish).

I don't know (of the top of my head) if 'timer=0' would work, though I see no reason why it wouldn't. Either way, the code you need would look something like:

(before your main loop)
timer=0
OR
myTime=timer 'if timer=0 doesn't work...

(then in your loop)
if timer>333 'for example
seconds=seconds+1 'or whatever
endif

OR
if timer-myTime>300 'same as above
seconds=seconds+1
myTime=timer
endif


That's basically it. Dabbling with the toolbox stuff is beyond the scope of a games package such as TNT, so directly altering the clock just ain't happening.

Hope that helps (and I got the right idea about what you are trying to do). If not, give us a little more info on what you are trying to achieve and I'll see what I can come up with...

Danny (nods)

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.