ok
The skysystem work with an information file ( .txt format ) that give the names of the textures to use for the system.
File is like this :
Quote: "
X4 RealTime-SkyBox Definition
CIEL:
BleuCiel.bmp
NUAGES:
Ciel1.bmp
ETOILES:
cieletoile.bmp
SOLEIL:
soleil.bmp
LUNE:
lune.bmp
HALOLEVER:
lever.bmp
HALOCOUCHER:
coucher.bmp
AURORE:
crepuscule.bmp
BACKGROUND:
villeriche.bmp
GROUND:
ground.bmp
ENDOFRSD
"
with this file all textures are defined.
The command :
RTS Setup Skybox "RTS_BigCity", 0
Initialize the skysystem.
This sample will load the file RTS_BigCity.x4r and extract the textures file names from it and will open them from a drawer with the same name (ie : RTS_BigCity )
The flag 0 mean that Camera 0 is the main game camera view.
Here are the Real-Time Skysystem control commands :
RTS Set Clock 4 , 0 , 1.0
RTS Set Wind Speed 0.0001, 0.00005
RTS Fog On
RTS Fog Color 76, 82, 64
RTS Fog Distance 2000
RTS Set Clock HOUR, MINUTES, TIMEEXPANSION :
Will define the hour, minutes and time speed.
RTS Set wind Speed X#, Z# :
Will define the wind applied to the clouds.
RTS Fog On :
Will make the Real-Time SkySystem control fog and ambient light.
( RTS For Off will disable this function and user can control fog and ambient light )
RTS Fog Color :
Allow to define the fog color in full day illumination at 12 o'clock.
(it will be darker at 0 O'clock
full night)
RTS Fog Distance :
will define the fog distance in full day illumination at 12 o'clock.(it will be smaller at 0 O'clock
full night)
After this, you'll simply have to call the command just before the "Sync" command :
RTS Update Skybox
This command will update the skysystem.
There are also command to receive the actual day, hour, minutes of the day
and know the 3D Objects used for sky components to allow user to apply changes by himself if he want.
Here is the list of all Real-Time Sky System commands :
RTS Set Clock Hour, Minutes, TimeExpansion As Float
=
RTS Get Day()
=
RTS Get Hour()
=
RTS Get Minutes()
=
RTS Get Seconds()
RTS Set Wind Speed XSpeed As Float, ZSpeed As Float
RTS Clear Skybox
RTS Setup Skybox SkyBoxFile$, CameraMode
RTS Update Skybox
RTS Fog On
RTS Fog Off
RTS Fog Distance Distance As Float
RTS Fog Color Red, Green, Blue
=
RTS Get Loaded Object( ObjectID[0-10] )
Sky system is really simple to use.
Here is the source code for the Real-Time Sky System demo that will be available with the plugin :
Sync On : Sync Rate 0
Color Backdrop 0
Fog On
Rem Choose which Sky Set use ?
Repeat
Cls 0 : Set Cursor 0,0 : Ink Rgb( 255, 255, 255 ), 0
Print "Real Time SkySystem Ver1.0 by Frederic Cordier (c)2006"
Print "Select which skysystem you want to see :"
Print "1 = Big city - polluted"
Print "2 = Snow mountains - Big blue"
Print "3 = Massive mountains - no comments"
Print "4 = Test Sky System"
Sync
Input Choice
Until Choice > 0 and Choice < 5
Rem Setup the choosen Sky Set
Select Choice
Case 1 : RTS Setup Skybox "RTS_BigCity", 0 : EndCase
Case 2 : RTS Setup Skybox "RTS_SnowMountain", 0 : EndCase
Case 3 : RTS Setup Skybox "RTS_MassiveMountain", 0 : EndCase
Case 4 : RTS Setup Skybox "RTS_Devel", 0 : EndCase
EndSelect
Rem Define hour, minutes and the time speed.
RTS Set Clock 4 , 0 , 1.0
Rem Wind to apply on clouds.
RTS Set Wind Speed 0.0001, 0.00005
Rem Leave the Real-Time Sky System control the fog and ambient light
RTS Fog On
RTS Fog Color 76, 82, 64
RTS Fog Distance 2000
Rem Need a big camera range in camera mode for Camera overlapping mode [Sky System Camera] Camera 0 does not need such a big range.
Set Camera Range 1 , 30000
Rem Game Camera setup
Clear Camera View 0 , Rgb( 0 , 0 , 0 )
Position Camera 0 , 0 , 0
Rem Main Loop
repeat
Rem Display some informations on screen.
Set Cursor 0 , 0
Print "Frame Rate : " , Screen Fps()
Print "View : " , XAngle , " / " , YAngle
Print "Real Time Hour : " , RTS Get Hour() , "h" , RTS Get Minutes() , "m" , RTS Get Seconds() , "s"
Set Current Camera 0
Rem Move the game camera.
XAngle = WrapValue( XAngle + UpKey() - DownKey() )
YAngle = WrapValue( YAngle + RightKey() - LeftKey() )
Rotate Camera XAngle , YAngle , 0
MOVEFORWARD = -( ( MouseClick() = 1 ) - ( MouseClick() = 2 ) ) * 6
If MOVEFORWARD <> 0 Then Move Camera MOVEFORWARD
Position Camera Camera Position X(), 0, Camera Position Z()
Rem Update the Real-Time Sky System
RTS Update Skybox
Rem Synchro
Sync
Until SpaceKey() = 1
RTS Clear Skybox
End
All we have to decide is what to do with the time that is given to us.