Page 1 of 1

RailSignalPrototype.rail_piece should be RotatedAnimation - No, but needs more info

Posted: Mon Nov 13, 2023 7:20 am
by BrainGamer_
RailSignalBasePrototype.rail_piece is currently documented as being an Animation.

When you take a look at the sprites used tho it seems more like it should be a RotatedSprite, while the prototype dump includes a "axially_symmetrical": false property on the definitions which is only used for either RotatedSprites or RotatedAnimations.

The only issue is that they don't seem to contain the mandatory direction_count property (which makes some sense since they will always need 8 (or 16 in 2.0)).

Nevermind on that 8/16 part, for some reason they have 10 frames/directions??? Why?

Re: RailSignalPrototype.rail_piece should be RotatedAnimation (?)

Posted: Mon Nov 13, 2023 7:42 am
by Bilka
It's an animation. You can check the type of it in the in-game prototype explorer to verify.

There is a comment in the code regarding the frame count:
On vertical rail there are two variations of the rail piece. One for odd y-coordinate and the other for even y-coordinate to make these pieces aligned with rail ties. These extra variations are stored as frame 8 and 9.
(Those frame numbers are likely 0-based indexes. The code for this special case is only applied if railPiece has a frame count of 10.)

Re: RailSignalPrototype.rail_piece should be RotatedAnimation - No, but needs more info

Posted: Mon Nov 13, 2023 9:15 am
by BrainGamer_
Bilka wrote: Mon Nov 13, 2023 7:42 am There is a comment in the code regarding the frame count:

Code: Select all

On vertical rail there are two variations of the rail piece. One for odd y-coordinate and the other for even y-coordinate to make these pieces aligned with rail ties. These extra variations are stored as frame 8 and 9.
(Those frame numbers are likely 0-based indexes. The code for this special case is only applied if railPiece has a frame count of 10.)
That makes a lot of sense! Thanks.