Game Development Community

Date/Time Functionality

by DMT · in Torque 3D Beginner · 08/11/2010 (7:43 pm) · 3 replies

Hey,

I was wondering how I can access time and date related functions from inside Torque Script. They must be there but I have no idea where to find them. Can some one enlighten me?

Thank you!

#1
08/11/2010 (9:29 pm)
Place on your map an "Time Of Day" object (Library->Level->Time of Day), and assign an Name. From your script call:

$your_variable = your_time_of_day_component_name.time;
#2
08/12/2010 (3:38 pm)
TimeOfDay.time doesn't return system date and time, which I believe is what's being asked for, it only returns current in-game time of the TimeOfDay object.

I thought I remembered there being a script function for system date and time, but after a quick glance through the scripting reference and the scripts I don't think there is. I may be thinking of the engine function for it I exposed to script on previous project.
#3
08/12/2010 (5:07 pm)
There is a resource that allows you to set up a game date/time calendar system which was all script based and ports fairly easily to Torque3D

There is another, more recent, resource that did something similar but for real calendar dates -- never tried this one though.