← MPP-Mainstore › Scripts MPP - Day and Night Sky Cycle Download the documentation (.md)

Version 2.4.0 · updated September 22, 2026

MPP - Day and Night Sky Cycle V2.4 - Documentation

A complete day and night cycle for your Sansar scene, ready to use: a sun that follows the real path of the sun for the place and the date you choose, a sky dome with stars, a cloud layer, a desk of buttons for your visitors, and a scheduler that talks in the nearby chat and can switch your lamps on at sunset.

New in V2.4: the scene clock can show legal time (time zone, summer time, longitude), and sunrise and sunset are within about 3 minutes of the official times. The set is delivered for Paris; to use another place, you only change a few settings (section 2).

Contents

  1. What you get
  2. Quick start (5 minutes)
  3. The Commands Desk
  4. How time works
  5. Control settings
  6. Sun settings
  7. Sky, Stars and Clouds settings
  8. Visitor commands
  9. Scheduled events - Actions A and Actions B
  10. Announcements
  11. Welcome message
  12. Adding the script to your own objects
  13. Recipes
  14. Troubleshooting
  15. Limits

1. What you get

In Build mode, your inventory holds the item - MPP - Day and Night Sky Cycle - V 2.4. It is one parent object that groups four objects, all already scripted and set up:

ObjectWhat it isScripts on it
MPP SunThe directional light: the sun by day, the moonlight at nightMPP - Day Night - Control (every setting of the scene: place, date, day length, visitor commands, scheduler) and MPP - Day Night - Sun (the light and its colors)
MPP SkyThe sky domeMPP - Day Night - Sky (the sky layers of the dome) and MPP - Day Night - Stars (the star layer, lit at night only)
MPP CloudsTwo cloud spheres that stay stillMPP - Day Night - Clouds (one script drives both spheres)
MPP - Commands DeskA desk with 9 buttons for your visitorsone MPP - ActionButton script (V1.7.0) on each button

The five DayNight scripts are the same script, MPP - Day Night V2.4.0, used as three modules:

To see the settings of a script: in the Scene Objects list, expand - MPP - Day and Night Sky Cycle - V 2.4 to show its four objects, select one and open Properties. Each script appears as a block titled with its name in capitals, for example MPP - DAY NIGHT - CONTROL. Under the title, the first drop-down shows the script (MPP - Day Night V2.4.0) and the second one its module (MPPDayNightControl, MPPDayNightSun or MPPDayNightSky). On MPP Clouds the script sits on the part Sphere 02. The nine buttons are the objects inside MPP - Commands Desk, named after their button (for example MPP button - City).

All the modules talk on one private channel, General/Group = DayNight. Keep it identical everywhere.


2. Quick start (5 minutes)

2.1 Place the set

  1. Open your scene in Build mode.
  2. In your inventory, find - MPP - Day and Night Sky Cycle - V 2.4 and drag it into the scene.
  3. Move it near the centre of your scene: the sky dome and the clouds surround it.
  4. Do not rotate MPP Sun, MPP Sky or MPP Clouds on their own: the sun and the sky are set to turn together from their current orientation. You may move the whole set, and turn the whole set around the vertical axis (for example to choose where the sun is at noon), but never tilt it.
  5. Save and build the scene, then visit it. The sun already runs: Paris, July 21, a 4-hour day, opening at 4:30 AM at the first light of dawn.

2.2 Choose your place on the globe

Select MPP Sun, open Properties, and go to the block MPP - DAY NIGHT - CONTROL, group Geo:

SettingDeliveredWhat to type
Geo/Latitude (deg)48.857 (Paris)Latitude of your place, -90 to 90. Negative = south of the equator
Geo/Longitude (deg)2.352 (Paris)Longitude, -180 to 180. Negative = west of Greenwich
Geo/UTC Offset (h)1Time zone in winter, in hours from UTC: London 0, Paris 1, New York -5, Tokyo 9, India 5.5
Geo/Clock Mode (0-4)2Summer time rule: 1 = none, 2 = Europe, 3 = North America, 4 = Australia. 0 = solar clock (12:00 = sun at its highest)
Geo/Place NameParis in FranceThe name of your place, as the welcome message will say it

Appendix A gives these values for 40 cities. Example, Tokyo: latitude 35.68, longitude 139.65, UTC Offset 9, Clock Mode 1, Place Name Tokyo in Japan.

Do not forget Geo/Place Name: the welcome message quotes it.

The desk's City button only knows Stockholm, Paris, Los Angeles and Sydney: once a visitor clicks it, your own place comes back only when the scene restarts. Delete that button (it is the object MPP button - City inside the desk) if you want to keep your place.

2.3 Choose the day of the year

Same block, Geo/Day Of Year (1-365). Delivered: 202 (July 21). The day sets the height of the sun and the length of the day.

DayDateIn the northIn the south
79March 20Spring equinox, about 12 hours of dayAutumn
172June 21Longest dayShortest day
266September 23Autumn equinoxSpring
355December 21Shortest dayLongest day

Appendix B gives the day number of 20 well-known dates (Christmas = 359, Halloween = 304...). The date does not advance by itself: the scene always replays the day you chose.

The desk's Season button switches between days 172 and 355 only: once a visitor clicks it, your own day comes back only when the scene restarts. Delete that button (MPP button - Season) if you want to keep your day.

2.4 Choose the length of a day and the opening hour

Same block, group Cycle:

SettingDeliveredWhat it does
Cycle/Day Length (hours)4Real time for one full in-world day (24 in-world hours), hours part
Cycle/Day Length (minutes)0Minutes part, added to the hours
Cycle/Start Time (0-24h)4.5Hour on the scene clock when the scene starts: 4.5 = 4:30 AM, 12 = 12:00 PM, 21.25 = 9:15 PM

Examples: 1 h 0 min = a whole day in one real hour; 0 h 16 min = a fast day for a demo; 24 h 0 min = the in-world day runs at real speed.

If you change the day length, also change Buttons/Normal (minutes) (same block, group Buttons) to the same length in minutes, for example 60 for a 1-hour day. The desk's Cycle speed button switches between Buttons/Fast and Buttons/Normal: otherwise its "normal" position brings back the 4-hour day.

4:30 AM is the first light of dawn in Paris in July. After changing the place or the day, check the opening hour: for example 9 opens the scene in the morning almost everywhere.

2.5 Save, build and visit

Type /daynight help in the nearby chat to see the visitor commands, or click the ? button of the desk. That is all you need: the rest of this guide explains every option.


3. The Commands Desk

A sloped desk titled Commands Desk with 9 buttons. The large button on the left is Help. The top row holds the four "setting" buttons (from left to right: Cycle speed, Season, Time of day, City); the bottom row holds the four "moment" buttons (Sunrise, Noon, Sunset, Midnight). Any visitor can click them.

ButtonIconWhat a click does
Helpa question markSends the list of chat commands privately to the visitor who clicked
Sunrisea half sun on the horizon, arrow upThe sun sweeps to today's sunrise
Noona full sunThe sun sweeps to its highest point
Sunseta half sun on the horizon, arrow downThe sun sweeps to today's sunset
Midnighta moon and starsThe sun sweeps to its lowest point
Time of daya sun and a moon joined by circular arrowsEach click goes to the next moment: sunrise, noon, sunset, midnight, then again. The button keeps the color of the last moment sent
Cycle speeda fast-forward signSwitches between a fast day (16 real minutes) and the normal day (4 hours). Red = fast, green = normal. It starts green
Seasona sun and a snowflakeSwitches between the summer solstice (June 21, day 172) and the winter solstice (December 21, day 355). Yellow = summer, blue = winter
Citya globe with a pinGoes through Stockholm, Paris, Los Angeles and Sydney: latitude, longitude, time zone and summer time together. Each city has its color: light blue, warm white, yellow, green

Good to know:

Button settings (script MPP - ActionButton V1.7.0)

Shared by the 9 buttons: Collision Mode Off (click), Cooldown Seconds 0.8, Global Cooldown On, Cooldown Notice On (text "Please wait {time} before using this button again."), Owner Only Off, Access List empty, List Is Blacklist Off, Denied Text "You are not allowed to use this button.", Hide From Denied Off, Send as Command On, Private Text Off, Remote Control Off (Remote Prefix mpp_actionbutton, unused), Click Sound MPP - Computer Beep at volume 100, Visual On, Tint Material Name empty (every tintable material of the button), Return Fade Seconds 0.8, Emissive On, Debug Off.

ButtonHover TextCommand CountInitial CommandCommandsTints (RGB)
HelpHelp10daynight_help230,230,230
SunriseSunrise10daynight_sunrise255,183,113
NoonNoon10daynight_noon255,240,228
SunsetSunset10daynight_sunset255,60,163
MidnightMidnight10daynight_midnight84,120,217
Time of dayTime of day40daynight_sunrise, daynight_noon, daynight_sunset, daynight_midnight255,183,113 / 255,240,228 / 255,60,163 / 84,120,217
Cycle speedCycle speed22daynight_fast, daynight_normal255,89,89 / 89,255,89
SeasonSeason20daynight_summer, daynight_winter255,217,89 / 89,166,255
CityCity40daynight_stockholm, daynight_paris, daynight_losangeles, daynight_sydney166,220,255 / 255,240,228 / 225,217,89 / 89,255,166

The one-command buttons flash their tint with an emissive of 0.2, then fade back; the multi-state buttons keep the tint of their current state, with an emissive of 4.


4. How time works

The sun itself always moves in solar time: at 12:00 solar time it stands at its highest. Real clocks show legal time, which differs by the time zone, summer time, the longitude inside the time zone and the equation of time (the sun runs up to 16 minutes early or late during the year). In Paris, the sun culminates between 12:34 PM (early November) and 1:57 PM (late July), legal time.

Geo/Clock Mode chooses the clock that visitors read and type: 0 = solar time, 1 = legal time without summer time, 2 = legal time with European summer time (delivered), 3 = North American, 4 = southern hemisphere (Australia). With a legal clock, set Geo/Longitude and Geo/UTC Offset (winter offset from UTC: Paris 1, London 0, New York -5). The City button sets all three (a Control in Clock Mode 0 keeps solar time). Appendix A gives the values of 40 cities.

Hours you type (time 18, 18:30 in the Events lists, Cycle/Start Time) are on the scene clock. Keywords follow the sun: sunrise, sunset, noon (sun at its highest) and midnight (sun at its lowest). The four manual period starts of the timeline are solar hours, because they describe the light.

Sunrise and sunset follow the published convention (upper edge of the sun on the horizon, with atmospheric refraction). Accuracy: about 3 minutes compared with official ephemerides, with a few exceptions near the polar circles and around the summer time switches (section 15).

Example - the delivered set (Paris, July 21). The scene clock is 1 h 57 min ahead of the sun. Sunrise reads 6:10 AM and sunset 9:44 PM, like the real ones; the sun is at its highest at 1:57 PM, so the Noon button answers time set to noon (1:57 PM); /daynight time 12 puts the sun 1 h 57 min before its highest point. The scene opens at 4:30 AM, when the Morning period begins: the first light of dawn, 1 h 40 min before sunrise.


5. Control settings

Object MPP Sun, block MPP - DAY NIGHT - CONTROL (module MPPDayNightControl). The "Delivered" column gives the values of the set.

Cycle

SettingDeliveredWhat it does
Cycle/Day Length (hours)4Real duration of a full in-world day, hours part (0 to 72)
Cycle/Day Length (minutes)0Minutes part (0 to 59). 0 h 0 min falls back to 4 hours
Cycle/Start Time (0-24h)4.5Hour when the scene starts, on the scene clock. 12 = 12:00, 6.5 = 6:30 AM. Applied again when the Control or the Sun restarts

Geo

SettingDeliveredWhat it does
Geo/Use Geographic ModelOnRealistic sun height and day length for the latitude and the season. Off = latitude and date are ignored: the sun rises at 6:00 and sets at 18:00 solar time every day and passes straight overhead at noon (the Sun's Advanced/Tilt Extra Offset can tilt that path)
Geo/Latitude (deg)48.857-90 to 90. Negative = southern hemisphere
Geo/Longitude (deg)2.352-180 to 180, east positive, west negative. Places solar noon on a legal clock
Geo/Day Of Year (1-365)20279 = Mar 20, 172 = Jun 21, 202 = Jul 21, 266 = Sep 23, 355 = Dec 21 (Appendix B)
Geo/Place NameParis in FranceName shown by {place} and {location} in the messages. The City button sets it and the chat command lat clears it; typing your own latitude here does not clear it
Geo/Clock Mode (0-4)2Clock that visitors read and type. 0 = solar time, 1 = legal time, 2 = legal + European summer time, 3 = legal + North American summer time, 4 = legal + southern summer time (Australia). With Use Geographic Model Off, choose 0 to keep sunrise at 6:00 and sunset at 18:00
Geo/UTC Offset (h)1Winter time zone in hours from UTC, -12 to 14, decimals allowed (India 5.5). Summer time is added by the Clock Mode

Timeline

SettingDeliveredWhat it does
Timeline/Auto From GeoOnThe four periods follow the computed sunrise and sunset (recommended)
Timeline/Twilight (% of day)7Morning starts this much before sunrise and Day this much after; the same around sunset (Evening, Night). 7 % of a day = 1 h 41 min in-world
Timeline/Blend Width (% of day)8Softness of each period change
Timeline/Manual Morning / Day / Evening / Night Start (h)4.8 / 7.2 / 16.8 / 19.2Used only when Auto From Geo is Off. Solar hours (12 = sun at its highest), because they describe the light. Decimal hours: 6.5 = 6:30

Chat, Buttons, Transition

SettingDeliveredWhat it does
Chat/EnableOnListens to the chat commands (section 8)
Chat/Prefix/daynightCommand prefix
Chat/Owner OnlyOffOn = only the scene owner can use the chat commands. The buttons are not affected
Chat/FeedbackOnPrivate confirmation after each command, and the private "please wait" and error messages. Off = silent (the help is still sent)
Chat/Cooldown (s)4Minimum delay between two visitor commands, chat and buttons together. Refused commands answer "please wait". 0 = off
Buttons/EnableOnListens to the buttons of the desk
Buttons/Event PrefixdaynightPrefix of the button command texts. If you change it, change the commands of the buttons too
Buttons/Fast (minutes)16Day length applied by the Cycle speed button (fast)
Buttons/Normal (minutes)240Day length applied by the Cycle speed button (normal). Keep it equal to your Cycle/Day Length
Transition/Duration (s)8The sun sweeps to a requested time in this many seconds. 0 = instant jump

Events, General, Debug

SettingDeliveredWhat it does
Events/EnableOnMaster switch of the scheduler: actions, announcements and welcome message
Events/Actions A (states)2 linessunset | mpp_lamp_all_on and sunrise | mpp_lamp_all_off (section 9)
Events/Actions B (moments)emptySection 9
Events/Announcements3 lineshourly | It is {time}., morning | Have a good day!, night | Have a restful night. (section 10)
Events/Welcome Mode (0-2)20 = off, 1 = once in nearby chat, 2 = privately to each visitor (section 11)
Events/Welcome Delay (s)10Seconds between the visitor's arrival and the message (0 to 60)
Events/Welcome Messagesee section 11The welcome text
General/GroupDayNightMust match the Sun and the Sky modules
Debug/Verbose LoggingOffLogs config pushes, commands and every scheduled event in the script console

6. Sun settings

Object MPP Sun, block MPP - DAY NIGHT - SUN (module MPPDayNightSun).

SettingDeliveredWhat it does
Rotation/Axis (x|y|z)xAxis of the daily rotation. Keep x
Rotation/Invert DirectionOffReverses the direction of the sun. The sky follows automatically
Rotation/South Direction (x|-x|y|-y)emptyWorld axis of the geographic south. North of the tropics the sun culminates toward it at noon; south of the equator it culminates on the opposite side. Empty = keep the pose (with the delivered pose, south = -x). Prefer turning the whole set: this setting turns the sun path only, not the dome
Light/Enable TimelineOnDrives the light color and intensity through the four periods
Light/Morning Color, Intensity255,141,45 (golden), 3.2Sunrise light
Light/Day Color, Intensity255,245,224 (warm white), 8Daylight
Light/Evening Color, Intensity255,39,243 (magenta), 2Sunset light. For a natural copper sunset, try 255,99,41
Light/Night Color, Intensity56,98,215 (moonlight blue), 0.04Night light. Raise the intensity for brighter nights
General/GroupDayNightPrivate channel shared with the Sky and Control modules
Advanced/Tilt Axis (x|y|z)zAxis of the latitude and season tilt. Keep z
Advanced/Tilt Extra Offset (deg)0Artistic tilt added to the latitude. 0 = realistic
Advanced/Base Euler <x,y,z> (deg)<0,0,0>Extra rotation of the sun path. Keep <0,0,0>
Advanced/Tick (s)0.25Evaluation interval of the light
Debug/Verbose LoggingOffDetailed log lines
Debug/Heartbeat (s)0Periodic status line in the log. 0 = off

Intensities go from 0 to 100. The evening colors of the whole set (light, sky, clouds) are a stylized magenta sunset.


7. Sky, Stars and Clouds settings

Three modules share the same settings (module MPPDayNightSky):

SettingSkyStarsCloudsWhat it does
Rotation/EnableOnOnOffThe layer turns with the sun
Rotation/Cycle Axis (x|y|z)xxxRotation axis. Keep x
Rotation/Cycle Angle Offset (deg)000Keep 0
Materials/Names (empty=all)Sky, FXStarsemptyNames of the materials to drive. Empty = every scriptable material of the object
Materials/Match Mode (1-4)4141 = exact name, 2 = exact ignoring case, 3 = contains, 4 = contains ignoring case
Materials/Log NamesOffOffOffOn = lists the found, driven and skipped materials in the log at start
Blend/EnableOnOnOnFades the materials between their Day and Night values around the horizon
Blend/Horizon (deg)121212Half-width of the fade. Higher = longer dawn and dusk
Blend/Absorption Day / Night0 / 0.960 / 00.2 / 1Absorption of the material by day and by night
Blend/Emissive Day / Night0 / 0.160 / 3.20.96 / 0.32Emissive intensity by day and by night
Tint/EnableOnOnOnTints the materials through the four periods
Tint/Morning Color255,163,104104,164,255255,204,104Tint of the morning
Tint/Day ColorwhitewhitewhiteWhite = no tint
Tint/Evening Color190,60,255255,140,59255,59,183Tint of the evening
Tint/Night Color17,47,173white16,117,173Tint of the night
General/GroupDayNightDayNightDayNightMust match the Sun
Advanced/Resync Threshold (deg)111The layer realigns only when it is further than this from the Sun
Advanced/Tick (s)0.250.250.25Evaluation interval of the blend and tint
Debug/Verbose Logging, Heartbeat (s)Off, 0Off, 0Off, 0Same as the Sun

8. Visitor commands

Chat

Type these in the nearby chat. Every command but help goes through the shared cooldown (4 seconds).

CommandEffect
/daynight helpLists the commands
/daynight midnight sunrise noon sunsetSweeps to that moment of the sun: noon = sun at its highest, midnight = at its lowest; sunrise and sunset are the computed ones for the current place and season. The answer gives the clock time, e.g. time set to noon (1:57 PM)
/daynight time 18Sweeps to 6:00 PM on the scene clock. Decimals allowed: time 6.5 = 6:30 AM
/daynight length 16A full day now lasts 16 real minutes (0.5 to 4320)
/daynight date 172Day of the year: 172 = summer solstice
/daynight lat -33.9Custom latitude. Longitude, time zone and clock mode stay as they are
/daynight stockholm paris losangeles sydneyCity presets: latitude, longitude, time zone, summer time rule and place name. A Control set to Clock Mode 0 stays on solar time

With a legal clock (Clock Mode 1-4), date, the season and the city commands keep the solar time (the sun changes height, not its place in the day) but make the clock jump, usually by about 1 hour.

A command changes the scene for everybody until the scene restarts (or until the Control or the Sun script restarts): then the settings of the Control apply again.

Button commands

The desk sends these texts as script events (MPP ActionButton, Send as Command = On):

daynight_midnight daynight_sunrise daynight_noon daynight_sunset daynight_fast daynight_normal daynight_summer daynight_winter daynight_help daynight_stockholm daynight_paris daynight_losangeles daynight_sydney

daynight_fast and daynight_normal apply Buttons/Fast and Buttons/Normal; daynight_summer and daynight_winter jump to days 172 and 355.


9. Scheduled events - Actions A and Actions B

The Control can send script events to any other script of the scene at chosen in-world times. Two lists, the same syntax, two different behaviors.

Delivered: Actions A holds sunset | mpp_lamp_all_on and sunrise | mpp_lamp_all_off. No lamp comes with the set: these two lines are a ready-made example for lamps driven by the MPP Light Switch Script (V1.5.1, sold on the Sansar Store, see Appendix C; V1.4.2 works too), which is compatible as is. Put that script on your lamps with External Events On and they switch on at sunset and off at sunrise by themselves (example 1). Without such lamps these two lines do nothing; delete them if you like. Actions B is empty.

Line syntax

when | event_name
when | event_one, event_two

Everything before the first | is the time, everything after is one event name or several separated by commas. Event names are sent exactly as typed (case and punctuation kept). Each list holds up to 20 lines.

The when part

You typeMeaning
18:30 18h30 18h 18.5 18,5A fixed hour on the scene clock, 0 to 24
sunrise sunsetThe computed sunrise and sunset. They move with latitude and season
morning day evening nightThe start of that period of the timeline
noon midnightThe sun at its highest and at its lowest (solar noon and midnight). They read 12:00 and 00:00 only with Clock Mode 0; in Paris in July, noon reads about 1:57 PM
hourlyEvery full hour of the scene clock (24 times a day)
sunset-0:30 night+1 sunrise+0.25A keyword shifted by hours: 30 minutes before sunset, 1 hour after nightfall, 15 minutes after sunrise

A = states, B = moments

Actions A (states)Actions B (moments)
Use it forThings that are on or off: lamps, fires, fountains, shop signsThings that happen: a bell, a rooster, a firework, a sound
At scene startReplayed: after 5 seconds the scene is put in the state it should have at the current hourNothing
After a jump or sweep (Noon button)The states crossed on the way are appliedSkipped
When the season or place changesReplayedNot replayed. With a legal clock the clock may jump, so a fixed hour or an hourly line can come round a second time or be skipped once
RuleUse explicit on / off events, never a toggleAnything

Why it matters: start the scene at 10 PM with lamps in list A and they are lit within 5 seconds, although sunset happened before the scene existed. A bell at 18:00 in list A would ring at every scene start; in list B it rings only when 6 PM really passes.

The Control's own commands (daynight_noon, daynight_summer...) are refused in list A, because a replayed time command would loop. Put them in list B.

Example 1 - street lamps (MPP Light Switch Script V1.5.1 or V1.4.2)

LightSwitch settings: External Events = On, External Event Prefix = mpp_lamp. (V1.4.0 and V1.4.1 also answer the _all_ names below; on V1.4.0 the switch is called Enable External Script Events.) Since V1.5 the lamp's Cooldown Seconds also applies to these events: when the scheduler replays the last 24 hours (scene start, Season or City change), each lamp goes straight to the right state, without blinking.

Actions A (states)
  sunset  | mpp_lamp_all_on
  sunrise | mpp_lamp_all_off

_all_ reaches every LightSwitch whatever its Group. To drive one group only, write the group name in lowercase, with underscores for spaces. For lamps whose Group is Street:

  sunset  | mpp_lamp_street_on
  sunrise | mpp_lamp_street_off

Use night and morning instead of sunset and sunrise to switch at the end of dusk and at the first light of dawn.

Example 1b - the same with MPP LightSwitch V1.3

V1.3 listens to another name pattern: <Event Prefix>:<group in lowercase>:<action>. With Event Prefix = mpp_lamp and Group = Lamp:

Actions A (states)
  sunset  | mpp_lamp:lamp:on
  sunrise | mpp_lamp:lamp:off

With an empty Group the names are mpp_lamp:on and mpp_lamp:off.

Example 2 - shop window lit before the street lamps

Actions A (states)
  sunset-0:30 | mpp_lamp_shop_on
  23:00       | mpp_lamp_shop_off
  sunset      | mpp_lamp_street_on
  sunrise     | mpp_lamp_street_off

Example 3 - one line, several receivers

  sunset  | mpp_lamp_all_on, campfire_on, fountain_off
  sunrise | mpp_lamp_all_off, campfire_off, fountain_on

Example 4 - moments

Actions B (moments)
  sunrise  | rooster_crow
  12:00    | church_bell
  hourly   | clock_chime
  midnight | daynight_summer

The last line uses a DayNight command as a moment: each time the sun really passes its lowest point (midnight), the season jumps to summer. Like a click, it goes through the 4-second cooldown: it is skipped silently if a visitor command was accepted just before, and a visitor who clicks right after gets "please wait".

Which scripts can receive these events?

Any script that subscribes to a script event by name. One thing to know: a scheduled event is sent by the scene, not by a visitor, so it carries no avatar.

ReceiverWorks?
MPP Light Switch Script (V1.4.2 and later)Yes, as is
MPP TransformByClickOrChatYes with Command Access Mode = 0 (Everyone)
MPP RandomObjectSpawnerYes with ExternalEventsUseClickPermission Off, or ClickPermissionMode = Everyone (keep AllowExternalEventsWithoutAvatar On, its default)
MPP StreamSwitcher V1.4.7No: it requires an avatar
Your own scriptsYes: SubscribeToScriptEvent("campfire_on", handler)

For scripters. The payload is compatible with the MPP ActionButton interface and adds the hour of the scene clock:

public interface IScheduledEvent
{
    string ActivatorAvatarUuid { get; }   // always empty for a scheduled event
    float InWorldHour { get; }            // 0..24, the hour of the entry on the scene clock
}

SubscribeToScriptEvent("campfire_on", (ScriptEventData e) =>
{
    // e.Data is null when another script posts the same name without a payload
    var data = (e.Data != null) ? e.Data.AsInterface<IScheduledEvent>() : null;
    LightTheFire();
});

10. Announcements

Lines of the Events/Announcements list are said in the nearby chat, to everybody.

when | message

Same when syntax as the actions. Delivered:

  hourly  | It is {time}.
  morning | Have a good day!
  night   | Have a restful night.

With a 4-hour day, hourly speaks every 10 real minutes: delete that line for a quieter scene. To silence all the announcements, empty the list (or turn Events/Enable Off, which also stops the actions and the welcome message).

The message may contain variables:

VariableExample outputMeaning
{time}2:00 PMHour of the entry on the scene clock, 12-hour format
{time24}14:00Hour of the entry on the scene clock, 24-hour format
{date}July 21From Geo/Day Of Year
{place}Paris in FranceGeo/Place Name (may be empty)
{lat}48.9 NLatitude
{location}Paris in France (latitude 48.9 N) or latitude 48.9 NPlace and latitude together
{daylength}4 hours, 16 minutes, 1 hour 30 minutesReal duration of a full day
{sunrise} {sunset}6:10 AM, 9:44 PMComputed for the current place and season, on the scene clock; -- during polar day or night

More examples

Events/Announcements
  sunrise     | Good morning! The sun rises at {sunrise}.
  sunset-1    | One hour of daylight left: sunset is at {sunset}.
  12:00       | Noon in {place}. Lunch time!
  noon        | The sun is at its highest: it is {time}.

Good to know:


11. Welcome message

ModeBehavior
0Off
1Said once in the nearby chat, after the first visitor of the scene session arrives. Visitors who arrive later may not see it: mode 2 greets everybody
2 (delivered)Sent privately to each visitor on arrival

Events/Welcome Delay (s) is counted from the visitor's arrival, not from the scene start, so the message is not lost while the scene is still loading. 10 seconds suits most scenes; raise it for heavy scenes.

Delivered text:

Welcome! Here it is {date}. Our position on the globe: {location}. A full day lasts {daylength} in this world.

which gives:

Welcome! Here it is July 21. Our position on the globe: Paris in France (latitude 48.9 N). A full day lasts 4 hours in this world.

Another example:

Welcome to the harbour! Local time is {time}, sunset at {sunset}. The lamps switch on by themselves at nightfall.

In the welcome message {time} is the current time on the scene clock.


12. Adding the script to your own objects

The script MPP - Day Night V2.4.0 comes with the set, in your inventory. You can add it to your own objects, for example a second cloud layer, your own sky dome, or a sun of your own: in Build mode, drag the script from your inventory onto the object, choose its module in the second drop-down of the new script block (MPPDayNightSky, MPPDayNightSun or MPPDayNightControl), then enter its values. A new module starts with the built-in defaults of the script (last point below), not with the values of the set.


13. Recipes

A - Your city, today's season. In the Control: the values of your city from Appendix A, the day of the year from Appendix B, and your city's name in Geo/Place Name. That is the quick start of section 2.

B - Village with automatic lighting. Keep the delivered Actions A (sunset | mpp_lamp_all_on, sunrise | mpp_lamp_all_off) and put the MPP Light Switch Script (V1.5.1, Appendix C) on your lamps with External Events = On. Choose day 172 for long summer days.

C - Always-winter Nordic scene. In the Control: latitude 59.33, longitude 18.07, UTC offset 1, Clock Mode 2, day 355, place name Stockholm in Sweden. The sun rises late, stays low and sets early; lamps in list A follow these short days by themselves. For a polar night, use Tromso (Appendix A) and day 355.

D - Fixed hours whatever the season. Timeline/Auto From Geo = Off, then Manual starts 6, 8, 18, 20. morning, day, evening and night now mean 6:00, 8:00, 18:00 and 20:00 solar time all year; set Geo/Clock Mode = 0 if you want the clock to read these very hours.

E - Showroom demo. Keep the desk; set Buttons/Fast (minutes) to your liking and keep Chat/Cooldown = 4, so that a group of visitors cannot fight over the sun.

F - Solar clock. Geo/Clock Mode = 0: 12:00 is always the sun at its highest, noon reads 12:00 PM and every hour you type or read is on solar time.

G - Quick test of your schedule. Set the day length to 16 minutes, turn Debug/Verbose Logging On in the Control, visit, and open the script console: every sent event shows with its time on the scene clock, as events: 21:44 state #1 -> mpp_lamp_all_on.

H - A quiet scene. Delete the hourly announcement, set Events/Welcome Mode = 0, and turn Chat/Feedback Off.


14. Troubleshooting

SymptomCheck
Nothing movesDid you visit the scene? The scripts do not run in Build mode. The objects must keep Movable from Script
The sky turns in another direction than the sun, or the sun rises in the groundMPP Sun, MPP Sky or MPP Clouds was rotated on its own. Put it back as delivered; turn only the whole set, around the vertical axis
The sky or the clouds do not followSame General/Group on every module? The log warns when no Sun is heard after 10 s
Materials do not fadeMaterials must be scriptable. With Materials/Log Names On the log lists the found, driven and skipped names
Sunrise and sunset are one hour offCheck Geo/Clock Mode (summer time rule) and Geo/UTC Offset (the winter offset). Near a summer time switch the clock can be one hour off for up to 3 days (see section 15)
The sun is not at its highest at 12:00Normal with a legal clock: the sun culminates at solar noon (in Paris between 12:34 PM and 1:57 PM). noon and midnight follow the sun. Choose Clock Mode 0 for a solar clock
The welcome message names the wrong placeChange Geo/Place Name in the Control
The scene opens at nightCycle/Start Time is an hour on the scene clock: 4.5 is 4:30 AM, dawn in July in Paris. Set for example 9 for a morning start
The day length went back to 4 hoursThe Cycle speed button applies Buttons/Normal (minutes): set it to your day length in minutes
My place or my day changed by itselfA visitor clicked the City or Season button of the desk. Your settings come back when the scene restarts; delete these buttons to keep them
A button changed color but the sun did not moveYou clicked during the 4-second cooldown ("please wait"). The button still moved to its next state: wait a few seconds, then click on until the scene matches the button (Cycle speed and Season: two more clicks)
"[DayNight] please wait"The cooldown between two commands is running (Chat/Cooldown (s), 4 seconds, for everybody)
"Please wait 1 second before using this button again."The button's own cooldown (0.8 s, shared by all visitors): the same button was clicked again too fast. Nothing happened: click again
"You are not allowed to use this button."The button is set to Owner Only (or the visitor is not in its Access List)
Too many messages in the chatDelete the hourly announcement (section 10) or set Events/Welcome Mode = 0
Lamps do not reactOnly for lamps with MPP LightSwitch: the event name must be exactly the one the lamp listens to (examples 1 and 1b: V1.3 and V1.4 use different names, and group names are lowercase). External events enabled on the lamp? Turn Debug/Verbose Logging On in the Control to see what is sent and when
A line of a list is ignoredThe log says why: Events/Actions A entry #2 ignored: time 'sunst' not recognized
Lamps flip the wrong way after a restartA toggle event sits in list A. Use on / off events
A bell rings at every scene startIt is in list A. Move it to list B
No welcome messageEvents/Enable On? Mode 1 speaks once per scene session: rebuild or wait for the scene to restart. Raise the delay on heavy scenes
Light micro-flashes on the sun at very high frame ratesA Sansar client effect during the light fades: limit Max Foreground FPS to 60-72 in the client settings
Values changed after an updateWrite your values down before updating a script. A value can come back at its default when a setting of the new version changed its form (for example, it became a slider). Enter it again

15. Limits


Appendix A - 40 cities

Type these values in the Control, Geo group, and the city name in Geo/Place Name if you like. Geo/Use Geographic Model must be On.

CityLatitudeLongitudeUTC OffsetClock Mode
Europe
Paris (France)48.862.3512
London (UK)51.51-0.1302
Madrid (Spain)40.42-3.7012
Rome (Italy)41.9012.5012
Berlin (Germany)52.5213.4112
Amsterdam (Netherlands)52.374.9012
Stockholm (Sweden)59.3318.0712
Athens (Greece)37.9823.7322
Istanbul (Turkey)41.0128.9831
Moscow (Russia)55.7637.6231
Reykjavik (Iceland)64.15-21.9401
Tromso (Norway)69.6518.9612
Americas
New York (USA)40.71-74.01-53
Los Angeles (USA)34.05-118.24-83
Chicago (USA)41.88-87.63-63
Toronto (Canada)43.65-79.38-53
Vancouver (Canada)49.28-123.12-71
Anchorage (USA)61.22-149.90-93
Honolulu (USA)21.31-157.86-101
Mexico City (Mexico)19.43-99.13-61
Bogota (Colombia)4.71-74.07-51
Lima (Peru)-12.05-77.04-51
Rio de Janeiro (Brazil)-22.91-43.17-31
Buenos Aires (Argentina)-34.60-58.38-31
Africa and Middle East
Dubai (UAE)25.2055.2741
Lagos (Nigeria)6.523.3811
Nairobi (Kenya)-1.2936.8231
Johannesburg (South Africa)-26.2028.0521
Cape Town (South Africa)-33.9218.4221
Asia
Tokyo (Japan)35.68139.6591
Seoul (South Korea)37.57126.9891
Beijing (China)39.90116.4181
Shanghai (China)31.23121.4781
Hong Kong (China)22.32114.1781
Singapore1.35103.8281
Bangkok (Thailand)13.76100.5071
Mumbai (India)19.0872.885.51
Delhi (India)28.6177.215.51
Oceania
Sydney (Australia)-33.87151.21104
Melbourne (Australia)-37.81144.96104

Checked for the year 2027 against the official times (NOAA algorithm, real time zone rules): sunrise and sunset within 2 minutes, except on up to 3 days around each summer time switch (6 days a year at most), and for Tromso (see below).


Appendix B - 20 dates

Type the day number in Geo/Day Of Year. The calendar has 365 days and no year.

DateDayDay Of Year
New Year's DayJanuary 11
Valentine's DayFebruary 1445
Chinese New Year (2026 date, moves every year)February 1748
St Patrick's DayMarch 1776
Spring equinoxMarch 2079
Easter (2026 date, moves every year)April 595
May DayMay 1121
Summer solstice, Fete de la MusiqueJune 21172
Midsummer (St John's Day)June 24175
Independence Day (USA)July 4185
Bastille Day (France)July 14195
Autumn equinoxSeptember 23266
HalloweenOctober 31304
Day of the Dead (Mexico)November 2306
Thanksgiving (USA, 2026 date, moves every year)November 26330
Festival of Lights (Lyon)December 8342
Winter solsticeDecember 21355
Christmas EveDecember 24358
Christmas DayDecember 25359
New Year's EveDecember 31365

Easter, Chinese New Year and Thanksgiving move every year: the table gives their 2026 date. For another year, count the day number from January 1 (January 31 = 31, February 28 = 59, March 31 = 90, April 30 = 120, May 31 = 151, June 30 = 181, July 31 = 212, August 31 = 243, September 30 = 273, October 31 = 304, November 30 = 334).


Other MPP creations on the Sansar Store that work with this set:

ItemWhat it addsStore page
Light Switch Script (V1.5.1)Lamps and emissive materials switched on and off with smooth transitions, by click, chat or script events. Compatible as is with the scheduler: the delivered Actions A lines switch these lamps on at sunset and off at sunrise (section 9)https://www.sansar.com/store/listings/7379d48c-2b6f-45f6-b6f1-205ce95aec1c/light-switch-script
Action Button Script (V1.7.0)The script of the Commands Desk buttons: turn any object into a button or build your own control panel with the command texts of section 8. One to four commands per button, color and glow for each state, owner-only access with allowed or blocked avatars, and a private "please wait" noticehttps://www.sansar.com/store/listings/3e1a3546-6c79-4527-bc1e-78d02648d19e/action-button-script
Commands Help On Chat Script (V1.3.8)A visitor greeter and a help display for the nearby chat, triggered by a chat command or by a button: list your scene commands, /daynight ones includedhttps://www.sansar.com/store/listings/fea2df6b-21ce-48eb-94fc-4b7a7aad2777/commands-help-on-chat-script
Neutral Skybox - Seamless HDRIA seamless 360-degree HDRI skybox with a soft neutral blue gradient and a clean horizon: a calm backdrop for the sky of your scenehttps://www.sansar.com/store/listings/dbd41290-32e4-4255-adfa-fe35bcf2b521/neutral-skybox-seamless-hdri

MPP - My Pretty Pixels. Day and Night Sky Cycle V2.4 (script MPP - Day Night V2.4.0).

↑