Names of the animations are as follows:
ORTS_2DEXTERNALLEFTWINDOW
ORTS_2DEXTERNALRIGHTTWINDOW
for the window animations as seen from within a 2D cab; the same names are valid for front and rear cab. Left and right are considered as seen from the related cab.
ORTS_EXTERNALLEFTWINDOWFRONT
ORTS_EXTERNALRIGHTWINDOWFRONT
ORTS_EXTERNALLEFTWINDOWREAR
ORTS_EXTERNALRIGHTWINDOWREAR
for the window animations as seen from within a 3D cab; Left and right are considered as seen in the forward direction of the first cab. The convention difference between 2D and 3D cabs is due to the difference in the handling of the cabs. NOTE: these 4 controls are not needed in the .cvf file (same applies also for wipers, doors and so on as seen from within a 3D cab).
LEFTWINDOWFRONT
RIGHTWINDOWFRONT
LEFTWINDOWREAR
RIGHTWINDOWREAR
for the window animations as seen from the external camera views. In case of carriages, only the first two apply.
LEFTWINDOW and RIGHTWINDOW are the names of the controls that can be inserted in the .cvf file and in the 3Dcab .s file to command the state change with the mouse.
Here is what I added to the .cvf file for the animation shown in the YouTube video.
ORTSCabViewControls
( 1
ORTSAnimatedDisplay (
Type ( ORTS_2DEXTERNALLEFTWINDOW MULTI_STATE_DISPLAY )
Position ( 101 69 235 365 )
Graphic ( ../../Common.Cab/CabE464/FinestraSX.ace )
ORTSCycleTime ( 0.6 )
States ( 16 4 4
State (
Style ( 0 )
SwitchVal ( 0 )
)
State (
Style ( 0 )
SwitchVal ( 0.0625 )
)
State (
Style ( 0 )
SwitchVal ( 0.125 )
)
State (
Style ( 0 )
SwitchVal ( 0.1875 )
)
State (
Style ( 0 )
SwitchVal ( 0.25 )
)
State (
Style ( 0 )
SwitchVal ( 0.3125 )
)
State (
Style ( 0 )
SwitchVal ( 0.375 )
)
State (
Style ( 0 )
SwitchVal ( 0.4375 )
)
State (
Style ( 0 )
SwitchVal ( 0.5 )
)
State (
Style ( 0 )
SwitchVal ( 0.5625 )
)
State (
Style ( 0 )
SwitchVal ( 0.625 )
)
State (
Style ( 0 )
SwitchVal ( 0.6875 )
)
State (
Style ( 0 )
SwitchVal ( 0.75 )
)
State (
Style ( 0 )
SwitchVal ( 0.825 )
)
State (
Style ( 0 )
SwitchVal ( 0.88 )
)
State (
Style ( 0 )
SwitchVal ( 0.94 )
)
)
ORTSCabviewpoint ( 1 )
)
)
FinestraSX.ace contains the various frames, from window fully close to window fully open. ORTSCycleTime means that the opening/closing time of the window is 0.6 seconds. If one wants to use higher times, more frames are needed to get a smooth animation. Note that the control is within the ORTSCabviewControls block, which is skipped by MSTS and older OR versions to avoid error messages, and note that the ORTSCabviewpoint ( 1 ) line specifies that that animation is in the left cabview.
A simple control block to move a window by clicking the mouse can be as follows:
TwoState (
Type ( ORTS_LEFTWINDOW TWO_STATE )
Position ( 120 425 30 21 )
Graphic ( cab.ace )
NumFrames ( 2 2 1 )
Style ( ONOFF )
MouseControl ( 1 )
)
If there is no specific window control in the real cab, you can locate this control on the window itself, using a transparent graphic. So, clicking on the window, you change its state. This is how Geoff did this. It can also be applied for 2Dcab windows.