The standard Magsbot buttons include a simple method of weather control that changes the lighting in your world four times a day for dawn, day, sunset and night. (There is also a system of "on-demand" weather that lets visitors click buttons to call up different lighting schemes, and the instructions for that can be found here.) I did intend to create a more elaborate method that would change the lighting continuously, but I'm afraid I've never gotten around to it yet.
1. Create four weather buttons on the Weather tab of the Magsbot Actions panel, for each time of day. Or, you can use the default buttons I've provided, which are # Dawn, # Day, # Sunset and # Night. But if you want to create your own buttons, then do the following: create a bot instance and move it into your world; then manually adjust the lighting, skybox and ground to be however you want it for one particular time of day; and finally click on the Magsbot Actions panel button Attribs - create weather button, which will create a new weather button with the name you specify. (You can cut and paste the new button to the Weather tab.) If you make your own buttons, then delete the default buttons that I provided and give yours the same names (# Dawn, #Day, etc.)
2. Click on the Magsbot Actions panel button % Weathebot - Set to defaults on the Weather tab. This will set some global variables that the bot uses for controlling time-of-day, to their default values. In the next step, you can change any of these values as you wish:
3. Click on the Magsbot Actions panel button % WeatherBot setup on the Weather tab. (All the weatherbot button names begin with “%” to keep them grouped together.) You will be prompted to enter a value for each of the global variables that the bot uses to control time-of-day. The “ground” settings specify the ground object to use, the “sky” settings specify the skybox to use. (A old style backdrop is not used by the weatherbot.) The “latitude” setting determines how high in the sky the sunlight will originate. For instance, a value of 0 would make the light come straight down from overhead at noon, as it does at the equator. A value of -0.5 would position the sun halfway up the sky, at it appears at 45 degrees north latitude on the day of the equinox. (In later versions of the weatherbot I plan to have this value change automatically according to the time of year, as it does in real life.)
Note that these values will be saved automatically between sessions, unless you've unchecked the menu item File/Variable List/Auto save variable list on close.
4. If you want to adjust the sunrise and sunset times, then edit userdefs.udf with notepad and change the @sunrise_hr and @sunset_hr macros.
The time that the weather bot uses to set the lighting for can be taken from your local time (the time on your computer) or VR time. To choose which you prefer, edit the @now macro in userdefs.udf. There are two @now macros in userdefs.udf, one for local time and one for VR time. Simply put a semicolon ( ; ) in front of the one that you do NOT want to use. (See comments in userdefs.udf file.)
Note that the % Enter Sunrise,Sunset button on the Magsbot Actions panel is used by the moer elaborate method that I haven't fully developed yet, and won't affect the lighting control at all, according to the method explained above.
5. Position the weather bot in your world and click % Day Timer
ON
to begin operation. If you want it to start automatically when you run
the bot, add a row to the Behavior Table with Event STARTUP
and Action ENQUEUE {
CLICKBTN
"% Day Timer ON" }. (Make sure you get the
capitalization
right; button names are case sensitive.)
6. The weather bot needs to have it's Instance Note set to
"WeatherBot" so the system will know which bot instance is supposed to
be controlling the weather. The command to do this is INSTNOTE @instance "WeahterBot"
which can be set manually by pressing F5 and then typing the command
and clicking Ok. However you will probably want to have the weatherbot
automatically set each time you start it up. To do that, run the bot
and make sure it's selected on the Instance List (Alt-I), then click Create Instance Button on the . tab
of the Actions Panel to create a new button. Edit the new button and
add the INSTNOTE... command at the end of the button code. (If you have
a more recent copy of the standard buttons, the code to set the
instance note will already be added to the new button for you.)
| This
more elaborate method would change
the lighting continuously, but it's not fully implemented at this time. 1. Edit the [SetLight] button on the Magsbot Actions panel. In the [SetLight] button text, change CLICKBTN "[SetLightByTime]" to CLICKBTN "[SetLightByXY]". (Change it back if you want to use the simpler method again.) 2. Click the % Enter Sunrise,Sunset button and enter the times you want for sunrise and sunset. 3. Click the % Day Timer ON button to activate the bot. The bot will then change the direction of lighting continuously throughout the day, and change the lighting color, ground and skybox at the appropriate times, using the settings in the buttons [Dawn], [Day], [Sunset] and [Night]. In future versions the color and skybox will change continuously instead. |
Feel free to email me with any questions.