/ \      _             Play Now                         Nemesis on fb
          | |     | |  _______   _        _   _______    _______   _    _______
          | |\    | | |   ____| |  \    /  | |   ____|  /   ____| | |  /   ____|
O= Home <=XX|  About  News  Pics  Adventurers  Wizards  Download  Connect     >
          | |   \   | |  |____  | |      | | |  |____   ___ \  \  | |  ___ \  \
          | |     \_| |_______| |_|      |_| |_______| |_______/  |_| |_______/
          \ /

Documentation Area

Document Path: /doc/build/weather

Hi weather enthusiast !!!

Well, weather is working now (or at least it seems to) and it is installed for
all rooms and castles. As you have to work and live with it from now on here
are some hints on how to use it.

First of all your rooms have to be based on room.h or std.h. Any other
construction does NOT work with the weather!
And if you get curious about a file named roomext.h : that file is
OFF LIMITS for you. It is automatically included in room.h and std.h.

Here is a brief introduction in the working of the weather. Every room
determins at the reset which light and which weather it will have. The
values obtained there will then controll the behavior of the room.
Each time the weather changes or the sun rises or sets all the rooms
where players are standing are informed about the change. Additionally
the rooms test if it's day or night whenever they are entered. Thus they
can set the light correctly according to day and night.

To use the weather in you rooms you only have to include room.h or std.h and
then #define WEATHER and CLIMATE. But don't mess around with the reset()
and init() routines because they are needed to install it correctly.

Now a short example for the usage :

#include "room.h"

#undef  WEATHER

#undef  CLIMATE

"A room with weather",
"In this room we have full weather and arctic climate.\n"+
"There is not much more to say about it.\n",LIGHT)

You find this file in /room/examples/room14.c .

Here is a list of weather types (types DEFAULT, OUTSIDE etc. are defines
given via the standard room-codes (room.h and room2.h) and SHOULD be used):

WEATHER DEFAULT (0) : Default weather for your castle
WEATHER NONE (1)    : Absolutely no weather in this room. The light will
                      be set to on or off according to the room specification.
WEATHER INSIDE (2)  : Inside-weather. The player can look at the sky and is
                      informed about weather changes. The light will change
                      with day and night.
WEATHER SHELTER (3) : Shelter-weather. Nearly the same as WEATHER INSIDE (2)
                      except for the messages.
WEATHER OUTSIDE (4) : Full weather. The player gets all weather effects
                      (if there only were any). Besides that just like
                      WEATHER INSIDE and SHELTER (2 and 3).

If you want the light in your rooms to be independant from day and night you
have to set it to LIGHT_OFF (0 = no light) or LIGHT_ON (2 = permanent light).
Light LIGHT (1) is the normal day/night change.
If there is no weather in your room there will of cource be no day/night change
so light LIGHT (1) gives here the same result as light LIGHT_ON (2).

Now a list of different clima types (STANDARD, BAD are defined via the
standard room-codes (room.h and room2.h) and SHOULD be used):

CLIMATE STANDARD (0) : Standard climate
CLIMATE BAD (1)      : Bad weather (mostly raining)
CLIMATE TROPIC (2)   : Tropic weather (mostly sunshine)
CLIMATE JUNGLE (3)   : Jungle climate (humid and hot)
CLIMATE DESERT (4)   : Desert climate (hot and dry)
CLIMATE ARCTIC (5)   : Arctic weather (cold with snowstorms)
CLIMATE OCEAN (6)    : Weather like you get it on a boat (waves and things)
CLIMATE FOG (7)      : Foggy weather, no sun, dismal weather (e.g. cemetery)

All the above defines (WEATHER and CLIMATE) are in /include/room_defines.h .

At the moment there are no effects of the weather. I plan to install something
like lightning strikes and similar things sometime.

The dawn in Nemesis lasts from 4:00 to 4:30, the day is from 4:30 to 22:00,
and the dusk is from 22:00 to 22:30. The night takes place from 22:30 to 4:00.
During the night it is by default dark in all the outside, shelter, and
inside rooms. All the other time it is bright.
The time in Nemesis passes 8 times faster than the real time. So one Nemesis
hour only takes 7.5 real minutes, a day is by in 3 hours and a new year starts
every 1.333 real months.

Here are some functions that can be called in the weather object:
- query_incarnation() : return the incarnation number of the weather object.
			Useful for synchronisation purposes.
- query_time() : return Nemesis time in seconds since 0:00 o'clock
- query_time_speedup() : return the factor by which Nemesis time runs faster
                         than the real time
- calculate_duration(t) : return real time to pass till Nemesis time is 't'.
                          't' must be in seconds since midnight.
                          Useful for call_outs.
- query_dark()  : return 1 if the light in Nemesis is off
- query_day()   : return 1 if it is day
- query_night() : return 1 if it is night
- query_tod() : return the time of the day (Tageszeit)
                0 = dawn
                1 = day
                2 = dusk
                3 = night
- query_tod_msg()     : return the message for the time of the day
- query_the_day()     : return the number of the day in the month (1..30)
- query_the_month()   : return the number of the month (1..13)
- query_the_year()    : return the number of the year
- query_the_weekday() : return the number of the day in the week (0..6)
- query_the_yearday() : return the number of the day in the year (1..390)
- query_the_season()  : return the season
			0 = winter
			1 = spring
			2 = summer
			3 = autumn
- query_name_weekday() : return the name of the weekday
- query_name_month()   : return the name of the month
- query_name_season()  : return the name of the season
- query_weekdays() : return array of all weekday names
- query_months()   : return array of all month names
- query_seasons()  : return array of all season names
- query_weather_condition() : return the actual weather condition as a value
                              ranging for 0='very bad' to 4='very good'
- query_weather_forecast() : return if the weather becomes better (=1) or
                             worse (=-1)
- query_weather_duration() : return how many Nemesis seconds the present
                             weather condition will last
- show_weather() : displays the weather in the environment of this_player

To change the light at daybreak and nightfall the WEATHER_OBJ calls the
function change_light() in all the rooms in which players are present.
All the other rooms test the actual light condition whenever they are
entered. Thus there will always be the right light level in all the rooms.

I hope I didn't let you stand in the rain,

See also:

This page was generated in LPC

Imprint / Impressum