@@ -1234,6 +1234,181 @@ ENG or WAG file::
12341234 )
12351235
12361236
1237+ .. _features-windows :
1238+
1239+ Trainset windows
1240+ ================
1241+
1242+
1243+ Left and right 2D- or 3D-cab windows can be animated, showing the animation both in cabview and in
1244+ external views. For locomotives also two windows for the rear cab can be defined.
1245+
1246+ The external sounds and the track sound are reproduced unattenuated with open window.
1247+ To have a volume difference, two lines as follows must be added to the wagon section of the .eng or .wag file::
1248+
1249+ ORTSExternalSoundPassedThroughPercent ( 30 )
1250+ ORTSTrackSoundPassedThroughPercent ( 25 )
1251+
1252+ Numbers in parenthesis may vary from 0 (no sound heard internally) to 100 (sound heard unattenuated).
1253+ Note that, if these two lines aren't added, but audio option "% of external sound heard internally" is set
1254+ to a value lower than 100, the above effect will be still available with external sounds, but not with
1255+ the track sound.
1256+
1257+ Keyboard commands to toggle window state are listed :ref: `here <driving-anim-commands >` .
1258+
1259+ Names of the animations are as follows.
1260+
1261+ Names for the windows animations as seen from the external camera views (the ones to be inserted in the .s
1262+ file of the trainset) must start with following strings::
1263+
1264+ LEFTWINDOWFRONT
1265+ RIGHTWINDOWFRONT
1266+ LEFTWINDOWREAR
1267+ RIGHTWINDOWREAR
1268+
1269+ In case of carriages, only the first two apply.
1270+
1271+ Names for the windows animations as seen from within a 2D cab (same names are valid for
1272+ front and rear cab); left and right are considered as seen from the related cab::
1273+
1274+ ORTS_2DEXTERNALLEFTWINDOW
1275+ ORTS_2DEXTERNALRIGHTTWINDOW
1276+
1277+ Note that in general the lateral windows will be located in the side views of the 2D cab.
1278+ Therefore the related control blocks in the .cvf file will have to be located as described
1279+ :ref: `here <cabs-side-views >` .
1280+
1281+ Names for the window animations as seen from within a 3D cab (the ones to be inserted in the .s
1282+ file of the 3D cab); Left and right are considered
1283+ as seen in the forward direction of the first cab. The convention difference between 2D and
1284+ 3D cabs is due to the difference in the handling of the cabs. NOTE: these 4 controls are not
1285+ needed in the .cvf file (same applies also for wipers, doors and so on as seen from within a
1286+ 3D cab)::
1287+
1288+ ORTS_EXTERNALLEFTWINDOWFRONT
1289+ ORTS_EXTERNALRIGHTWINDOWFRONT
1290+ ORTS_EXTERNALLEFTWINDOWREAR
1291+ ORTS_EXTERNALRIGHTWINDOWREAR
1292+
1293+ LEFTWINDOW and RIGHTWINDOW are the names of the controls that can be inserted in the
1294+ .cvf file and in the 3Dcab .s file to command the state change with the mouse.
1295+
1296+ Here is an example of the animation of the left window in a 2D cab::
1297+
1298+ ORTSCabViewControls
1299+ ( 1
1300+ ORTSAnimatedDisplay (
1301+ Type ( ORTS_2DEXTERNALLEFTWINDOW MULTI_STATE_DISPLAY )
1302+ Position ( 101 69 235 365 )
1303+ Graphic ( ../../Common.Cab/CabE464/FinestraSX.ace )
1304+ ORTSCycleTime ( 0.6 )
1305+ States ( 16 4 4
1306+ State (
1307+ Style ( 0 )
1308+ SwitchVal ( 0 )
1309+ )
1310+ State (
1311+ Style ( 0 )
1312+ SwitchVal ( 0.0625 )
1313+ )
1314+ State (
1315+ Style ( 0 )
1316+ SwitchVal ( 0.125 )
1317+ )
1318+ State (
1319+ Style ( 0 )
1320+ SwitchVal ( 0.1875 )
1321+ )
1322+ State (
1323+ Style ( 0 )
1324+ SwitchVal ( 0.25 )
1325+ )
1326+ State (
1327+ Style ( 0 )
1328+ SwitchVal ( 0.3125 )
1329+ )
1330+ State (
1331+ Style ( 0 )
1332+ SwitchVal ( 0.375 )
1333+ )
1334+ State (
1335+ Style ( 0 )
1336+ SwitchVal ( 0.4375 )
1337+ )
1338+ State (
1339+ Style ( 0 )
1340+ SwitchVal ( 0.5 )
1341+ )
1342+ State (
1343+ Style ( 0 )
1344+ SwitchVal ( 0.5625 )
1345+ )
1346+ State (
1347+ Style ( 0 )
1348+ SwitchVal ( 0.625 )
1349+ )
1350+ State (
1351+ Style ( 0 )
1352+ SwitchVal ( 0.6875 )
1353+ )
1354+ State (
1355+ Style ( 0 )
1356+ SwitchVal ( 0.75 )
1357+ )
1358+ State (
1359+ Style ( 0 )
1360+ SwitchVal ( 0.825 )
1361+ )
1362+ State (
1363+ Style ( 0 )
1364+ SwitchVal ( 0.88 )
1365+ )
1366+ State (
1367+ Style ( 0 )
1368+ SwitchVal ( 0.94 )
1369+ )
1370+ )
1371+ ORTSCabviewpoint ( 1 )
1372+ )
1373+ )
1374+
1375+ FinestraSX.ace contains the various frames, from window fully close to window fully open.
1376+ ORTSCycleTime means that the opening/closing time of the window is 0.6 seconds. If one wants to use higher times,
1377+ more frames are needed to get a smooth animation. Note that, as explained above,
1378+ the control is within the ORTSCabviewControls block, which is skipped by MSTS and older OR versions to avoid
1379+ error messages, and note that the ORTSCabviewpoint ( 1 ) line specifies that that animation is in the left cabview.
1380+
1381+ A simple control block to move a window by clicking the mouse can be as follows::
1382+
1383+ TwoState (
1384+ Type ( ORTS_LEFTWINDOW TWO_STATE )
1385+ Position ( 120 425 30 21 )
1386+ Graphic ( cab.ace )
1387+ NumFrames ( 2 2 1 )
1388+ Style ( ONOFF )
1389+ MouseControl ( 1 )
1390+ )
1391+
1392+ If there is no specific window control in the real cab, you can locate this control on the window itself,
1393+ using a transparent graphic. So, clicking on the window, you change its state. This can be applied
1394+ both to 2D and 3D cabs.
1395+
1396+ Sound triggers for windows animation are listed :ref: `here <sound-windows >` .
1397+
1398+ Specifics for carriage window animations
1399+ ----------------------------------------
1400+
1401+ One window to the left and one window to the right of the carriage may be animated.
1402+ They can be opened and closed only via keyboard (Ctrl-Q for left window and
1403+ Ctrl-Shift-Q for right window, as for locomotives).
1404+
1405+ Note that the carriage must have only the main shape file (no passenger view shape file).
1406+ This main shape file can include also the inside structure of the carriage; note that when
1407+ a .wag or .eng file has an Inside block defined, and such block doesn't include a line
1408+ specifying the .s file, OR will use the main shape file to display the
1409+ inside. So such shape file will display the window animation both with
1410+ the passenger camera (inside view) and with the external cameras (outside views).
1411+
12371412C# engine scripting
12381413===================
12391414.. _features-scripting-csharp :
0 commit comments