Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Running the server
➜ Months
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Mon 08 Nov 2004 08:02 PM (UTC) Amended on Mon 08 Nov 2004 08:07 PM (UTC) by Zeno
|
Message
| I am thinking about removing some months in the game, but I'm not sure if it will screw up, or un-balance time or dates. Does anyone know?
char * const month_name [] =
{
"January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December", "(remove)", "(remove)",
"(remove)", "(remove)", "(remove)"
};
|
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Reply #1 on Tue 09 Nov 2004 09:07 AM (UTC) |
Message
| I did this eome time ago, if i remember right there is something in mud.h or in sysdata.dat that you have to chane from the default 17 back to 12 months and how many hors per day etc. I had no trouble making the times and dates simular to 12-7-24 time format. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #2 on Wed 10 Nov 2004 04:10 AM (UTC) Amended on Wed 10 Nov 2004 04:11 AM (UTC) by Zeno
|
Message
| Looked through mud.h and sysdata.dat for "17", found nothing relating to dates/time. Can anyone else remember where this is?
[EDIT]
This is in db.c:
lhour = (current_time - 650336715)
/ (PULSE_TICK / PULSE_PER_SECOND);
time_info.hour = lhour % 24;
lday = lhour / 24;
time_info.day = lday % 35;
lmonth = lday / 35;
time_info.month = lmonth % 17;
time_info.year = lmonth / 17;
if ( time_info.hour < 5 ) time_info.sunlight = SUN_DARK;
else if ( time_info.hour < 6 ) time_info.sunlight = SUN_RISE;
else if ( time_info.hour < 19 ) time_info.sunlight = SUN_LIGHT;
else if ( time_info.hour < 20 ) time_info.sunlight = SUN_SET;
else time_info.sunlight = SUN_DARK;
That may be it. Would I just change both 17 to 12? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Reply #3 on Thu 11 Nov 2004 05:43 AM (UTC) Amended on Thu 11 Nov 2004 05:46 AM (UTC) by Robert Powell
|
Message
| yes, thats the stuff, i just changed those and all was well from what i can recall.
{
long lhour, lday, lmonth;
log_string("Setting time and weather");
lhour = (current_time - 650336715)
/ (PULSE_TICK / PULSE_PER_SECOND);
time_info.hour = lhour % 24;
lday = lhour / 24;
time_info.day = lday % 30;
lmonth = lday / 30;
time_info.month = lmonth % 12;
time_info.year = lmonth / 12;
if ( time_info.hour < 5 ) time_info.sunlight = SUN_DARK;
else if ( time_info.hour < 6 ) time_info.sunlight = SUN_RISE;
else if ( time_info.hour < 19 ) time_info.sunlight = SUN_LIGHT;
else if ( time_info.hour < 20 ) time_info.sunlight = SUN_SET;
else time_info.sunlight = SUN_DARK;
After looking at that i think i should change my sunrise and sunset times to be closer to what i would like. |
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #4 on Mon 15 Nov 2004 03:55 PM (UTC) |
Message
| Hmm, it was fine until I noticed this:
Today is Monday the 22nd of Ç…d»ÿ[Ƀ섣‹…h»ÿ .
This is what I have...
{
long lhour, lday, lmonth;
log_string("Setting time and weather");
lhour = (current_time - 650336715)
/ (PULSE_TICK / PULSE_PER_SECOND);
time_info.hour = lhour % 24;
lday = lhour / 24;
time_info.day = lday % 35;
lmonth = lday / 35;
time_info.month = lmonth % 12;
time_info.year = lmonth / 12;
if ( time_info.hour < 5 ) time_info.sunlight = SUN_DARK;
else if ( time_info.hour < 6 ) time_info.sunlight = SUN_RISE;
else if ( time_info.hour < 19 ) time_info.sunlight = SUN_LIGHT;
else if ( time_info.hour < 20 ) time_info.sunlight = SUN_SET;
else time_info.sunlight = SUN_DARK;
/*
weather_info.change = 0;
weather_info.mmhg = 960;
if ( time_info.month >= 7 && time_info.month <=12 )
weather_info.mmhg += number_range( 1, 50 );
else
weather_info.mmhg += number_range( 1, 80 );
if ( weather_info.mmhg <= 980 ) weather_info.sky = SKY_LIGHTNING;
else if ( weather_info.mmhg <= 1000 ) weather_info.sky = SKY_RAINING;
else if ( weather_info.mmhg <= 1020 ) weather_info.sky = SKY_CLOUDY;
else weather_info.sky = SKY_CLOUDLESS;
*/
}
|
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #5 on Mon 15 Nov 2004 11:32 PM (UTC) |
Message
| Ok, so thats whats setting it, what is your function to print it look like? I assume that the problem is there as well, and that your using "time"? Either way, can you paste what is printing section of code is producing that error? It may be the array that you have defined for the month names is missing something. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #6 on Tue 16 Nov 2004 03:12 AM (UTC) Amended on Tue 16 Nov 2004 03:21 AM (UTC) by Zeno
|
Message
| Well here's the whole function, may save time later.
void do_time( CHAR_DATA *ch, char *argument )
{
extern char str_boot_time[];
extern char reboot_time[];
int day;
bool has_clock=FALSE;
OBJ_DATA *obj;
char *suf;
day = time_info.day + 1;
for ( obj = ch->first_carrying; obj; obj = obj->next_content )
{
if (obj->item_type == ITEM_CLOCK)
has_clock=TRUE;
}
day = time_info.day + 1;
if ( day > 4 && day < 20 ) suf = "th";
else if ( day % 10 == 1 ) suf = "st";
else if ( day % 10 == 2 ) suf = "nd";
else if ( day % 10 == 3 ) suf = "rd";
else suf = "th";
set_char_color( AT_YELLOW, ch );
if ( has_clock || IS_IMMORTAL(ch) )
ch_printf( ch, "It is %d o'clock %s.\n\r", (time_info.hour % 12 == 0) ? 12 : time_info.hour % 12, time_info.hour >= 12$
ch_printf( ch, "You do not have a clock.\n\r" );
ch_printf( ch, "Today is %s the %d%s of %s.\n\r", day_name[day % 7], day, suf, month_name[time_info.month] );
ch_printf( ch,
"\n\rThe mud started up at: %s\r"
"The system time (PST): %s\r"
"Next Reboot is set for: %s\r",
str_boot_time,
(char *) ctime( ¤t_time ),
reboot_time
);
return;
}
Some of it is cut off, but what you need should be there. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
19,246 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top