Elvas Tower: Station clocks - Elvas Tower

Jump to content

  • 9 Pages +
  • « First
  • 6
  • 7
  • 8
  • 9
  • You cannot start a new topic
  • You cannot reply to this topic

Station clocks Creating clocks to synchronize with simulation Rate Topic: -----

#71 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 29 April 2021 - 06:39 AM

Hi,

Freely after the motto, which Ryan wisely mentioned "miss the forest for the trees" I would like to bring an idea into play, which I unfortunately always forgot so far, although I had described it already in this post years ago, where still no single byte was programmed for it:

The OR clocks are quite conceivable without any external auxiliary files at all. The fact that in a clock shape the clock hands have clearly defined subobject names (ORTS_SHand_clock etc.) is enough for OR to recognize such shapes as clocks. For this it needs neither a clocks.dat nor an animated.clocks-or or anything else external!

Just as when loading shapes from a w-file during the running game it is always tested whether this shape contains an animation at all, here only the additional tests would be necessary whether one of the names of the animation objects of a shape contains "Hand_clock" and begins with "ORTS_".

It could be that testing this has a loading time critical aspect, but for now it is compared with the shapes in the list coming from the extern file ... and these comparisons would then be omitted as a substitute.

Would there be any objection to simply evaluating OR-clocks by the subobject names?

Best regards
Jonas

#72 User is online   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,490
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 01 May 2021 - 05:50 AM

 jonas, on 29 April 2021 - 06:39 AM, said:

The OR clocks are quite conceivable without any external auxiliary files at all. The fact that in a clock shape the clock hands have clearly defined subobject names (ORTS_SHand_clock etc.) is enough for OR to recognize such shapes as clocks. For this it needs neither a clocks.dat nor an animated.clocks-or or anything else external!

Just as when loading shapes from a w-file during the running game it is always tested whether this shape contains an animation at all, here only the additional tests would be necessary whether one of the names of the animation objects of a shape contains "Hand_clock" and begins with "ORTS_".

It could be that testing this has a loading time critical aspect, but for now it is compared with the shapes in the list coming from the extern file ... and these comparisons would then be omitted as a substitute.

Would there be any objection to simply evaluating OR-clocks by the subobject names?

It does not seem objectionable to me.

#73 User is offline   rickloader 

  • Conductor
  • Group: Status: First Class
  • Posts: 491
  • Joined: 05-February 13
  • Gender:Male
  • Location:Southampton uk
  • Simulator:Open Rails
  • Country:

Posted 01 May 2021 - 08:40 AM

Here is my animated.clocks-or. My first Json file! Run from my Route folder using this Fridays unstable version

[
{
"Name": "clock1face.s",
"ClockType": "analog"
}
]
OR gets to character 1 and line 1 and complains the character is not recognised.(UK keyboard)
Please may I have some guidance. Thanks, Rick

#74 User is offline   rickloader 

  • Conductor
  • Group: Status: First Class
  • Posts: 491
  • Joined: 05-February 13
  • Gender:Male
  • Location:Southampton uk
  • Simulator:Open Rails
  • Country:

Posted 01 May 2021 - 09:43 AM

Well, I have run my Json through a checker at jsonformatter.org and it says I have an error in that the curly brackets need a tab. so my file now looks like

[
{
"Name": "clock1face.s",
"ClockType": "analog"
}
]
But it still does not run. An on line json checker seems invaluable to non programmers
If Json is to be the standard for OR, I suggest a great deal more error trapping will be needed. Should my simple json file really be fatal to OR?
Edit. I see my tabs are lost on pasting into ET, but they are before both curly brackets

#75 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 01 May 2021 - 10:03 AM

Hi Rick,

 rickloader, on 01 May 2021 - 09:43 AM, said:

If Json is to be the standard for OR, I suggest a great deal more error trapping will be needed. Should my simple json file really be fatal to OR?
Edit. I see my tabs are lost on pasting into ET, but they are before both curly brackets


Let's continue this with a PM and then post the conclusion here. Please send me the file too.

#76 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 01 May 2021 - 03:13 PM

 James Ross, on 01 May 2021 - 05:50 AM, said:

It does not seem objectionable to me.

Ok, then I will try to write a code for Scenery.cs -> class WorldFile to register the clocks of a w-file by their clock hand names.

Kind regards
Jonas



#77 User is offline   rickloader 

  • Conductor
  • Group: Status: First Class
  • Posts: 491
  • Joined: 05-February 13
  • Gender:Male
  • Location:Southampton uk
  • Simulator:Open Rails
  • Country:

Posted 02 May 2021 - 09:52 AM

Thank you Jonas for your continued work on clocks.
To return to my problem with clocks (sorry, I hope I`m not spoiling this thread) . Chris kindly put me straight. I had mistakenly used a Riich text format. When I realised , I copied the text into wordpad, but unknown to me this included a lot of invisible characters. It was these which tripped up OR. Stupid of me.
A long time ago notepad was deemed inadequate for MSTS files but now seems ok for OR
Not out of trouble yet, because the 3dc exporter causes trouble The file created by 3dc. gives 5 positions of tcb_rot as does the specimen script in the manual. starting at 0 (12) 1(3) 2(6) 3(9) 4(12) . But 3dc exports the .s as tcb rot 5 slerp_rot 0 1 2 3 4 and not 5 but back to 0 again.
I can hand edit the .s perhaps. But I mention this because recently on ET the need for hand editing of files was questioned. It is not as suggested, a kind of quirky stubborn holding to outdated ideas., but Rather a desparate attempt to get something working..
In the case of 3dc ,the exporter defeated me with animated signals, and I may have to remake the clock in TSM

#78 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 02 May 2021 - 11:43 AM

Hi rickloader,

Good to hear you were able to solve your animated.clocks-or problem with Chris's help! I hope we won't need the animated.clocks-or or any other extern files concerned the clocks at all in the future - we'll see how it goes.

 rickloader, on 02 May 2021 - 09:52 AM, said:

...A long time ago notepad was deemed inadequate for MSTS files but now seems ok for OR...
I'm almost ever work with notepad. Seems very ok to me.

 rickloader, on 02 May 2021 - 09:52 AM, said:

... But 3dc exports the .s as tcb rot 5 slerp_rot 0 1 2 3 4 and not 5 but back to 0 again. ...
What is 3dc? I still work with this old fashion workflow: 3dsmax -> *.3ds -> conv3ds.exe (MSTS) -> Shape-Maker -> s-file. By the way, this often results in the most adventurous animations, because apparently my old 3dsmax version often writes the animations only fragmentarily into the *.3ds. When it gets too weird for me, I run the model (*.3ds) through gmax and get at least good animation code sequences in the s-file export.

 rickloader, on 02 May 2021 - 09:52 AM, said:

... But I mention this because recently on ET the need for hand editing of files was questioned. It is not as suggested, a kind of quirky stubborn holding to outdated ideas., but Rather a desparate attempt to get something working..
In the case of 3dc ,the exporter defeated me with animated signals, and I may have to remake the clock in TSM
An important(!) aspect that I had so far not right on the screen. Files that I called one-way files or user-machine files, which transfer data from the user to OR, often do not originate from the user, but have already been created by a "machine". The user takes over here thus code adjustment work which compensate quasi transfer errors between the programs. There will certainly never be editors for this, because we do not yet know the future programs that provide content for OR/MSTS and their possible errors.
Thank you for pointing out this aspect.

Maybe you would like to write a little something about it in this thread, otherwise it will actually be too off topic here :-).

Thank you
Jonas

#79 User is offline   Rj Zondervan 

  • Apprentice
  • Group: Status: Active Member
  • Posts: 40
  • Joined: 09-March 11
  • Gender:Male
  • Simulator:MSTS/ORTS
  • Country:

Posted 03 May 2021 - 10:19 AM

 rickloader, on 02 May 2021 - 09:52 AM, said:

A long time ago notepad was deemed inadequate for MSTS files but now seems ok for OR


Notepad always has been quite adequate, and still is when writing JSON files. However, I would recommend a bit more advanced text editor like Notepad++, which has, among a lot of other features, syntax highlighting for JSON, C# and almost every well standardised language that is around.

Quote

What is 3dc? I still work with this old fashion workflow: 3dsmax -> *.3ds -> conv3ds.exe (MSTS) -> Shape-Maker -> s-file.

3dc is 3D Crafter (formerly 3D Canvas), also a decent, and free, 3D editor, although I still haven't managed to use it with the ease I use 3D Studio Max.

#80 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,996
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 04 May 2021 - 01:20 AM

OR NewYear MG rev. 98 now accepts animated station clocks without the need of additional files, as proposed here http://www.elvastowe...post__p__271611 .
Code by jonas.

  • 9 Pages +
  • « First
  • 6
  • 7
  • 8
  • 9
  • 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