Operational turntable
#341
Posted 31 January 2023 - 02:37 AM
Hello.
I do not know. I simply copied the contents of the file a1t27mturntable_animations.txt before the last parenthesis, and it slowly rotated in Shape View. That's the first test. If the animation does not work there, or the turntable is not visible, there may be a parenthesis error when copying.
I made a 24-meter and a 20-meter turntable based on the regulations of the Hungarian State Railways. Both work. I only succeeded on the first and third attempts, I probably made a parenthesis mistake. The second was immediately good.
If you look at the fourth value of Linear_Pos it keeps increasing up to 180 degrees. after that it continuously decreases from there.
Sincerely, Laci1959
#342
Posted 31 January 2023 - 09:22 AM
#343
Posted 31 January 2023 - 10:28 AM
Laci1959, on 30 January 2023 - 11:07 PM, said:
The animation block is bad. There are only 17 lines here. There is a file a1t27mturntable_animations.txt in the Openrails Dokumentation SampleFiles folder. It consists of 385 lines.
Big difference. In fact, it rotates slowly with the animation.
If there is no Animations block in the shape file, the contents of the a1t27mturntable_animations.txt file must be inserted before the last parenthesis.
I did the same in my odell. It spins around nicely.
Sincerely, Laci1959
Ok, you're right. My animation doesn't work for a1t27mturntable.s. I assumed that the turntable (subobject TRACKPIECE) has its pivot point in its center. Then no linear_pos lines would be needed at all.
But TRACKPIECE actually has its pivot point at the edge and therefore needs an x,y,z position change for each keyframe.
#344
Posted 31 January 2023 - 10:37 AM
Traindude, on 31 January 2023 - 02:01 AM, said:
Anywhooo...this is what I get when I view the "new" turntable in TSRE, even when I added the appropriate changes to turntables.dat and tsection.dat:
Hello.
You're right about that, I was careless, I'm sorry.
The only thing about the picture is that it only shows where tracks can be connected. This is enough for track construction.
Sincerely, Laci1959
#345
Posted 31 January 2023 - 10:52 AM
Traindude, on 31 January 2023 - 02:01 AM, said:
I tried changing that minus to a plus, but it unfortunately causes ORTS to crash when I load an activity.
...
Is the w-file "w-001493+010308.w" (with the prefixed minus!) available in your WORLD folder of your route at all?
Because in your snapshot there is no minus sign in the second line at "Tile X: 1493". So we see the w-tile of the w-file "+001493+010308.w" in your snapshot with the turntable.
#346
Posted 31 January 2023 - 11:15 AM
How would one do this, I'm not entirely sure what the procedure is even when looking at the manual?
#347
Posted 31 January 2023 - 06:36 PM
Laci1959, on 31 January 2023 - 02:37 AM, said:
Hello.
I do not know. I simply copied the contents of the file a1t27mturntable_animations.txt before the last parenthesis, and it slowly rotated in Shape View. That's the first test. If the animation does not work there, or the turntable is not visible, there may be a parenthesis error when copying.
I made a 24-meter and a 20-meter turntable based on the regulations of the Hungarian State Railways. Both work. I only succeeded on the first and third attempts, I probably made a parenthesis mistake. The second was immediately good.
If you look at the fourth value of Linear_Pos it keeps increasing up to 180 degrees. after that it continuously decreases from there.
Sincerely, Laci1959
I actually viewed the new turntable in Shape Viewer and for some reason the animate button caused the "bridge" piece to pop into an eccentric position. Deleting the linear keys solved this and now the turntable rotates properly.
jonas, on 31 January 2023 - 10:52 AM, said:
No, the world file is shown as "w+001493+010308.w". But if I change the entry in the turntables.dat file to "WFile ( "w+001493+010308.w" )", ORTS crashes when I try to load the route.:
#348
Posted 31 January 2023 - 09:18 PM
"Warning: Replaced duplicate TrackShape 24864 in F:\MSTS Stuff\Train Simulator\ROUTES\au_ctn_test_route\Openrails\TSECTION.DAT:line 32"
"Warning: Replaced duplicate TrackShape 37298 in F:\MSTS Stuff\Train Simulator\ROUTES\au_ctn_test_route\Openrails\TSECTION.DAT:line 39"
I'm not up to date about the route-local OR tsection.dat, but the named TrackShapes (24864 and 37298) are your turntable tracks.
So somebody else here has an idea what the replaceing of the "dublicate" turntable-TrackShapes caused...
...and then the line: "Warning: Expected end of file in F:\MSTS Stuff\Train Simulator\ROUTES\au_ctn_test_route\openrails\turntables.dat:line 20"
So, the standard question about your "turntables.dat": Is the first line a blank one? Are all brackets exists?
Traindude, on 31 January 2023 - 06:36 PM, said:
In the error statement at the end of the "OpenRailsLog.txt" an array index problem is shown. Probably in the "Turntables.cs" - a part of the OR code managing the turntables.
So, as next - in your shoes - I would try to prove if the turntable Shapes are correct working in the ShapeViewer. Maybe you will upload them here to have a look at it?
#349
Posted 31 January 2023 - 11:25 PM
jonas, on 31 January 2023 - 09:18 PM, said:
"Warning: Replaced duplicate TrackShape 24864 in F:\MSTS Stuff\Train Simulator\ROUTES\au_ctn_test_route\Openrails\TSECTION.DAT:line 32"
"Warning: Replaced duplicate TrackShape 37298 in F:\MSTS Stuff\Train Simulator\ROUTES\au_ctn_test_route\Openrails\TSECTION.DAT:line 39"
I'm not up to date about the route-local OR tsection.dat, but the named TrackShapes (24864 and 37298) are your turntable tracks.
So somebody else here has an idea what the replaceing of the "dublicate" turntable-TrackShapes caused...
...and then the line: "Warning: Expected end of file in F:\MSTS Stuff\Train Simulator\ROUTES\au_ctn_test_route\openrails\turntables.dat:line 20"
So, the standard question about your "turntables.dat": Is the first line a blank one? Are all brackets exists?
Okay, it may sound paradox, but I think the crash proofs, that when you use the right w-file name "WFile ( "w+001493+010308.w" )" in the turntable.dat, OR starts at the right w-file-location some procedures while loading the route which have to do when loading turntables.
In the error statement at the end of the "OpenRailsLog.txt" an array index problem is shown. Probably in the "Turntables.cs" - a part of the OR code managing the turntables.
So, as next - in your shoes - I would try to proof if the turntable Shapes are correct working in the ShapeViewer. Maybe you will upload them here to have a look at it?
Here is the turntables.dat in question:
2 Turntable( WFile ( "w+001454+010325.w" ) UiD ( 418 ) XOffset ( 0 ) YOffset ( 1.35 ) ZOffset ( 0 ) TrackShapeIndex ( 37298 ) Animation ( "Deck" ) Diameter ( 18.6 ) ) Turntable( WFile ( "w+001493+010308.w" ) UiD ( 174 ) XOffset ( 0 ) YOffset ( 1.175 ) ZOffset ( 0 ) TrackShapeIndex ( 24864 ) Animation ( "TRACKPIECE" ) Diameter ( 42 ) )
My text editor of choice, PSPad, has a matching-bracket search function, and it proves the code is bracket-tight. I have also included the shape and .sd file below, in uncompressed form.
And by the way, in reference to the line-numbers mentioned in the log files, does that include or exclude the mandatory blank first line?
#350
Posted 01 February 2023 - 12:09 AM
Traindude, on 31 January 2023 - 11:25 PM, said:
2 Turntable( WFile ( "w+001454+010325.w" ) UiD ( 418 ) XOffset ( 0 ) YOffset ( 1.35 ) ZOffset ( 0 ) TrackShapeIndex ( 37298 ) Animation ( "Deck" ) Diameter ( 18.6 ) ) Turntable( WFile ( "w+001493+010308.w" ) UiD ( 174 ) XOffset ( 0 ) YOffset ( 1.175 ) ZOffset ( 0 ) TrackShapeIndex ( 24864 ) Animation ( "TRACKPIECE" ) Diameter ( 42 ) )
My text editor of choice, PSPad, has a matching-bracket search function, and it proves the code is bracket-tight. I have also included the shape and .sd file below, in uncompressed form.
And by the way, in reference to the line-numbers mentioned in the log files, does that include or exclude the mandatory blank first line?
Hello.
The name in the Animation line must match the name of the rotating part. The name of the first block Animation ("Deck") is incorrect if it is the same turntable as in the second post.
Of course, if it is a unique model where the rotating part is named Deck, then of course it is correct. I named the rotating part HID (bridge). Many other parts are ordered under this, it is more convenient for me. Of course the
turntable(
...
Animation ( "HID" )
...
)
format I use.
Sincerely, Laci 1959
https://kephost.net/p/ODU2MjYy.png