The SkyDome entity will place a large dome around the level that mimics the sky. Clouds will appear and the sun and moon will move across the sky. Terrain is used to fill in the area from the edge of your level out to the SkyDome itself. Since the dome and terrain are outside your level you do not interact with them in any way.
To add a SkyDome to your level place a SkyDome entity anywhere in the level and set the Enable entry to true. If you want to use other values than the default you must use a script. The name of the script is placed in ScriptName. The script must be in the Scripts directory. When the SkyDome is created the order whose name is in the InitOrder entry is executed to allow you to initialize the SkyDome values. This is the only time this order is executed. When the level starts to run the order whose name is in the StartOrder entry is run to allow changing features at runtime.
Use the SetHeightOrigin command to move the terrain down so it is underneath the lowest point of your level. When making the heightmap for the terrain try to not have any point of the terrain rise up above the lowest point of the level or rendering artifacts may occur. A terrain heightmap called flat.bmp is available that will create a perfectly flat terrain.
The SkyDome script commands are broken down into 3 categories.
Category 1 are commands that can only be used in the Initialization order. These are used to setup the SkyDome and will have no effect if used outside the Initialization order.
SetTerrain(string heightmap, string texture); |
Define the grayscale bitmap used to
generate the terrain and define the texture used on this terrain. The heightmap is a 8 bit grayscale bmp file
that defines the height of the terrain at each pixel point. The height is measured in texels and ranges from
a low of 0 to a high of 255. The heightmap should be square and a power of 2 in size to ensure that it works
correctly. The texture is a normal bmp file that is used to texture the polys that make up the terrain.   |
SetVertScale(float scale); |
Set the scale that is used as a
multiplier for the height of each point in the heightmap. Default is 1.   |
SetLandscapeSize(int width); |
Set the width and depth of the terrain
and the skydome. This must be large enough to cover your level. Default is 4096.   |
SetHorizScale(float scale); |
Set the scale used as a multiplier for
the landscape width and depth. Default is 4.   |
SetHeightOrigin(int height); |
Set the base origin of the terrain in the
Y axis. By default the lowest point of the terrain is set to 0 in the Y axis.
This location can be changed up or down so the terrain is underneath your level.
Default is 0.   |
SetDesiredTriangles(int value); |
Set the number of triangles used when
creating the terrain or the skydome. A larger number gives more detail but at
the cost of rendering speed. Default is 500.   |
SetTwilightDistanceFromHorizon(float distance); |
Distance (percent of zenith) above and
below horizon for twilight activation. Default is 0.4.   |
SetSkyDome(int height, float resolution); |
Define the height and the resolution of
the skydome. The height is the number of texels from the base origin of the
terrain to the highest point of the skydome. Default is 400. The resolution is
the number of polys used along each side of the dome.A larger number gives more
detail but at the cost of rendering speed. Default is 32.   |
SetSkyTexture(string texture); |
Define the bmp file used to texture the
skydome.   |
DisableSun(bool Flag); |
If Flag is true then the Sun, Moon and
Stars are disabled and will not appear as part of the SkyDome.   |
SetSunScale(float scale); |
Set the scale for the size of the sun.
Default is 4.   |
SetDistanceFromSunFactor(float distance); |
Set the distance from the sky (or
terrain) poly and the sun at which the light reflection is 1.0 (on a scale of
0-1.0). Default is 900.   |
SetMoonColor(float red, float green, float blue, float alpha); |
Set the color used for the moon. Default
is (255, 255, 255, 255).   |
SetMoonPhase(int phase); |
Set the phase of the moon where the phase
value corresponds to: 0 - new moon 1 - quarter waxing 2 - full 3 - quarter waning Default is a full moon.   |
DisableCloud(bool Flag); |
If Flag is true then clouds are disabled
and will not appear in the level.   |
SetLocation(float latitude, int month, int day, int hour); |
Set the location of the player and the
starting time of the level. The skydome will reflect this information. The
latitude is positive if north of the equator and negative if south. Month is 1
to 12, day is 1 to 31 and hour is 0 to 23. Default is 49, 10, 24, 12.   |
Category 2 are commands that are used during the game to modify aspects of the SkyDome.
self.think |
A variable that is set to the name of the
order that is to be executed the next time the SkyDome script is run.   |
self.time |
A variable that contains the number of
seconds since the SkyDome was initialized. This is used as an elapsed time
counter.   |
self.daytime |
A variable that contains the number
seconds since midnight of the current day.   |
Category 3 are commands that can be used during initialization or during the game and will have an effect at any time.
SetWindDirection(string direction); |
Set the direction that the wind is
blowing. This affects the direction that clouds move. The valid directions are: "north" "northeast" "northwest" "south" "southeast" "southwest" "east" "west"   |
SetTimeScale(float scale); |
Set the multiplier for the passing of
time in the level. This affects the speed of movement of the Sun, Moon and
Starts. If the scale value is 10 then time passes at a rate of 6 minutes per
hour.   |
RenderWireframe(bool Flag); |
If Flag is true then the SkyDome and
terrain will be rendered in wireframe mode.   |
RenderLandscape(bool Flag); |
If Flag is false then the Landscape
will not be rendered.   |
SetSunColor(float red, float green, float blue, float alpha); |
Set the color used for the sun. Default
is (255, 128, 0, 255).   |
SetSkyColor(float red, float green, float blue, float alpha); |
Set the color used as lighting for the
skydome. Default is (164, 200, 255, 255).   |
SetTwilightColor(float red, float green, float blue, float alpha); |
Set the color used as lighting for the
twilight at dawn and dusk. Default is (255, 0, 0, 255).   |
SetAmbientLightColor(float red, float green, float blue, float alpha); |
Set the color used as lighting for the
terrain. Default is (255, 255, 255, 255).   |
UseSkyFog(bool Flag); |
If Flag is true then color the level's
distance fog the same color as the sky.   |
ToggleMoveWithCamera(); |
whether to move the skydome with the camera or not   |