How to integrate and communicate with the Sun and Light.
In nanos world, we allow the greatest possible customization to be made on your servers and packages. And to make it even easier, we've included some built-in functions in the game which helps integrating and customizing your Servers.
A very important concept in nanos world is the Sun. We provide some methods on World class which allows the scripters to, in few lines of codes, modify the current Time of Day, Sun Speed, Environment Colors and even change the Weather and Fog.
For the methods of interaction with the Sun exposed in the World to work, it is necessary that your Map is loaded with a sun that our API can identify it, and for that to be possible, we created the method
Spawning the Default Sun
Once you run the method
World.SpawnDefaultSun(), the game will destroy all (Unreal) Actors with the tag
Sun and will spawn a brand new Actor which contains a
Clouds and some others components which you will be able to control with World methods.
Because of that it is important to set all your Actors with
Sun tag when creating Maps!
Sometimes if you use
SpawnDefaultSun() in some maps, you may notice you will end up with two Directional or Sky Lights, this means the Map wasn't configured with the
Interacting with the Sun
It is possible to change Several aspects and settings from the Sun.
All methods available for customizing the Sun are listed in World Static Class page.
Some examples of methods are
World.SetTime(hours, minutes) or
World.SetFogDensity(density) which will change the current Time and the Fog, respectively.
We provide some basic methods to change the Weather of the World. You can use the method
World.SetWeather() to select from a predefined selection of Weathers, or create your own Weather using all the methods the World provides.
|Weather Type||Sun Intensity||Fog Second Density||Fog Height Falloff||Sun Light Color||Sky Rayleigh Scattering||Sun Temp. Multi.||Sky Light Intensity||Wind|