I wrote a small library for handling date and time values.
// Name : Date and time functions
// Author : Ingmar Stieger / Papillon
// Modified : August 04, 2002
// Version : 0.1
// Implemented datatype
// * DateTime
// Implemented functions
// * addDateTime() : Add two DateTimes
// * subDateTime() : Substract two DateTimes
// * compareDateTime() : Compare two DateTimes
// * getCurrentDateTime() : Return current DateTime
// * newDateTime() : Create new DateTime with given values
// * SetLocalDateTime() : Set oObject's local DateTime variable to date
// * GetLocalDateTime() : Get oObject's local DateTime variable
// * debugPrintDateTime() : Print DateTime for debugging purposes
// See function headers for details
//
// Example:
/* object oPC = GetPCSpeaker();
struct DateTime date1 = getCurrentDateTime();
struct DateTime date2 = newDateTime(0,0,0,8); // 8 hours later
struct DateTime finished = addDateTime(date1, date2);
SetLocalDateTime(oPC, "forge_shortsword_blade_finished", finished);
*/
--- cut
The source is too long to post here, but I've attached it as a .erf file.
Date and time functions
Moderator: Event DM
You need to edit this a bit.
We don't want to store each variable seperately as a Persistant Variable.
Encode all the date/time variables into one deliminated string (don't use | pipes as a deliminator).
Then Make that set that string as persitant.
When your get the persistant string, simply decode the string into it's seperate date/time components.
The Persistant Date script get's too large too fast if you save 7+ variables every time for this functionality.
Otherwise, this code is very cool. I'll be using it for my tracking scripts.
We don't want to store each variable seperately as a Persistant Variable.
Encode all the date/time variables into one deliminated string (don't use | pipes as a deliminator).
Then Make that set that string as persitant.
When your get the persistant string, simply decode the string into it's seperate date/time components.
The Persistant Date script get's too large too fast if you save 7+ variables every time for this functionality.
Otherwise, this code is very cool. I'll be using it for my tracking scripts.