[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Running the server
. . -> [Subject]  Months

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Months

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Mon 08 Nov 2004 08:02 PM (UTC)  quote  ]

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
[Go to top] top

Posted by Robert Powell   Australia  (349 posts)  [Biography] bio
Date Reply #1 on Tue 09 Nov 2004 09:07 AM (UTC)  quote  ]
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.

EldhaMUD Game Developments
The_Fury: Lead Developer, Head Coder
http://fury.eldhamud2.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #2 on Wed 10 Nov 2004 04:10 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Robert Powell   Australia  (349 posts)  [Biography] bio
Date Reply #3 on Thu 11 Nov 2004 05:43 AM (UTC)  quote  ]

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.

EldhaMUD Game Developments
The_Fury: Lead Developer, Head Coder
http://fury.eldhamud2.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #4 on Mon 15 Nov 2004 03:55 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #5 on Mon 15 Nov 2004 11:32 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #6 on Tue 16 Nov 2004 03:12 AM (UTC)  quote  ]

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( &current_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
[Go to top] 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.


1,545 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]