Managing multiple screen pages on a display in 2D and 3D cabs
#31
Posted 12 September 2022 - 12:01 AM
#32
Posted 18 September 2022 - 11:39 AM
I understood where my problem comes from. when I pressed the key, unconsciously I wanted to display 2 different screen names at the same time, whereas only one can be displayed.
Will we be able to display several at the same time in the future? Now I managed to make the 2 screens work together, but it takes a bit of fiddling and concessions.
but if we could display several screens at the same time on several systems, that would be a new advance.
Thank you very much Carlo for all these new features that you bring to ORTS.
Good evening
#33
Posted 24 October 2022 - 10:29 AM
Question. I suppose it is possible to use this function to change the screen of a monitor that is used in reality to show the various cameras inside the train that allow the driver to "keep an eye" on the passengers.
In other words, they are simply static screens that can be changed by pressing one or more buttons. But it is not at all clear to me how to implement something so simple, with its own dedicated controls in the 3d cab. I don't know if it's possible to put some code to show how it would work.
Thanks!
#34
Posted 25 October 2022 - 04:53 AM
#35
Posted 26 October 2022 - 02:49 PM
So far I have managed to get the ORTS_ITEM2STATE to turn the monitor screen on and off.
Not bad, but it would be more interesting if at least 2 different images could be displayed on the screen...
#36
Posted 27 October 2022 - 01:33 AM
My question is: what do you want the OR player to do, to pass from one picture to the other and vice-versa?
#37
Posted 27 October 2022 - 09:17 AM
Csantucci, on 27 October 2022 - 01:33 AM, said:
My question is: what do you want the OR player to do, to pass from one picture to the other and vice-versa?
For example, by pressing the same button, you can change the image.
1st press: the screen "turns on" and the 1st image is displayed.
2nd press: the 2nd image is shown.
3rd press: the screen turns off again.
This is an idea to simulate a closed-circuit television with 2 cameras inside the vehicle.
#38
Posted 28 October 2022 - 12:16 PM
TwoState ( Type ( ORTS_SCREEN_SELECT ) Position ( 80 60 24 22 ) Graphic ( AlerterLeft.ace ) NumFrames ( 2 2 1 ) Style ( WHILE_PRESSED ) MouseControl ( 1 ) ORTSNewScreenPage ( "camera1on" ) ORTSScreenPage ( "default" ) ORTSScreenPage ( "cameraoff" ) ORTSLabel ( "camera1gotoon" ) ) TwoState ( Type ( ORTS_SCREEN_SELECT ) Position ( 80 60 24 22 ) Graphic ( AlerterLeft.ace ) NumFrames ( 2 2 1 ) Style ( WHILE_PRESSED ) MouseControl ( 1 ) ORTSNewScreenPage ( "camera2on" ) ORTSScreenPage ( "camera1on" ) ORTSLabel ( "camera2gotoon" ) ) TwoState ( Type ( ORTS_SCREEN_SELECT ) Position ( 80 60 24 22 ) Graphic ( AlerterLeft.ace ) NumFrames ( 2 2 1 ) Style ( WHILE_PRESSED ) MouseControl ( 1 ) ORTSNewScreenPage ( "cameraoff" ) ORTSScreenPage ( "camera2on" ) ORTSLabel ( "cameragotooff" ) ) MultiStateDisplay ( Type ( ORTS_STATIC_DISPLAY MULTI_STATE_DISPLAY ) Position ( 246 180 105 16 ) Graphic ( ReverserDisplayCompound.ace ) States ( 1 1 1 State ( Style ( 0 ) SwitchVal ( 0 ) ) ) ORTSScreenPage ( "camera1on" ) ) MultiStateDisplay ( Type ( ORTS_STATIC_DISPLAY MULTI_STATE_DISPLAY ) Position ( 246 180 105 16 ) Graphic ( Horn.ace ) States ( 1 1 1 State ( Style ( 0 ) SwitchVal ( 0 ) ) ) ORTSScreenPage ( "camera2on" ) )
The static displays camera1on and camera2on are what you would show on your display (I used two standard aces to test). The three ORTS_SCREEN_SELECT controls are enabled one after the other, in circular way. You might use .aces of different colour for these three controls (or even different aces).
These controls implement the sequence you desire.
You may add any number of further camera views for this. Any further camera requires an ORTS_STATIC_DISPLAY block and an ORTS_SCREEN_SELECT control.
#39
Posted 29 October 2022 - 09:44 AM
This is the kind of precise answers that we developers like!
As soon as I have a free moment I'll try it and I'll comment here...
Thanks!
#40
Posted 01 November 2022 - 02:15 PM
I'll try to explain as best I can.
The idea is to be able to change the screens on a monitor located within sight of the driver. In the image, you can see the "device" showing on its lit screen, the view of one of the cameras located inside the vehicle to "watch" its passengers (although it is now empty):
With ORTS_ITEM2TWOSTATE:0:0 and ORTS_GENERIC_ITEM2:0, I can make it show a single screen. When the GENERIC_ITEM2 "switch" is pressed, the plane that is hidden inside the screen moves and at the same time, ORTS_ITEM2TWOSTATE:0:1, which is the power-on pilot also appears (not present in the image). When it swicht is pressed again, the display and the pilot disappears inside the monitor.
Well, the idea of using ORTS_STATIC_DISPLAY is, besides freeing ORTS_ITEM2TWOSTATE to use it in another element of the cockpit, for the possibility of displaying several cameras (screens) on the monitor. This is the code of what is now in the .cvf file:
20 TwoState ( 21 Type ( ORTS_SCREEN_SELECT ) 22 Position ( 80 60 24 22 ) 23 Graphic ("trans.ace") 24 NumFrames ( 2 2 1 ) 25 Style ( WHILE_PRESSED ) 26 MouseControl ( 1 ) 27 ORTSNewScreenPage ("camera1on") 28 ORTSScreenPage ("default") 29 ORTSScreenPage ("cameraoff") 30 ORTSLabel ("CAMARA 1 ON") 31 ) 32 TwoState ( 33 Type ( ORTS_SCREEN_SELECT ) 34 Position ( 80 60 24 22 ) 35 Graphic ("trans.ace") 36 NumFrames ( 2 2 1 ) 37 Style ( WHILE_PRESSED ) 38 MouseControl ( 1 ) 39 ORTSNewScreenPage ("camera2on") 40 ORTSScreenPage ("camera1on") 41 ORTSLabel ("CAMARA 2 ON") 42 ) 43 TwoState ( 44 Type ( ORTS_SCREEN_SELECT ) 45 Position ( 80 60 24 22 ) 46 Graphic ("trans.ace") 47 NumFrames ( 2 2 1 ) 48 Style ( WHILE_PRESSED ) 49 MouseControl ( 1 ) 50 ORTSNewScreenPage ("cameraoff") 51 ORTSScreenPage ("camera2on") 52 ORTSLabel ("MONITOR OFF") 53 ) 54 MultiStateDisplay ( 55 Type ( ORTS_STATIC_DISPLAY MULTI_STATE_DISPLAY ) 56 Position ( 246 180 105 16 ) 57 Graphic ("trans.ace") 58 States ( 1 1 1 59 State ( 60 Style ( 0 ) 61 SwitchVal ( 0 ) 62 ) 63 ) 64 ORTSScreenPage ("camera1on") 65 ) 66 MultiStateDisplay ( 67 Type ( ORTS_STATIC_DISPLAY MULTI_STATE_DISPLAY ) 68 Position ( 246 180 105 16 ) 69 Graphic ("trans.ace") 70 States ( 1 1 1 71 State ( 72 Style ( 0 ) 73 SwitchVal ( 0 ) 74 ) 75 ) 76 ORTSScreenPage ("camera2on") 77 )
I have customised it to my needs in the labels, but maybe that doesn't work.
Well, then we have that ORTS_STATIC_DISPLAY:0:0 is one of the screens, but here the doubts begin: is it possible that the fact that it is called STATIC is the cause of its animation not working?
The second screen is called ORTS_STATIC_DISPLAY:1:0. There are two switches called ORTS_SCREEN_SELECT:0 and ORTS_SCREEN_SELECT:1 and the part representing the ignition pilot is called ORTS_SCREEN_SELECT:2.
When I enter the simulator and put the mouse over the switches, the labels are displayed correctly, but if I click on them, they disappear (and no matter how hard I look for them, it's a mystery where they go), and of course, the displays are not shown.
The .log shows this, for what it's worth:
Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596.cvf:line 27 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596.cvf:line 39 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596.cvf:line 50 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596_rv.cvf:line 27 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596_rv.cvf:line 39 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596_rv.cvf:line 50 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596.cvf:line 27 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596.cvf:line 39 Warning: When expecting a number, we found a ) marker. Using the default -1 in C:\Program Files (x86)\Microsoft Games\Train Simulator\trains\trainset\Tamagochis 596\CABVIEW\596.cvf:line 50
Clearly there is something I haven't quite figured out. Apologies. Any clarification of whatever it is, I will be happy to give it. I really appreciate the help with each new challenge to solve to make this the best simulator of all past, present and future simulators, because I fully support the open source philosophy. Thank you!