Elvas Tower: Managing multiple screen pages on a display in 2D and 3D cabs - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Managing multiple screen pages on a display in 2D and 3D cabs Rate Topic: -----

#11 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 02 November 2021 - 08:53 AM

Hi Cédric,
that's a powerful feature indeed. I think that one feature does not exclude the other. I may think that there are people which are more comfortable working with .cvf files instead of generating Javascript code, even at the cost of less power, while for others your feature will be preferred.

#12 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 06 November 2021 - 01:17 PM

The first release of the feature is now available in ORNYMG rev. 109, for both 2D and 3D cabs.

#13 User is offline   akioyamamura 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 90
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 November 2021 - 07:24 AM

Thank you Carlo, nice feature! Please, could you show us a cvf file as an example? I'm confuse about how to animate the screen swap in a 3D cab.

#14 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 November 2021 - 08:08 AM

Hi,
The 3D cab I took as example is the unfinished 3D cab that you sent me. I didn't want to use Blender or so on, so as buttons I re-used the reset, bell and sanders button.
Attached you have the part of the modified test .cvf file
Attached File  AC44i.cvf.txt (4.36K)
Number of downloads: 483
In the .s file I renamed the Reset, Bell and Sanders entries to ORTS_SCREEN_SELECT:0:0, ORTS_SCREEN_SELECT:1 and ORTS_SCREEN_SELECT:2 both in the matrices and in the animations section.
The changes I have implemented work this way:
At the beginning of the game you won't see the Reset button and the digital speedometer: in fact, they are linked to screen page "sempronio", and the active screen page is "default" (the one active at game start).
When pressing the button showing up as "semproniobell", the digital speedometer will appear as well as the reset button will appear (because they are linked to the "sempronio" screenpage, and the semproniobell button has line ORTSNewScreenPage ( "sempronio" )) and the direction multistate will disappear (because it is linked with the "default" screenpage).
If you now press the button showing up as "---reset" the button itself, the direction multistate and the direction speedometer will disappear too, because they haven't line ORTSScreenPage ( "---" ).
If you press the button showing up as "defaultsanders", the direction multistate will appear again, because it is linked to screen page "default" and the button has line ORTSNewScreenPage ( "default" ).

Concept is: the controls with no ORTSScreenPage lines will appear always;
in addition, controls with ORTSScreenPage ( "default" ) will appear at game start;
if line ORTSDisplay is missing, the control is considered as belonging to display 0;
only one screen page per display can be active;
by pressing the ORTS_SCREEN_SELECT button, the controls related to screen page shown in line ORTSNewScreenPage will appear, and the ones related to screen page previously active won't show; if you press again the same ORTS_SCREEN_SELECT button, you won't have any effect, if its newscreenpage is already active;
also ORTS_SCREEN_SELECT buttons can be linked to a screen page, so they can appear or disappear when required;
you can insert in a control more lines ORTSScreenPage: in this case, the control will appear when any of the related screen pages is active.

#15 User is offline   Laci1959 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,131
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Alföld
  • Country:

Posted 07 November 2021 - 08:12 AM

View PostWeter, on 30 October 2021 - 01:51 AM, said:

while 3d view have, in good case, just one default viewpoint,

The camera can be moved and rotated in any direction in the 3d cab. For example, you can look at the radio settings behind your back (Masha 3d cab). Crtl or Alt + arrows. While driving a steam locomotive, I move it in a left arc to the left and look there. In the meantime, I turn around from time to time to see the water level as well. Of course, it is not always possible to get back exactly, but this has not caused any problems so far.

#16 User is offline   akioyamamura 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 90
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 November 2021 - 10:02 AM

View PostCsantucci, on 07 November 2021 - 08:08 AM, said:

Hi,
The 3D cab I took as example is the unfinished 3D cab that you sent me. I didn't want to use Blender or so on, so as buttons I re-used the reset, bell and sanders button.
Attached you have the part of the modified test .cvf file
Attachment AC44i.cvf.txt
In the .s file I renamed the Reset, Bell and Sanders entries to ORTS_SCREEN_SELECT:0:0, ORTS_SCREEN_SELECT:1 and ORTS_SCREEN_SELECT:2 both in the matrices and in the animations section.
The changes I have implemented work this way:
At the beginning of the game you won't see the Reset button and the digital speedometer: in fact, they are linked to screen page "sempronio", and the active screen page is "default" (the one active at game start).
When pressing the button showing up as "semproniobell", the digital speedometer will appear as well as the reset button will appear (because they are linked to the "sempronio" screenpage, and the semproniobell button has line ORTSNewScreenPage ( "sempronio" )) and the direction multistate will disappear (because it is linked with the "default" screenpage).
If you now press the button showing up as "---reset" the button itself, the direction multistate and the direction speedometer will disappear too, because they haven't line ORTSScreenPage ( "---" ).
If you press the button showing up as "defaultsanders", the direction multistate will appear again, because it is linked to screen page "default" and the button has line ORTSNewScreenPage ( "default" ).

Concept is: the controls with no ORTSScreenPage lines will appear always;
in addition, controls with ORTSScreenPage ( "default" ) will appear at game start;
if line ORTSDisplay is missing, the control is considered as belonging to display 0;
only one screen page per display can be active;
by pressing the ORTS_SCREEN_SELECT button, the controls related to screen page shown in line ORTSNewScreenPage will appear, and the ones related to screen page previously active won't show; if you press again the same ORTS_SCREEN_SELECT button, you won't have any effect, if its newscreenpage is already active;
also ORTS_SCREEN_SELECT buttons can be linked to a screen page, so they can appear or disappear when required;
you can insert in a control more lines ORTSScreenPage: in this case, the control will appear when any of the related screen pages is active.


If i understood correctly, the ORTS_SCREEN_SELECT TWO_STATE is related to the button that change the screens. Is it correct?
But what's the hierarchy name of the object and animation that contain the screen itself? Is there a command like ORTS_SCREEN_SELECT DISPLAY or something like this?

#17 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 November 2021 - 11:21 AM

Yes, ORTS_SCREEN_SELECT TWO_STATE is related to the button that changes the screen pages.
To answer your second question, every screen page is the sum of the controls that have the screen page name in one of their ORTSScreenPage lines, plus the controls that reside within the display area and that have no ORTSScreenPage lines.
So you build such controls like now any other control, and insert the additional line(s) in the .cvf file blocks of such controls. At runtime it will be OR that will display only the controls related to the active screen page.

#18 User is offline   akioyamamura 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 90
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 November 2021 - 11:49 AM

View PostCsantucci, on 07 November 2021 - 11:21 AM, said:

Yes, ORTS_SCREEN_SELECT TWO_STATE is related to the button that changes the screen pages.
To answer your second question, every screen page is the sum of the controls that have the screen page name in one of their ORTSScreenPage lines, plus the controls that reside within the display area and that have no ORTSScreenPage lines.
So you build such controls like now any other control, and insert the additional line(s) in the .cvf file blocks of such controls. At runtime it will be OR that will display only the controls related to the active screen page.


Ok, I understood how to make the displays appear and disappear on the screen. My problem is how to change the screen itself.
In the image bellow you can see what I want to be my first screen.

https://ibb.co/R9nfj8N

In the second image you can see what I'm planning to change the screens. It's a animation that rotates 90 degrees and display the second screen. But what's the command to do that? Sorry, maybe I'm missing something about the mechanism of this feature.

https://ibb.co/Q9TymsJ

#19 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 07 November 2021 - 01:24 PM

OK, so you mean the background of the various screenpages (the part that remains unaltered).
To do this I have at the moment only this in mind. For every background you generate a multistatedisplay control; they can all refer to the same two state variable, like e.g. CAB_RADIO. CAB_RADIO has two states, so your .ace file will have two times the background picture. Everyone of these multistatedisplay controls will have an ORTSScreenPage line with the name of the screenpage displayed.
All these controls will have the same position and animation. At every moment, only the picture of the control will be shown, that has in ORTSScreenPage the name of the screenpage selected.
I understand that it is not very elegant, and it would be better to have a new ORTSDisplay cabview control that has only one state, so that it is not necessary to repeat twice the background picture in the .ace file, but such control does not exist at the moment.

#20 User is offline   akioyamamura 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 90
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 November 2021 - 07:26 PM

Your idea works perfectly, Carlo. I tried with the CAB_RADIO variable, but I'm trying to find a TriState or a Multistate that allows me 3 backgrouds at least. Could tell me what variable I can choose? I'm tried the "Wipers" and "pantograph 4C" without success.

#21 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 08 November 2021 - 01:34 AM

In ORNYMG 109.2 a new control, specifically devoted to the loading of the background (static) part of screen pages has been made available: ORTS_STATIC_DISPLAY. Its way of working has been added in the first thread of the post.

@akioyamamura: I don't understand why you need more states. In reality only one is needed, and I have created the ORTS_STATIC_DISPLAY control for that.
Every screenpage has its own static part, and for each of them an ORTS_STATIC_DISPLAY control has to be generated, that contains in line ORTSScreenPage the name of the related screen, and has as .Ace file only that specific static part.

#22 User is offline   akioyamamura 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 90
  • Joined: 30-August 21
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 08 November 2021 - 06:22 AM

This new funcionality is exactly what I need. Thank you Carlo!

https://youtu.be/6yBgBabjFtg

#23 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 10 November 2021 - 12:03 AM

At the moment the strings within the parentheses of ORTSScreenPage and ORTSNewScreenPage must have only lowercase characters. This limitation will be removed in next release of ORNYMG.

#24 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Posts: Elite Member
  • Posts: 7,445
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 11 November 2021 - 01:50 AM

The restriction has been removed in ORNYMG 109.4.

#25 User is offline   cjakeman 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 3,031
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 23 November 2021 - 11:27 AM

View PostSerana, on 02 November 2021 - 12:25 AM, said:

I had something even more ambitious in mind: https://blueprints.l...js-cab-controls

Basically, you would define a place on the 2D or 3D cab as a screen which will display the content of an HTML page with JavaScript (to make it interactive with the simulator).
That way, you can really customize what you want to display on the screen.

That's basically how screens work in Microsoft Flight Simulator.

James and I have talked this over and we don't think this approach is appropriate right now.

A lot of work would be needed (and I believe Microsoft had lots of problems with their initial rollout). There is also the common problem of publishing controls which use features within OR which cannot then be improved without breaking content.

These issues are not insurmountable, so perhaps we can revisit the idea later when we come to create our own cab view format.

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users