Day/Night Cycle From Local Time
This system is for campaign maps and used in my missions.
It is probably the only way to use your own system time for the lighting in-game. Day/Night isn’t something new, you can have different times based on Elapsed Time events with Blend from one lighting to another. Years ago I felt like making the lighting based on my local time. So, if it is evening, I liked if entering the map, also to be evening. I didn’t know how to do that, since triggers cannot use your Windows system time.
What use does it have?
It is mostly for offline play, unless you find use to implement it online per player for various environment reasons.
Besides using it as a way to play different time of the day based on your time, so it feels more immersive, this is also a proper application of resources I submitted last year. Switching the Skybox model in-game distorted the texture mapping and it did not look well, so I had to use a Doodad of the Skybox to TextureSelectById the Skybox to the day and night version. Now, the day, sunset, night Skyboxes also change along with the light based on your local time of the day. There are 3 Skyboxes for the city, though, the lights are more.
I use them for Korhal, and I know one would say it would not be necessarily behaving like Earth around the Sun. Still, I think the concept of Korhal is that of a planet in the habitable zone with environment similar to that of the Earth.
- Lights to use based on your local time
- Different times of changing the light based on a season
- Opportunity to have a constant light in one place, while the Day/Night changes outside (some lights cover the whole map, only in 3 lights more than one region is used - at Sunset, Dusk and Night you will see the other region)
Update (August 2018), Final
- Added blending between the current and the next light for around 10 minutes (14 game time mins) before the next light starts. The definition can be run often with Periodic Event or other that launches it often, if one wants the light really to change over time than only on game start based on the system day time.
- Added dusk to switch from night to that one before sunrise.
- The sky changes during the time of blending as well.
Update with Patch 4.4.0
- The use of external utility to 'inject' a bank file with system time is no longer needed thanks to the natives added with Patch 4.4.0 and the workarounds have been removed!
- The use of Bank for this system no longer needed
- Although the natives allow you to set light based on Morning/Afternoon/Evening, the system retained its more complex state based on season and more than 3 lights of the day
- Season is no longer manually added due to being 'rarely changed', now it is read every time by the N calendar days since January 1st
- All hours and minutes are not read from a bank but directly from the system/server time at each load
How to use
- Copy the EnvironmentOfPlanet action definition and variable set to some skybox doodad and apply to your map's actions, link the correct lights if not using the same that are included.