Station variable 41 not acting as expected
Moderator: TTDPatch Moderators
Station variable 41 not acting as expected
I've been experimenting with quite a complex usage of station variable 41 and it doesn't seem to be giving the results I'd expect. According to the description in this thread, TTDPatch sets up virtual "fences" around tiles. However, what I'm seeing doesn't agree with my interpretation of that.
Looking at the attached image, I have built a 5 platform x 7 tile station and then overbuilt a single tile at platform 3 tile 7 (using the numbering scheme from the image). I would expect the lines in red to represent the "fences", with platform 4 tile 1 of the right-hand image "seeing" no difference from before, as it is still the same distance from virtual fences in all four directions. However, from the way that the station is coded, it is clear that platforms 3 to 5 of the right-hand station think that they are in a three-platform station, not the five platforms I expect (and would prefer to see). I would also expect platform 5 tile 7 to think that it was in a 2x7 station but it too thinks that it is in a 3-platform station.
Is this a bug or is the scheme more complicated than I'm thinking?
Looking at the attached image, I have built a 5 platform x 7 tile station and then overbuilt a single tile at platform 3 tile 7 (using the numbering scheme from the image). I would expect the lines in red to represent the "fences", with platform 4 tile 1 of the right-hand image "seeing" no difference from before, as it is still the same distance from virtual fences in all four directions. However, from the way that the station is coded, it is clear that platforms 3 to 5 of the right-hand station think that they are in a three-platform station, not the five platforms I expect (and would prefer to see). I would also expect platform 5 tile 7 to think that it was in a 2x7 station but it too thinks that it is in a 3-platform station.
Is this a bug or is the scheme more complicated than I'm thinking?
- Attachments
-
- stationvariable41.png (39.67 KiB) Viewed 1643 times
US Train Set v0.87.1 now released: http://www.tt-forums.net/viewtopic.php?t=8754
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
The fences are directional, and those of the wrong direction are ignored in the counting. So, looking at tile 7 it looks like this:
Var.41 always searches for the closest left and right fences of the right orientation, so platform one counts three platforms to the left left-oriented fence, and is therefore 1/3.
Code: Select all
|| = platform
|> = left fence
<| = right fence
|> || || |> || <| || || <|
1/3 2/3 1/1 2/3 3/3
Now that I thought about it a bit, it wouldn't be hard to change it such that overbuilding always constructs the fences on the other side too, so that you get
That would change how var.41 works, and it might break MB's newstations (or it might fix them, I don't know). Would that be a good idea?
Code: Select all
|> || || <|> || <|> || || <|
1/2 2/2 1/1 1/2 2/2
In a few ways it would make more sense, but I'm not sure that it would necessarily help with my situation. What size station would the top-right tile then think it was in? I see several obvious sizes - 2x7, 2x6, 3x6, 5x6 and possibly more.Patchman wrote:Would that be a good idea?
On a different note, I was going to suggest that tiles "look" orthogonally to find their nearest fences - i.e. they should look in all four directions, which would give the size of the "station" and the tile's position within. I have no idea how hard this would be to do (I tried glancing in the source but it meant absolutely nothing to me) but I think it would make the most sense overall. Again, what this would do to MB's newstations I don't know.
US Train Set v0.87.1 now released: http://www.tt-forums.net/viewtopic.php?t=8754
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Tile 1, platform 5 would see 5x7. Tile 7, platform 5 would see 2x7 (instead of 3x7 as it is now).Oracle wrote:In a few ways it would make more sense, but I'm not sure that it would necessarily help with my situation. What size station would the top-right tile then think it was in? I see several obvious sizes - 2x7, 2x6, 3x6, 5x6 and possibly more.
That's what it does now. Only, the fences are perhaps not what one would expect when using overbuilding.On a different note, I was going to suggest that tiles "look" orthogonally to find their nearest fences - i.e. they should look in all four directions, which would give the size of the "station" and the tile's position within.
Hmm. Now I'm confused, I'm afraid. I originally assumed it worked like that and so posted this thread. My observations just don't seem to agree with that scheme.
Looking at the image in the first post, that station is currently coded so that the station building itself only appears on platforms 1 and 2 (counted from the left) of a station with 3 or more platforms. Therefore tile 1 platform 4 of the right-hand station in that image thinks that it is tile 1 on platform 2, not on platform 4 as I would expect. Hence I'm confused.
Sorry for continuing to trouble you...
Looking at the image in the first post, that station is currently coded so that the station building itself only appears on platforms 1 and 2 (counted from the left) of a station with 3 or more platforms. Therefore tile 1 platform 4 of the right-hand station in that image thinks that it is tile 1 on platform 2, not on platform 4 as I would expect. Hence I'm confused.
Sorry for continuing to trouble you...
US Train Set v0.87.1 now released: http://www.tt-forums.net/viewtopic.php?t=8754
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Now you're confused me too. If you mean tile 7 platform 4 not tile 1, then in your first post you wrote that this tile thinks it's on platform 2 in a 3x7 station. That's what I wrote above too. Only if my proposed changes are implemented would it think it's on platform 1 of a 2x7 station.
Either way, tile 1 platform 4 should always see itself on platform 4 of a 5x7 station as you write in your first post.
Either way, tile 1 platform 4 should always see itself on platform 4 of a 5x7 station as you write in your first post.
Sorry about this...
I made the attached newstat2.grf last night to test this. If you build a 5 platform x 4 tile (or smaller) "Station 1" (default station class) in the y-direction then it shows the platform number in yellow and the tile number in white, using the numbering scheme from my first post.
"Station 2" is similar except that it shows the total number of platforms (as seen by variable 41) in white (with no number for 5 or more platforms).
Therefore the image shows that, after building the single tile on platform 3 tile 4, platform 3 tile 1 now thinks that it is platform 1 tile 1 of a 3-platform station, which isn't what it should be - i.e. variable 41 seems to be behaving incorrectly.
Yes. But my problem is that I'm confident that it doesn't.Patchman wrote:Either way, tile 1 platform 4 should always see itself on platform 4 of a 5x7 station as you write in your first post.
I made the attached newstat2.grf last night to test this. If you build a 5 platform x 4 tile (or smaller) "Station 1" (default station class) in the y-direction then it shows the platform number in yellow and the tile number in white, using the numbering scheme from my first post.
"Station 2" is similar except that it shows the total number of platforms (as seen by variable 41) in white (with no number for 5 or more platforms).
Therefore the image shows that, after building the single tile on platform 3 tile 4, platform 3 tile 1 now thinks that it is platform 1 tile 1 of a 3-platform station, which isn't what it should be - i.e. variable 41 seems to be behaving incorrectly.
- Attachments
-
- newstat2.grf
- (64.5 KiB) Downloaded 58 times
-
- var41.png (32.93 KiB) Viewed 1500 times
US Train Set v0.87.1 now released: http://www.tt-forums.net/viewtopic.php?t=8754
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Who is online
Users browsing this forum: No registered users and 13 guests