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

Place to report issues and suggest improvements to the API documentation.
Post Reply
User avatar
BrainGamer_
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Sun Nov 14, 2021 9:52 pm
Contact:

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

Post 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?

Bilka
Factorio Staff
Factorio Staff
Posts: 3228
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: RailSignalPrototype.rail_piece should be RotatedAnimation (?)

Post 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.)
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
BrainGamer_
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Sun Nov 14, 2021 9:52 pm
Contact:

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

Post 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.

Post Reply

Return to “Documentation Improvement Requests”