Welcome to the Builder Academy

Question Time and weather instead of description

More
17 Mar 2016 14:58 #5625 by Dvinn
Is there an easy way to add time and weather next to the automap instead of room descriptions? I've been trying adding a call to do_weather and do_time but I'm having no luck. My newb coding skills are affecting me with this one!

Please Log in or Create an account to join the conversation.

More
17 Mar 2016 21:35 #5626 by WhiskyTest
Here is something I use, you'll just need to drop it into the Automap code at the appropriate place
Code:
// Display the Time send_to_char(ch, " <%d%s> ", (time_info.hours % 12 == 0) ? 12 : (time_info.hours % 12), time_info.hours >= 12 ? "pm" : "am"); // Display the weather if you are outside if(!ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS)) { snprintf(buf, sizeof(buf), "@c(%s@c)@n", sky_look[weather_info.sky] ); parse_at(buf); send_to_char(ch, " %s", buf); }

Or you could use these two functions:
Code:
do_time(ch, 0, 0, 0); do_weather(ch, 0, 0, 0);

Please Log in or Create an account to join the conversation.

More
17 Mar 2016 21:44 - 17 Mar 2016 21:48 #5627 by WhiskyTest
You reminded me of a piece of code I wrote for weather, it goes in do_simple_move() inside act.movement.c
It may not suit your MUD, it was to provide a bit more atmosphere for a survival/horror style world.
All it does is describe the change of environment when you move between INDOORS and .. well, NOT INDOORS :D
Code:
act.movement.c do_simple_move() else greet_memory_mtrigger(ch); + if(ROOM_FLAGGED(was_in, ROOM_INDOORS) && !ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS)) + { + send_to_char(ch, "You step outdoors "); + switch (weather_info.sky) + { + case SKY_CLOUDLESS: + send_to_char(ch, "into sunny weather.\r\n"); + break; + case SKY_CLOUDY: + send_to_char(ch, "into dark cloudy weather.\r\n"); + break; + case SKY_RAINING: + send_to_char(ch, "into a heavy downpour!\r\n"); + break; + case SKY_LIGHTNING: + send_to_char(ch, "into a fierce lightning storm!\r\n"); + break; + default: + break; + } + } + else if (!ROOM_FLAGGED(was_in, ROOM_INDOORS) && ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS)) + send_to_char(ch, "You step indoors, out of the elements.\r\n"); /*---------------------------------------------------------------------*/ /* End: Post-move operations. */
Last edit: 17 Mar 2016 21:48 by WhiskyTest.

Please Log in or Create an account to join the conversation.

Time to create page: 0.174 seconds