Station clocks Creating clocks to synchronize with simulation
#71
Posted 29 April 2021 - 06:39 AM
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
Posted 01 May 2021 - 05:50 AM
jonas, on 29 April 2021 - 06:39 AM, said:
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
Posted 01 May 2021 - 08:40 AM
[
{
"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
Posted 01 May 2021 - 09:43 AM
[
{
"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
Posted 01 May 2021 - 10:03 AM
rickloader, on 01 May 2021 - 09:43 AM, said:
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
Posted 01 May 2021 - 03:13 PM
#77
Posted 02 May 2021 - 09:52 AM
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
Posted 02 May 2021 - 11:43 AM
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:
rickloader, on 02 May 2021 - 09:52 AM, said:
rickloader, on 02 May 2021 - 09:52 AM, said:
In the case of 3dc ,the exporter defeated me with animated signals, and I may have to remake the clock in TSM
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
Posted 03 May 2021 - 10:19 AM
rickloader, on 02 May 2021 - 09:52 AM, said:
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
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
Posted 04 May 2021 - 01:20 AM
Code by jonas.